From: Marcel van der Veldt Date: Fri, 19 Dec 2025 22:07:03 +0000 (+0100) Subject: Fix changing repeat mode while playing X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=a8ee0add3b2c0985c9aa68813393c1a7e93cf9cc;p=music-assistant-server.git Fix changing repeat mode while playing --- diff --git a/music_assistant/controllers/player_queues.py b/music_assistant/controllers/player_queues.py index 7b7aa8ce..6bcbbe8e 100644 --- a/music_assistant/controllers/player_queues.py +++ b/music_assistant/controllers/player_queues.py @@ -364,6 +364,17 @@ class PlayerQueuesController(CoreController): return # no change queue.repeat_mode = repeat_mode self.signal_update(queue_id) + if ( + queue.state == PlaybackState.PLAYING + and queue.index_in_buffer is not None + and queue.index_in_buffer == queue.current_index + ): + # if the queue is playing, + # ensure to (re)queue the next track because it might have changed + # note that we only do this if the player has loaded the current track + # if not, we wait until it has loaded to prevent conflicts + if next_item := self.get_next_item(queue_id, queue.index_in_buffer): + self._enqueue_next_item(queue_id, next_item) @api_command("player_queues/play_media") async def play_media(