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(