mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
add silence removal using pydub and multithreading
+ fix favorites endpoint returning items less than limit + add endpoint to remove get silence padding + add 'the ulitimate' and 'compilation' to compilation album filters + misc
This commit is contained in:
@@ -10,3 +10,25 @@ def background(func):
|
||||
threading.Thread(target=func, args=a, kwargs=kw).start()
|
||||
|
||||
return background_func
|
||||
|
||||
|
||||
class ThreadWithReturnValue(threading.Thread):
|
||||
"""
|
||||
A thread class that returns a value on join.
|
||||
|
||||
Credit: https://stackoverflow.com/a/6894023
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self, group=None, target=None, name=None, args=(), kwargs={}, Verbose=None
|
||||
):
|
||||
threading.Thread.__init__(self, group, target, name, args, kwargs)
|
||||
self._return = None
|
||||
|
||||
def run(self):
|
||||
if self._target is not None:
|
||||
self._return = self._target(*self._args, **self._kwargs)
|
||||
|
||||
def join(self, *args):
|
||||
threading.Thread.join(self, *args)
|
||||
return self._return
|
||||
|
||||
Reference in New Issue
Block a user