implemented libspotify seek
This commit is contained in:
parent
4847896837
commit
f312d79261
@ -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')
|
||||
|
||||
@ -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):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user