Added interface feedback when processing multiple links

This commit is contained in:
RemixDev 2020-10-14 23:22:21 +02:00
parent 2fdce7d137
commit a7bba342d3

View file

@ -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: