Guard against missing coverArt sources

This commit is contained in:
Rafael Moraes
2026-03-27 10:54:46 -03:00
parent 0ede3ab245
commit acad5e8040
3 changed files with 12 additions and 6 deletions
+4 -2
View File
@@ -47,8 +47,10 @@ class SpotifyEpisodeInterface(SpotifyAudioInterface):
show_items,
)
media.cover_url = self.parse_cover_url(
episode_data["coverArt"]["sources"][0]["url"]
media.cover_url = (
self.parse_cover_url(episode_data["coverArt"]["sources"][0]["url"])
if episode_data["coverArt"]["sources"]
else None
)
if not self.skip_stream_info:
+4 -2
View File
@@ -94,8 +94,10 @@ class SpotifyMusicVideoInterface(SpotifyVideoInterface):
media.tags = await self.parse_tags(track_data, album_data)
media.cover_url = self.parse_cover_url(
album_data["coverArt"]["sources"][0]["url"]
media.cover_url = (
self.parse_cover_url(album_data["coverArt"]["sources"][0]["url"])
if album_data["coverArt"]["sources"]
else None
)
if not self.skip_stream_info:
+4 -2
View File
@@ -61,8 +61,10 @@ class SpotifySongInterface(SpotifyAudioInterface):
album_items,
media.lyrics.unsynced if media.lyrics else None,
)
media.cover_url = self.parse_cover_url(
media.album_metadata["coverArt"]["sources"][0]["url"]
media.cover_url = (
self.parse_cover_url(media.album_metadata["coverArt"]["sources"][0]["url"])
if media.album_metadata["coverArt"]["sources"]
else None
)
if not self.skip_stream_info: