implemented libspotify seek

This commit is contained in:
Johannes Knutsen 2010-08-14 01:21:16 +02:00
parent 4847896837
commit f312d79261
2 changed files with 6 additions and 2 deletions

View File

@ -122,7 +122,11 @@ class LibspotifyPlaybackController(BasePlaybackController):
return self._set_output_state('PLAYING')
def _seek(self, time_position):
pass # TODO
self._set_output_state('READY')
seek_to_ms = int(time_position) * 1000
result = self.backend.spotify.session.seek(seek_to_ms)
self._set_output_state('PLAYING')
return True
def _stop(self):
result = self._set_output_state('READY')

View File

@ -293,7 +293,7 @@ def seek(frontend, songpos, seconds):
Seeks to the position ``TIME`` (in seconds) of entry ``SONGPOS`` in
the playlist.
"""
raise MpdNotImplemented # TODO
return frontend.backend.playback._seek(seconds)
@handle_pattern(r'^seekid "(?P<cpid>\d+)" "(?P<seconds>\d+)"$')
def seekid(frontend, cpid, seconds):