Fix: skip unplayable track at playback start
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 18 May 2025 12:20:25 +0000 (14:20 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 18 May 2025 12:20:25 +0000 (14:20 +0200)
music_assistant/controllers/player_queues.py

index 0d632cd4e4966a168d639a2279595b54fc810097..15846dd297e7506e9491b7742d74b2dc94ea071b 100644 (file)
@@ -1496,8 +1496,8 @@ class PlayerQueuesController(CoreController):
         """Return next QueueItem for given queue."""
         if isinstance(cur_index, str):
             cur_index = self.index_by_id(queue_id, cur_index)
-        for _ in range(5):
-            if (next_index := self._get_next_index(queue_id, cur_index)) is None:
+        for skip in range(5):
+            if (next_index := self._get_next_index(queue_id, cur_index + skip)) is None:
                 break
             next_item = self.get_item(queue_id, next_index)
             if not next_item.available: