Skip to content
Snippets Groups Projects
Commit e55040e8 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

SpotifyRecorder: handle no current playback

parent c2883a4d
Branches
Tags
No related merge requests found
...@@ -197,7 +197,11 @@ class SpotifyRecorder: ...@@ -197,7 +197,11 @@ class SpotifyRecorder:
self._spotify.start_playback(device_id=deviceId, uris=[trackUri]) self._spotify.start_playback(device_id=deviceId, uris=[trackUri])
def __stop_playback_if_playing(self, deviceId: str) -> None: def __stop_playback_if_playing(self, deviceId: str) -> None:
if self._spotify.current_playback()['is_playing']: currentPlayback = self._spotify.current_playback()
if currentPlayback is None:
return
if currentPlayback['is_playing']:
self._spotify.pause_playback(device_id=deviceId) self._spotify.pause_playback(device_id=deviceId)
def __wait_for_track_playing(self, expectedTrackId: str) -> float: def __wait_for_track_playing(self, expectedTrackId: str) -> float:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment