mirror of
https://gitlab.com/RemixDev/deemix-py.git
synced 2024-12-28 02:26:14 +00:00
Added interface feedback when processing multiple links
This commit is contained in:
parent
2fdce7d137
commit
a7bba342d3
|
@ -8,6 +8,7 @@ from pathlib import Path
|
|||
import json
|
||||
from os import remove
|
||||
import eventlet
|
||||
import uuid
|
||||
urlopen = eventlet.import_patched('urllib.request').urlopen
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
@ -369,6 +370,8 @@ class QueueManager:
|
|||
|
||||
if type(url) is list:
|
||||
queueItem = []
|
||||
request_uuid = str(uuid.uuid4())
|
||||
if interface: interface.send("startGeneratingItems", {'uuid': request_uuid, 'total': len(url)})
|
||||
for link in url:
|
||||
item = parseLink(link)
|
||||
if not item: continue
|
||||
|
@ -376,6 +379,7 @@ class QueueManager:
|
|||
queueItem += item
|
||||
else:
|
||||
queueItem.append(item)
|
||||
if interface: interface.send("finishGeneratingItems", {'uuid': request_uuid, 'total': len(queueItem)})
|
||||
if not len(queueItem):
|
||||
return False
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue