fix index error in queue
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 1 Jun 2022 14:10:41 +0000 (16:10 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 1 Jun 2022 14:10:41 +0000 (16:10 +0200)
music_assistant/models/player_queue.py

index 547794b95ab394714a41a9a20f46b5a0e1566a1e..9dbc7b1d9b2c2d0ae3cf60ceef9d47e5ba884fcc 100644 (file)
@@ -218,7 +218,7 @@ class PlayerQueue:
                 queue_items.append(QueueItem.from_media_item(track))
 
         # clear queue first if it was finished
-        if (self._current_index or 0) >= (len(self._items) - 1):
+        if self._current_index and self._current_index >= (len(self._items) - 1):
             self._current_index = None
             self._items = []