From 1fb9b45d59f7d89282ad9fb8da23637aaa9fde21 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Tue, 31 Mar 2026 08:41:01 -0700 Subject: [PATCH] Fix wishlist download status tooltip showing wrong track name (#227) The tooltip on failed/not_found tracks was offset by 3-6 items because the backend cleanup step removed owned tracks from the wishlist between when the frontend rendered the table and when the backend assigned track indices. Surviving tracks got new enumeration indices (0,1,2...) that didn't match their original table row positions (0,1,3,4...). Fix: stamp each track with its position in the frontend's track_ids array as _original_index, so the track_index always matches the modal table row regardless of how many tracks were cleaned during processing. --- web_server.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/web_server.py b/web_server.py index ff98786c..ff32ce91 100644 --- a/web_server.py +++ b/web_server.py @@ -21614,12 +21614,15 @@ def start_wishlist_missing_downloads(): track_lookup[spotify_track_id] = track # Iterate in track_ids order (matches frontend display order) - # so that enumerate()-based track_index aligns with data-track-index in the modal + # Stamp each track with its original position in the track_ids array + # so track_index matches the modal row even if cleanup removed some tracks filtered_tracks = [] seen_track_ids = set() - for tid in track_ids: + for frontend_index, tid in enumerate(track_ids): if tid in track_lookup and tid not in seen_track_ids: - filtered_tracks.append(track_lookup[tid]) + track = track_lookup[tid] + track['_original_index'] = frontend_index # Preserve frontend table position + filtered_tracks.append(track) seen_track_ids.add(tid) wishlist_tracks = filtered_tracks