From 9c15d0012838a76e9eb32eb7ea7f33c08506565c Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Mon, 20 Apr 2026 22:18:20 -0700 Subject: [PATCH] Enrich downloads page cards with artwork, artist, album, and source badges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The downloads page previously showed only title and source per download. Now shows album artwork thumbnail, artist name, album name, source badge, and quality badge (after post-processing). All metadata comes from the existing matched_downloads_context — no extra API calls needed. Falls back gracefully to title-only display when context metadata is not available (e.g. orphaned Soulseek transfers with no task mapping). --- web_server.py | 18 +++++++++++ webui/static/script.js | 24 +++++++++++++-- webui/static/style.css | 68 +++++++++++++++++++++++++++++++++++++++++- 3 files changed, 107 insertions(+), 3 deletions(-) diff --git a/web_server.py b/web_server.py index 12665afb..a5791e3d 100644 --- a/web_server.py +++ b/web_server.py @@ -10119,6 +10119,24 @@ def get_download_status(): print(f"Could not fetch YouTube/Tidal downloads for status: {streaming_error}") traceback.print_exc() + # Enrich transfers with metadata from download context (artist, album, artwork) + with matched_context_lock: + for transfer in all_transfers: + ctx_key = _make_context_key(transfer.get('username', ''), transfer.get('filename', '')) + ctx = matched_downloads_context.get(ctx_key) + if ctx: + _sp_artist = ctx.get('spotify_artist') or {} + _sp_album = ctx.get('spotify_album') or {} + _sp_track = ctx.get('track_info') or {} + _sp_images = _sp_album.get('images') 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 '', + 'track_number': _sp_track.get('track_number'), + 'quality': ctx.get('_audio_quality', ''), + } + return jsonify({"transfers": all_transfers}) except Exception as e: diff --git a/webui/static/script.js b/webui/static/script.js index 96b406f1..afd8232c 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -17261,11 +17261,31 @@ function renderQueue(containerId, downloads, isActiveQueue) { `; } + // Enrich with metadata from backend context (artist, album, artwork) + const meta = item._meta || {}; + const sourceLabels = { youtube: 'YouTube', tidal: 'Tidal', qobuz: 'Qobuz', hifi: 'HiFi', deezer_dl: 'Deezer', lidarr: 'Lidarr' }; + const sourceBadge = sourceLabels[item.username] || item.username; + html += `