diff --git a/mopidy_spotify/playback.py b/mopidy_spotify/playback.py index b95ea1ab..64190834 100644 --- a/mopidy_spotify/playback.py +++ b/mopidy_spotify/playback.py @@ -98,6 +98,11 @@ def stop(self): self.backend._session.player.pause() return super(SpotifyPlaybackProvider, self).stop() + def pause(self): + logger.debug('Audio requested pause; pausing Spotify player') + self.backend._session.player.pause() + return super(SpotifyPlaybackProvider, self).pause() + def on_seek_data(self, time_position): logger.debug('Audio requested seek to %d', time_position) diff --git a/tests/test_playback.py b/tests/test_playback.py index 7f21cba6..d826c60e 100644 --- a/tests/test_playback.py +++ b/tests/test_playback.py @@ -132,6 +132,12 @@ def test_stop_pauses_spotify_playback(session_mock, provider): session_mock.player.pause.assert_called_once_with() +def test_pause_pauses_spotify_playback(session_mock, provider): + provider.pause() + + session_mock.player.pause.assert_called_once_with() + + def test_on_seek_data_updates_timestamp_and_seeks_in_spotify( session_mock, provider): provider.on_seek_data(1780)