Fix next track test and implementation
This commit is contained in:
parent
a7571ef6f2
commit
a6e5e5d89d
@ -120,11 +120,12 @@ class BasePlaybackController(object):
|
||||
|
||||
@property
|
||||
def next_track(self):
|
||||
if self.current_track is None:
|
||||
return None
|
||||
playlist = self.backend.current_playlist.playlist
|
||||
|
||||
try:
|
||||
return self.backend.current_playlist.playlist.tracks[
|
||||
self.playlist_position + 1]
|
||||
if self.current_track is None:
|
||||
return playlist.tracks[self.playlist_position]
|
||||
return playlist.tracks[self.playlist_position + 1]
|
||||
except IndexError:
|
||||
return None
|
||||
|
||||
|
||||
@ -252,9 +252,8 @@ class BasePlaybackControllerTest(object):
|
||||
|
||||
@populate_playlist
|
||||
def test_next_track_before_play(self):
|
||||
# FIXME should next_track reflect which track is about to be played?
|
||||
tracks = self.backend.current_playlist.playlist.tracks
|
||||
self.assertEqual(self.playback.next_track, None)
|
||||
self.assertEqual(self.playback.next_track, tracks[0])
|
||||
|
||||
@populate_playlist
|
||||
def test_next_track_during_play(self):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user