diff --git a/modules/web/index.html b/modules/web/index.html index 7325017..d34e820 100644 --- a/modules/web/index.html +++ b/modules/web/index.html @@ -254,7 +254,6 @@
-
diff --git a/modules/web/web.js b/modules/web/web.js index 6c4d24c..8147bcb 100644 --- a/modules/web/web.js +++ b/modules/web/web.js @@ -354,13 +354,13 @@ function selectPlaylistItem(i, el) { updateControls(); } -function addSelectedFileToQueue(top, jingle) { +function addSelectedFileToQueue(top) { let fullPath = null; if (selectedPlaylistPath != null) { const selected = playlist.find(t => t.path === selectedPlaylistPath); if (!selected) return false; - const path = ((selected.official || !jingle) ? "" : "!") + selected.path; + const path = (selected.official ? "" : "!") + selected.path; wsSend({ action: "add_to_toplay", songs: [path], top }); clearListSelections("playlist-ul"); selectedPlaylistPath = null; @@ -379,7 +379,7 @@ function addSelectedFileToQueue(top, jingle) { } if (fullPath) { - wsSend({ action: "add_to_toplay", songs: [(jingle ? "!" : "") + fullPath], top }); + wsSend({ action: "add_to_toplay", songs: [fullPath], top }); // Dir/subdir selections are intentionally preserved here return true; } @@ -430,13 +430,12 @@ document.getElementById("clear-btn").addEventListener("click", e => { wsSend({ action: "clear_toplay" }); }); -document.getElementById("add-to-queue-btn").addEventListener("click", () => addSelectedFileToQueue(false, false)); -document.getElementById("add-to-queue2-btn").addEventListener("click", () => addSelectedFileToQueue(true, false)); -document.getElementById("add-as-jingle-btn").addEventListener("click", () => addSelectedFileToQueue(false, true)); +document.getElementById("add-to-queue-btn").addEventListener("click", () => addSelectedFileToQueue(false)); +document.getElementById("add-to-queue2-btn").addEventListener("click", () => addSelectedFileToQueue(true)); document.addEventListener("keydown", e => { if (e.target.tagName === "INPUT") return; - if (e.key === "Enter" && addSelectedFileToQueue(e.shiftKey, false)) e.preventDefault(); + if (e.key === "Enter" && addSelectedFileToQueue(e.shiftKey)) e.preventDefault(); else if (e.key === "s") wsSend({ action: "skip" }); else if (e.key === "n") wsSend({ action: "skipc", add: 1 }); else if (e.key === "m") wsSend({ action: "skipc", remove: -1 });