From b79162f9e0f30af56858ea7eb46e60d6a128e162 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Tue, 21 Apr 2026 21:54:09 -0700 Subject: [PATCH] Render cover art on downloads page for fixed/wishlist tracks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Download-status meta enrichment only checked spotify_album.images[0].url for the card artwork. That's the Spotify-API shape, but the context builder for wishlist and manually-fixed tracks populates spotify_album with image_url (singular string) and no images array. Result: those tracks downloaded and post-processed fine (different path) but the downloads page showed a placeholder note icon. Enrichment now falls through three spots before giving up: 1. spotify_album.images[0].url (Spotify-originated) 2. spotify_album.image_url (wishlist / fixed discovery) 3. track_info.image_url (some discovery flows) Pure read-side fix — no changes to the context builder, so existing behaviour for Spotify-primary users is unchanged. --- web_server.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/web_server.py b/web_server.py index 7b3b6792..ec7505e0 100644 --- a/web_server.py +++ b/web_server.py @@ -10512,11 +10512,23 @@ def get_download_status(): _sp_artist = ctx.get('spotify_artist') or {} _sp_album = ctx.get('spotify_album') or {} _sp_track = ctx.get('track_info') or {} + # Cover art can live in a few places depending on the + # origin path: album.images[0].url (Spotify-shaped), + # album.image_url (context-built / wishlist / fixes), or + # track_info.image_url (some discovery flows). Try them + # all so fixed-discovery tracks render their artwork. _sp_images = _sp_album.get('images') or [] + _art_url = '' + if _sp_images and isinstance(_sp_images[0], dict): + _art_url = _sp_images[0].get('url', '') or '' + if not _art_url: + _art_url = _sp_album.get('image_url') or '' + if not _art_url: + _art_url = _sp_track.get('image_url') or '' transfer['_meta'] = { 'artist': _sp_artist.get('name', ''), 'album': _sp_album.get('name', ''), - 'artwork_url': _sp_images[0].get('url', '') if _sp_images and isinstance(_sp_images[0], dict) else '', + 'artwork_url': _art_url, 'track_number': _sp_track.get('track_number'), 'quality': ctx.get('_audio_quality', ''), }