Don't requests known Spotify playlist (#66313)

pull/66334/head
Franck Nijhof 2022-02-11 17:53:25 +01:00 committed by GitHub
parent 768de8d515
commit 57624347e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -378,10 +378,13 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
current = self.data.client.current_playback()
self._currently_playing = current or {}
self._playlist = None
context = self._currently_playing.get("context")
if context is not None and context["type"] == MEDIA_TYPE_PLAYLIST:
self._playlist = self.data.client.playlist(current["context"]["uri"])
if context is not None and (
self._playlist is None or self._playlist["uri"] != context["uri"]
):
self._playlist = None
if context["type"] == MEDIA_TYPE_PLAYLIST:
self._playlist = self.data.client.playlist(current["context"]["uri"])
devices = self.data.client.devices() or {}
self._devices = devices.get("devices", [])