From 6d2398cd226c55ec7606f9615046cb55f9774638 Mon Sep 17 00:00:00 2001 From: Physcik Date: Fri, 19 Dec 2025 20:26:49 +0500 Subject: Hotfixes --- Settings.json | 2 +- static/index.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Settings.json b/Settings.json index a0353fa..10f12b4 100644 --- a/Settings.json +++ b/Settings.json @@ -1,5 +1,5 @@ { - "SongsLocation": "/home/physick/git/culture_exam/Tracks", + "SongsLocation": "./Tracks", "Distribution": { "RandomisationChance": 0.5, "MaxPointPercent": 0.75, diff --git a/static/index.js b/static/index.js index 991eb6c..0c983a0 100644 --- a/static/index.js +++ b/static/index.js @@ -1,17 +1,19 @@ +const ApiLocation = "/api" let isInfoShown = true; function GetSongs() { - fetch("/api/getSongs").then(r => r.json().then(body => { + fetch(`${ApiLocation}/getSongs`).then(r => r.json().then(body => { console.log(body); })); } function SetRandomSong() { - fetch("/api/randomSong").then(r => r.json().then(body => { + fetch(`${ApiLocation}/randomSong`).then(r => r.json().then(body => { const player = document.getElementById("mainAudio"); console.log(player); console.log(body); - player.src = "/api/getSong?name=" + encodeURI(body.Name); + document.getElementById("Status").innerHTML = "Loading"; + player.src = `${ApiLocation}/getSong?name=${encodeURI(body.Name)}`; document.getElementById("Artist").innerHTML = "Artist: " + body.Meta.Author; document.getElementById("Title").innerHTML = "Title: " + body.Meta.Name; -- cgit v1.3