Update play code and next test
This commit is contained in:
parent
8b6a5184d8
commit
e57709b0b4
@ -43,10 +43,19 @@ class GStreamerPlaybackController(BasePlaybackController):
|
||||
self.bin = bin
|
||||
|
||||
def play(self, id=None, position=None):
|
||||
if not self.current_track:
|
||||
playlist = self.backend.current_playlist.playlist
|
||||
|
||||
if not self.current_track and not playlist.tracks:
|
||||
return False
|
||||
elif playlist.tracks:
|
||||
self.current_track = playlist.tracks[0]
|
||||
self.playlist_position = 0
|
||||
|
||||
self.bin.set_property("uri", self.current_track.uri)
|
||||
self.bin.set_state(self.PLAYING)
|
||||
self.state = self.PLAYING
|
||||
|
||||
return True
|
||||
|
||||
def next(self):
|
||||
pass
|
||||
|
||||
@ -62,6 +62,8 @@ class BasePlaybackControllerTest(object):
|
||||
def test_next(self):
|
||||
playback = self.backend.playback
|
||||
|
||||
playback.play()
|
||||
|
||||
old_position = playback.playlist_position
|
||||
old_uri = playback.current_track.uri
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user