From 49849fa5b39664f4b66583b08c3e6f75dcb5099d Mon Sep 17 00:00:00 2001 From: Jens Luetjen Date: Wed, 3 Feb 2016 20:49:43 +0100 Subject: [PATCH] Find all playable tracks in a shuffled playlist. Run two times through the tracklist to be sure to not miss a playable track. --- mopidy/core/playback.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mopidy/core/playback.py b/mopidy/core/playback.py index 240c4454..2ae8dbb3 100644 --- a/mopidy/core/playback.py +++ b/mopidy/core/playback.py @@ -361,8 +361,8 @@ class PlaybackController(object): current = self._pending_tl_track or self._current_tl_track pending = tl_track or current or self.core.tracklist.next_track(None) # avoid endless loop if 'repeat' is 'true' and no track is playable - # TODO: could miss a playable track in a shuffled playlist - count = self.core.tracklist.get_length() + # * 2 -> second run to get all playable track in a shuffled playlist + count = self.core.tracklist.get_length() * 2 while pending: # TODO: should we consume unplayable tracks in this loop?