From 7c7ddc06e0879ac51cc6b97f47369da5451c37dd Mon Sep 17 00:00:00 2001 From: Broque Thomas Date: Sun, 31 Aug 2025 15:08:43 -0700 Subject: [PATCH] Update script.js --- webui/static/script.js | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/webui/static/script.js b/webui/static/script.js index b825e7c2..5b772d90 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -6405,28 +6405,10 @@ function updateYouTubeDiscoveryModal(urlHash, status) { progressBar.style.width = `${status.progress}%`; progressText.textContent = `${status.spotify_matches} / ${status.spotify_total} tracks matched (${status.progress}%)`; - // Update table rows - create missing rows if needed + // Update table rows status.results.forEach(result => { - let row = document.getElementById(`youtube-discovery-row-${result.index}`); - - // Create missing row if it doesn't exist - if (!row) { - const rowHtml = ` - - ${result.yt_track} - ${result.yt_artist} - 🔍 Pending... - - - - - - - ${result.duration || '0:00'} - - `; - tableBody.insertAdjacentHTML('beforeend', rowHtml); - row = document.getElementById(`youtube-discovery-row-${result.index}`); - } - - if (!row) return; // Safety check + const row = document.getElementById(`youtube-discovery-row-${result.index}`); + if (!row) return; const statusCell = row.querySelector('.discovery-status'); const spotifyTrackCell = row.querySelector('.spotify-track');