Fix failing test_initial_playlist_position
This commit is contained in:
parent
7f0dff0891
commit
6ecadd6ca1
@ -119,7 +119,7 @@ class BasePlaybackController(object):
|
||||
|
||||
try:
|
||||
if self.current_track is None:
|
||||
return playlist.tracks[self.playlist_position]
|
||||
return playlist.tracks[0]
|
||||
return playlist.tracks[self.playlist_position + 1]
|
||||
except IndexError:
|
||||
return None
|
||||
@ -145,4 +145,4 @@ class BasePlaybackController(object):
|
||||
try:
|
||||
return playlist.tracks.index(self.current_track)
|
||||
except ValueError:
|
||||
return 0
|
||||
return None
|
||||
|
||||
@ -67,7 +67,7 @@ class GStreamerPlaybackController(BasePlaybackController):
|
||||
elif not self.current_track and not playlist.tracks:
|
||||
return False
|
||||
elif playlist.tracks:
|
||||
self.current_track = playlist.tracks[self.playlist_position]
|
||||
self.current_track = playlist.tracks[0]
|
||||
|
||||
self.bin.set_property("uri", self.current_track.uri)
|
||||
self.bin.set_state(gst.STATE_PLAYING)
|
||||
@ -80,7 +80,9 @@ class GStreamerPlaybackController(BasePlaybackController):
|
||||
def next(self):
|
||||
playlist = self.backend.current_playlist.playlist
|
||||
|
||||
if self.playlist_position + 1 >= len(playlist.tracks):
|
||||
if not self.current_track:
|
||||
self.play()
|
||||
elif self.playlist_position + 1 >= len(playlist.tracks):
|
||||
self.stop()
|
||||
else:
|
||||
next_track = playlist.tracks[self.playlist_position+1]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user