Skip to content

Commit

Permalink
Fix cast/dlna player stops playing after 1 or 2 tracks of a playlist (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Sep 14, 2024
1 parent cef2bbc commit 90dd9c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion music_assistant/server/controllers/player_queues.py
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,12 @@ def track_loaded_in_buffer(self, queue_id: str, item_id: str) -> None:
self.signal_update(queue_id)
# enqueue the next track as soon as the player reports
# it has started buffering the given queue item
self.mass.create_task(self._enqueue_next(queue, item_id))
task_id = f"enqueue_next_{queue_id}"
self.mass.call_later(0.2, self._enqueue_next, queue, item_id, task_id=task_id)
# we repeat this task once more after 2 seconds to ensure the player
# received the command as it may be missed at the first attempt
# due to a race condition
self.mass.call_later(2, self._enqueue_next, queue, item_id, task_id=task_id)

# Main queue manipulation methods

Expand Down

0 comments on commit 90dd9c6

Please sign in to comment.