From ab01f8f329af4a3be0cd77378acf9bd5be8f2b4f Mon Sep 17 00:00:00 2001 From: "Ricardo (XenGi) Band" Date: Mon, 15 Jul 2024 20:00:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- flake.nix | 1 - go.mod | 2 +- static/index.html | 3 ++- static/index.js | 9 ++++++--- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 05fcdfc..0b51d8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/golang:1.20 as builder +FROM docker.io/golang:1.22 as builder WORKDIR /app diff --git a/flake.nix b/flake.nix index 1338416..bb94005 100644 --- a/flake.nix +++ b/flake.nix @@ -39,4 +39,3 @@ } ); } - diff --git a/go.mod b/go.mod index 52f168e..5a4ffed 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module gitlab.com/XenGi/sanic -go 1.21 +go 1.22 require ( github.com/fhs/gompd/v2 v2.3.0 diff --git a/static/index.html b/static/index.html index 15584db..31b34ce 100644 --- a/static/index.html +++ b/static/index.html @@ -200,7 +200,8 @@
- + + diff --git a/static/index.js b/static/index.js index dcc6a1e..c2c7c37 100644 --- a/static/index.js +++ b/static/index.js @@ -33,6 +33,7 @@ const tab_browser = document.getElementById("tab-browser"); const tab_search = document.getElementById("tab-search"); const tab_playlists = document.getElementById("tab-playlists"); const control_playlist_list = document.getElementById("control-playlist-list"); +const control_refresh_playlists = document.getElementById("control-refresh-playlists"); const control_replace_playlist = document.getElementById("control-replace-playlist"); const control_attach_playlist = document.getElementById("control-attach-playlist"); const control_save_playlist = document.getElementById("control-save-playlist"); @@ -83,9 +84,7 @@ refreshPlaylists = () => { option.value = p["playlist"]; option.addEventListener("click", () => { fetch(`${API_URL}/playlists/${p["playlist"]}`).then(async r => { - if (r.status === 200) { - fillResultTable(await r.json()); - } + if (r.status === 200) fillResultTable(await r.json()); }) }); control_playlist_list.appendChild(option) @@ -172,6 +171,10 @@ control_search_submit.addEventListener("click", event => { }) }); +control_refresh_playlists.addEventListener("click", () => { + refreshPlaylists(); +}); + control_replace_playlist.addEventListener("click", () => { fetch(`${API_URL}/queue/replace/${control_playlist_list.value}`).then(async r => { if (r.status !== 200) {