mirror of
https://github.com/glomatico/votify.git
synced 2026-10-01 21:42:09 +02:00
Guard against missing coverArt sources
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user