From b91d2a1af379e96299b03b32440c7574aea198e5 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sun, 7 Mar 2021 12:03:50 +0100 Subject: [PATCH] Added start queue function --- deemix/app/queuemanager.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/deemix/app/queuemanager.py b/deemix/app/queuemanager.py index 8ebcb2f..03a8a89 100644 --- a/deemix/app/queuemanager.py +++ b/deemix/app/queuemanager.py @@ -443,9 +443,7 @@ class QueueManager: if interface: interface.send("addedToQueue", queueItem.getSlimmedItem()) else: return False - if not self.queueThread: - self.queueThread = threading.Thread(target=self.nextItem, args=(dz, interface)) - self.queueThread.start() + self.startQueue(interface, dz) return True def nextItem(self, dz=None, interface=None): @@ -529,6 +527,12 @@ class QueueManager: '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): self.queue = queue self.queueComplete = queueComplete