Moved features from pyweb to the library

Also fixed some errors
This commit is contained in:
RemixDev
2020-08-16 10:41:18 +02:00
parent 7088bff58d
commit d4bcc728f4
3 changed files with 95 additions and 37 deletions

View File

@ -107,13 +107,13 @@ class DownloadJob:
if isinstance(self.queueItem, QISingle):
result = self.downloadWrapper(self.queueItem.single)
if result:
singleAfterDownload(result)
self.singleAfterDownload(result)
elif isinstance(self.queueItem, QICollection):
tracks = [None] * len(self.queueItem.collection)
with ThreadPoolExecutor(self.settings['queueConcurrency']) as executor:
for pos, track in enumerate(self.queueItem.collection, start=0):
tracks[pos] = executor.submit(self.downloadWrapper, track)
download_path = collectionAfterDownload(tracks)
self.collectionAfterDownload(tracks)
if self.interface:
if self.queueItem.cancel:
self.interface.send('currentItemCancelled', self.queueItem.uuid)
@ -486,7 +486,7 @@ class DownloadJob:
logger.info(f"[{track.mainArtist['name']} - {track.title}] Track download completed")
self.queueItem.downloaded += 1
if self.interface:
self.interface.send("updateQueue", {'uuid': queueItem.uuid, 'downloaded': True, 'downloadPath': writepath})
self.interface.send("updateQueue", {'uuid': self.queueItem.uuid, 'downloaded': True, 'downloadPath': writepath})
return result
def getPreferredBitrate(self, track):