Fix: resume last track not always working correctly
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Thu, 6 Mar 2025 09:07:23 +0000 (10:07 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Thu, 6 Mar 2025 09:07:23 +0000 (10:07 +0100)
music_assistant/controllers/player_queues.py

index df653b4d1ec84ad5303fc26dd06594a9d3ec284a..ac4eb0eefd6f8502023738cac552067163f8cdaf 100644 (file)
@@ -1607,9 +1607,9 @@ class PlayerQueuesController(CoreController):
                 elapsed_time = int(player.corrected_elapsed_time or 0)
                 current_index = self.index_by_id(queue_id, item_id)
             else:
-                # this should not happen but we will handle it gracefully
-                elapsed_time = 0
-                current_index = None
+                # this may happen if the player is still transitioning between tracks
+                # we ignore this for now and keep the current index as is
+                return
 
             # get current/next item based on current index
             queue.current_index = current_index