From 71f362b79ae0357a25a0f27a50cc2a17ce8d1763 Mon Sep 17 00:00:00 2001 From: Broque Thomas Date: Tue, 17 Feb 2026 08:55:32 -0800 Subject: [PATCH] Fix wishlist crash when artist context is a string instead of dict --- web_server.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web_server.py b/web_server.py index 2c8eb0bd..4eea3d03 100644 --- a/web_server.py +++ b/web_server.py @@ -13004,10 +13004,14 @@ def _run_full_missing_tracks_process(batch_id, playlist_id, tracks_json): # Construct minimal artist context artist_ctx = {} if s_artists and len(s_artists) > 0: - artist_ctx = s_artists[0] # Take first artist + first_artist = s_artists[0] + if isinstance(first_artist, dict): + artist_ctx = first_artist + else: + artist_ctx = {'name': str(first_artist)} else: # Fallback if no artist in spotify_data - artist_ctx = {'name': track_info.get('artist', 'Unknown Artist')} + artist_ctx = {'name': track_info.get('artist', 'Unknown Artist')} # Construct minimal album context # Ensure images are preserved (important for artwork) @@ -13755,6 +13759,9 @@ def _attempt_download_with_candidates(task_id, candidates, track, batch_id=None) # Use the real Spotify album/artist data from the UI explicit_album = track_info.get('_explicit_album_context', {}) explicit_artist = track_info.get('_explicit_artist_context', {}) + # Normalize artist context if it's a plain string (e.g. from wishlist spotify_data) + if isinstance(explicit_artist, str): + explicit_artist = {'name': explicit_artist} spotify_artist_context = { 'id': explicit_artist.get('id', 'explicit_artist'),