From 0963ad4a7014260c8945da000c75ddf1077dfa3e Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 6 Apr 2026 15:39:21 +0000 Subject: [PATCH] =?UTF-8?q?fix(02-03):=20fix=20upload=20file=20selection?= =?UTF-8?q?=20=E2=80=94=20pass=20abs=20path=20to=20refreshFileList?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Options use /app/shows/filename as value - Upload response returns /app/shows/filename as path - Pass path directly to refreshFileList so pre-selection matches --- lightsync/frontend/app.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lightsync/frontend/app.js b/lightsync/frontend/app.js index 49579f4..d51030d 100644 --- a/lightsync/frontend/app.js +++ b/lightsync/frontend/app.js @@ -272,19 +272,8 @@ document.getElementById('audio-upload')?.addEventListener('change', async (e) => if (beats && beats.beats) { beatTimestamps = beats.beats; } - await refreshFileList(`/shows/${path.split('/').pop()}`); - // Auto-select and load the just-uploaded file - const sel = document.getElementById('audio-select'); - const serverPath = `/shows/${path.split('/').pop()}`; - if (sel) { - // find matching option and select it - for (const opt of sel.options) { - if (opt.value === serverPath || opt.value === path) { - opt.selected = true; - break; - } - } - } + // Options use /app/shows/filename as value — pass abs path to pre-select + await refreshFileList(path); loadSelectedFile(path); } catch (err) { console.error('[audio] upload error:', err);