next_track/previous_track should be None if current_track is None
This commit is contained in:
parent
200d6a22ca
commit
ac13b20667
@ -251,6 +251,8 @@ class BasePlaybackController(object):
|
||||
@property
|
||||
def next_track(self):
|
||||
"""The next :class:`mopidy.models.Track` in the playlist."""
|
||||
if self.current_track is None:
|
||||
return None
|
||||
try:
|
||||
return self.backend.current_playlist.playlist.tracks[
|
||||
self.playlist_position + 1]
|
||||
@ -271,6 +273,8 @@ class BasePlaybackController(object):
|
||||
@property
|
||||
def previous_track(self):
|
||||
"""The previous :class:`mopidy.models.Track` in the playlist."""
|
||||
if self.current_track is None:
|
||||
return None
|
||||
try:
|
||||
return self.backend.current_playlist.playlist.tracks[
|
||||
self.playlist_position - 1]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user