diff --git a/mopidy/backends/spotify/playback.py b/mopidy/backends/spotify/playback.py index d7e622fb..cead01bf 100644 --- a/mopidy/backends/spotify/playback.py +++ b/mopidy/backends/spotify/playback.py @@ -27,6 +27,10 @@ class SpotifyPlaybackProvider(base.BasePlaybackProvider): 'width=(int)16, depth=(int)16, signed=(boolean)true, ' 'rate=(int)44100') + def __init__(self, *args, **kwargs): + super(SpotifyPlaybackProvider, self).__init__(*args, **kwargs) + self._first_seek = False + def play(self, track): if track.uri is None: return False @@ -35,6 +39,8 @@ class SpotifyPlaybackProvider(base.BasePlaybackProvider): seek_data_callback_bound = functools.partial( seek_data_callback, spotify_backend) + self._first_seek = True + try: self.backend.spotify.session.load( Link.from_string(track.uri).as_track()) @@ -59,5 +65,11 @@ class SpotifyPlaybackProvider(base.BasePlaybackProvider): def on_seek_data(self, time_position): logger.debug('playback.on_seek_data(%d) called', time_position) + + if time_position == 0 and self._first_seek: + self._first_seek = False + logger.debug('Skipping seek due to issue #300') + return + self.backend.spotify.buffer_timestamp = time_position * gst.MSECOND self.backend.spotify.session.seek(time_position)