Skip to content

Commit

Permalink
Run linters
Browse files Browse the repository at this point in the history
Add exception type to playlist lookup error handling
  • Loading branch information
BTMorton committed Jan 5, 2024
1 parent 51087e5 commit 2761ad3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions homeassistant/components/spotify/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@

# This is a minimal representation of the DJ playlist that Spotify now offers
# The DJ is not fully integrated with the platlist API, so needs to have the playlist response mocked in order to maintain functionality
SPOTIFY_DJ_PLAYLIST = {
"uri": "spotify:playlist:37i9dQZF1EYkqdzj48dyYq",
"name": "DJ"
}
SPOTIFY_DJ_PLAYLIST = {"uri": "spotify:playlist:37i9dQZF1EYkqdzj48dyYq", "name": "DJ"}


async def async_setup_entry(
Expand Down Expand Up @@ -437,8 +434,11 @@ def update(self) -> None:
# Make sure any playlist lookups don't break the current playback state update
try:
self._playlist = self.data.client.playlist(uri)
except:
_LOGGER.debug(f"Unable to load spotify playlist '{uri}'. Continuing without playlist data.")
except SpotifyException:
_LOGGER.debug(
"Unable to load spotify playlist '%s'. Continuing without playlist data",
uri,
)
self._playlist = None

device = self._currently_playing.get("device")
Expand Down

0 comments on commit 2761ad3

Please sign in to comment.