Make play handle tracks
This commit is contained in:
parent
144fa82967
commit
7f0dff0891
@ -59,10 +59,12 @@ class GStreamerPlaybackController(BasePlaybackController):
|
|||||||
|
|
||||||
return self.STOPPED
|
return self.STOPPED
|
||||||
|
|
||||||
def play(self, id=None, position=None):
|
def play(self, track=None, position=None):
|
||||||
playlist = self.backend.current_playlist.playlist
|
playlist = self.backend.current_playlist.playlist
|
||||||
|
|
||||||
if not self.current_track and not playlist.tracks:
|
if track:
|
||||||
|
self.current_track = track
|
||||||
|
elif not self.current_track and not playlist.tracks:
|
||||||
return False
|
return False
|
||||||
elif playlist.tracks:
|
elif playlist.tracks:
|
||||||
self.current_track = playlist.tracks[self.playlist_position]
|
self.current_track = playlist.tracks[self.playlist_position]
|
||||||
@ -81,5 +83,5 @@ class GStreamerPlaybackController(BasePlaybackController):
|
|||||||
if self.playlist_position + 1 >= len(playlist.tracks):
|
if self.playlist_position + 1 >= len(playlist.tracks):
|
||||||
self.stop()
|
self.stop()
|
||||||
else:
|
else:
|
||||||
self.current_track = playlist.tracks[self.playlist_position+1]
|
next_track = playlist.tracks[self.playlist_position+1]
|
||||||
self.play()
|
self.play(next_track)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user