From 66d2897650f1b10fc972fe5474e1302188c4ce7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Sat, 26 Mar 2016 22:14:12 -0600 Subject: [PATCH] Play-all removes the previous files in queue --- src/controller/player.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/controller/player.py b/src/controller/player.py index e088427..a52d1c7 100644 --- a/src/controller/player.py +++ b/src/controller/player.py @@ -74,13 +74,12 @@ class audioPlayer(object): self.stream.volume = self.vol/100.0 def play_all(self, list_of_urls): - if len(self.queue) == 0: - self.queue = list_of_urls - else: - for i in list_of_urls: - self.queue.append(i) + self.queue = list_of_urls self.play(self.queue[0]) self.queue.remove(self.queue[0]) + if hasattr(self, "worker") and self.worker != None: + self.worker.cancel() + self.worker = None self.worker = RepeatingTimer(5, self.player_function) self.worker.start()