Fix Spotify scopes evaluation (#42819)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>pull/40619/head^2
parent
8b998365a4
commit
e929ae10cd
|
@ -218,7 +218,9 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
|
|||
self._name = f"Spotify {name}"
|
||||
self._session = session
|
||||
self._spotify = spotify
|
||||
self._scope_ok = set(session.token["scope"].split(" ")) == set(SPOTIFY_SCOPES)
|
||||
self._scope_ok = set(session.token["scope"].split(" ")).issuperset(
|
||||
SPOTIFY_SCOPES
|
||||
)
|
||||
|
||||
self._currently_playing: Optional[dict] = {}
|
||||
self._devices: Optional[List[dict]] = []
|
||||
|
@ -474,6 +476,9 @@ class SpotifyMediaPlayer(MediaPlayerEntity):
|
|||
"""Implement the websocket media browsing helper."""
|
||||
|
||||
if not self._scope_ok:
|
||||
_LOGGER.debug(
|
||||
"Spotify scopes are not set correctly, this can impact features such as media browsing"
|
||||
)
|
||||
raise NotImplementedError
|
||||
|
||||
if media_content_type in [None, "library"]:
|
||||
|
|
Loading…
Reference in New Issue