From b7f5ed4e5fcb3b51636a9dad79e7e80f7ebbb102 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 23 Dec 2022 08:51:37 +0100 Subject: implement local storage backend The 'local' backend is able to serve the music from a path specified by '-server-music-dir'. Add command line options to select the server port as well as a list of backends. --- web/client.html | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'web') diff --git a/web/client.html b/web/client.html index 20a53ed..87ca51a 100644 --- a/web/client.html +++ b/web/client.html @@ -122,10 +122,10 @@ votes.set(song.uri, "down") } - url = "/" + (isUpvoteBtn ? "up" : "down") + "?song=" + song.uri; + url = "/" + (isUpvoteBtn ? "up" : "down") + "?song=" + encodeURIComponent(song.uri); } else { votes.delete(song.uri); - url = "/unvote?song=" + song.uri; + url = "/unvote?song=" + encodeURIComponent(song.uri); } console.log("Get " + url); @@ -137,8 +137,10 @@ listItem.appendChild(upvoteBtn); listItem.appendChild(downvoteBtn); - const itemValue = document.createTextNode(song.weight + ' ' + formatSong(song)); - listItem.appendChild(itemValue); + listItem.appendChild(document.createTextNode(song.weight + ' ' + formatSong(song))); + const sourceLabel = document.createElement("SMALL"); + sourceLabel.innerHTML = " (" + song.source + ")"; + listItem.appendChild(sourceLabel); playlist.appendChild(listItem); } } @@ -257,10 +259,7 @@ }); listItem.classList.add("searchResult") - - let searchResultLabel = document.createTextNode(formatSong(song)); - listItem.appendChild(searchResultLabel); - + listItem.innerHTML = formatSong(song) + " (" + song.source + ")"; searchResults.appendChild(listItem); } -- cgit v1.2.3