Fix BasePlaybackController with respect to test_play_sets_current_track

This commit is contained in:
Thomas Adamcik 2010-04-06 17:13:29 +02:00
parent 50085d5db5
commit 9b6bbb1ad3

View File

@ -463,11 +463,16 @@ class BasePlaybackController(object):
:param track: track to play
:type track: :class:`mopidy.models.Track` or :class:`None`
"""
next_track = self.next_track
if self.state == self.PAUSED and track is None:
self.resume()
elif track is not None and self._play(track):
self.current_track = track
self.state = self.PLAYING
elif next_track is not None and self._play(next_track):
self.current_track = next_track
self.state = self.PLAYING
def _play(self, track):
raise NotImplementedError