From acad5e804049edec949f30abdcec1eeb89a0a67c Mon Sep 17 00:00:00 2001 From: Rafael Moraes <50295204+glomatico@users.noreply.github.com> Date: Fri, 27 Mar 2026 10:54:46 -0300 Subject: [PATCH] Guard against missing coverArt sources --- votify/interface/episode.py | 6 ++++-- votify/interface/music_video.py | 6 ++++-- votify/interface/song.py | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/votify/interface/episode.py b/votify/interface/episode.py index 4311960..34e04df 100644 --- a/votify/interface/episode.py +++ b/votify/interface/episode.py @@ -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: diff --git a/votify/interface/music_video.py b/votify/interface/music_video.py index 3fa7b54..53d0869 100644 --- a/votify/interface/music_video.py +++ b/votify/interface/music_video.py @@ -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: diff --git a/votify/interface/song.py b/votify/interface/song.py index ba82ac3..0170bcc 100644 --- a/votify/interface/song.py +++ b/votify/interface/song.py @@ -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: