diff --git a/software/frontend/index.html b/software/frontend/index.html index 43de408..a36fa06 100644 --- a/software/frontend/index.html +++ b/software/frontend/index.html @@ -147,6 +147,7 @@ + @@ -243,7 +244,7 @@
-

Playlist Editor

+

Playlist Editor

@@ -787,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", {}); @@ -805,13 +808,32 @@ }); tree.init(); } - + 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 !== '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'; + } else { + title.innerText = "Playlist Editor"; + cancelButton.style.display = '' + addTracksButton.style.display = '' + } + tree = document.getElementById("playlist-filebrowser-tree"); tree.innerHTML = "Loading..."; fetch('/api/v1/audiofiles')