Added start queue function

This commit is contained in:
RemixDev 2021-03-07 12:03:50 +01:00
parent 318ad689ea
commit b91d2a1af3
No known key found for this signature in database
GPG Key ID: B33962B465BDB51C
1 changed files with 7 additions and 3 deletions

View File

@ -443,9 +443,7 @@ class QueueManager:
if interface: interface.send("addedToQueue", queueItem.getSlimmedItem()) if interface: interface.send("addedToQueue", queueItem.getSlimmedItem())
else: else:
return False return False
if not self.queueThread: self.startQueue(interface, dz)
self.queueThread = threading.Thread(target=self.nextItem, args=(dz, interface))
self.queueThread.start()
return True return True
def nextItem(self, dz=None, interface=None): def nextItem(self, dz=None, interface=None):
@ -529,6 +527,12 @@ class QueueManager:
'restored': True 'restored': True
}) })
def startQueue(self, interface=None, dz=None):
if not dz: dz = self.dz
if dz.logged_in and not self.queueThread:
self.queueThread = threading.Thread(target=self.nextItem, args=(dz, interface))
self.queueThread.start()
def restoreQueue(self, queue, queueComplete, queueList, settings): def restoreQueue(self, queue, queueComplete, queueList, settings):
self.queue = queue self.queue = queue
self.queueComplete = queueComplete self.queueComplete = queueComplete