Divide and manage multiple download links directly in the library

This commit is contained in:
RemixDev 2020-06-19 11:08:07 +02:00
parent c8875483bc
commit dd45835039
2 changed files with 14 additions and 4 deletions

View File

@ -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']}")

View File

@ -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",