Find all playable tracks in a shuffled playlist.

Run two times through the tracklist to be sure to not miss a playable track.
This commit is contained in:
Jens Luetjen 2016-02-03 20:49:43 +01:00
parent e51b8c58be
commit 49849fa5b3

View File

@ -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?