From dd45835039cb2bb8d13096c42152a397852fa0c8 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Fri, 19 Jun 2020 11:08:07 +0200 Subject: [PATCH] Divide and manage multiple download links directly in the library --- deemix/app/queuemanager.py | 16 +++++++++++++--- setup.py | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/deemix/app/queuemanager.py b/deemix/app/queuemanager.py index 635b4b8..d4222b7 100644 --- a/deemix/app/queuemanager.py +++ b/deemix/app/queuemanager.py @@ -251,8 +251,18 @@ def addToQueue(dz, sp, url, settings, bitrate=None, interface=None): global currentItem, queueList, queue if not dz.logged_in: return "Not logged in" - logger.info("Generating queue item for: "+url) - queueItem = generateQueueItem(dz, sp, url, settings, bitrate, interface=interface) + if type(url) is list: + queueItem = [] + for link in url: + logger.info("Generating queue item for: "+link) + item = generateQueueItem(dz, sp, link, settings, bitrate, interface=interface) + if type(item) is list: + queueItem += item + else: + queueItem.append(item) + else: + logger.info("Generating queue item for: "+url) + queueItem = generateQueueItem(dz, sp, url, settings, bitrate, interface=interface) if type(queueItem) is list: for x in queueItem: if 'error' in x: @@ -263,9 +273,9 @@ def addToQueue(dz, sp, url, settings, bitrate=None, interface=None): continue if interface: interface.send("addedToQueue", slimQueueItem(x)) - logger.info(f"[{x['uuid']}] Added to queue.") queue.append(x['uuid']) queueList[x['uuid']] = x + logger.info(f"[{x['uuid']}] Added to queue.") else: if 'error' in queueItem: logger.error(f"[{url}] {queueItem['error']}") diff --git a/setup.py b/setup.py index ec5337b..cd869b1 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text() setup( name="deemix", - version="1.0.22", + version="1.0.23", description="A barebone deezer downloader library", long_description=README, long_description_content_type="text/markdown",