Skip to content

Commit 89c2e85

Browse files
authored
fix/stop (#10)
don't attempt to stop spotify players unless they are active avoids error logs of the sort ``` 2024-07-17 16:57:23.683 - audio - ovos_audio.audio:shutdown:567 - INFO - shutting down OpenVoiceOS-TV 2024-07-17 16:57:25.053 - audio - ovos_audio.audio:shutdown:570 - ERROR - shutdown of OpenVoiceOS-TV failed: SpotifyException(404, -1, 'https://api.spotify.com/v1/me/player/pause?device_id=OpenVoiceOS-TV:\n Device not found') 2024-07-17 16:57:25.053 - audio - ovos_audio.audio:shutdown:567 - INFO - shutting down spotify-OpenVoiceOS-TV HTTP Error for PUT to https://api.spotify.com/v1/me/player/pause?device_id=OpenVoiceOS-TV with Params: {} returned 404 due to Device not found ```
1 parent bfeabf8 commit 89c2e85

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ovos_media_plugin_spotify/audio.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ def _wait_until_finished(self):
7070

7171
def stop(self):
7272
# there is no hard stop method
73-
self.spotify.pause(self.device_name)
74-
self.on_track_end()
73+
if not self._paused:
74+
self.spotify.pause(self.device_name)
75+
self.on_track_end()
7576

7677
def pause(self):
7778
if self.spotify.is_playing(self.device_name):

0 commit comments

Comments
 (0)