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