From 2944234ac51019af5af4c839738b5d808ca24393 Mon Sep 17 00:00:00 2001 From: Stefan Kratochwil Date: Wed, 14 Jan 2026 00:34:09 +0100 Subject: [PATCH] wip: playlist_filebrowser now has a persistent state, which is respected during refresh intents --- software/frontend/index.html | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/software/frontend/index.html b/software/frontend/index.html index 84b4d55..a36fa06 100644 --- a/software/frontend/index.html +++ b/software/frontend/index.html @@ -788,6 +788,8 @@ PLAYLIST EDITOR LOGIC - ADD FILES SCREEN ------------------------------------------- */ Screens.playlist_filebrowser = (() => { + let isFilesystemMode = false; + function init() { document.getElementById('playlist-filebrowser-cancel').addEventListener("click", (e) => { showScreen("playlist_edit", {}); @@ -808,13 +810,21 @@ } async function onShow(intent) { + console.log(intent) document.getElementById('playlist-filebrowser-addtrack').disabled = true; const title = document.getElementById('playlist-filebrowser-title'); const cancelButton = document.getElementById('playlist-filebrowser-cancel'); const addTracksButton = document.getElementById('playlist-filebrowser-addtrack'); - if (intent === 'filesystem') { + if (intent !== 'refresh') { + isFilesystemMode = (intent === 'filesystem'); + + document.getElementById('playlist-filebrowser-upload-progress').value = 0; + document.getElementById("playlist-filebrowser-upload-files").value = ""; + } + + if (isFilesystemMode) { title.innerText = "Filesystem"; cancelButton.style.display = 'none'; addTracksButton.style.display = 'none'; @@ -824,10 +834,6 @@ addTracksButton.style.display = '' } - if (intent !== 'refresh') { - document.getElementById('playlist-filebrowser-upload-progress').value = 0; - document.getElementById("playlist-filebrowser-upload-files").value = ""; - } tree = document.getElementById("playlist-filebrowser-tree"); tree.innerHTML = "Loading..."; fetch('/api/v1/audiofiles')