1
0

In updateLastPlayedSong ' symbol replaced by ".

This commit is contained in:
Alexander Andreev 2023-08-22 03:41:09 +04:00
parent 696bcb9e89
commit 3120855858
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -15,18 +15,18 @@ function updateRadioStatus() {
} }
function updateLastPlayedSong() { function updateLastPlayedSong() {
fetch('/lastsong') fetch("/lastsong")
.then(r => r.json()) .then(r => r.json())
.then(last_played => { .then(last_played => {
if ($('last-played').firstChild === null) if ($("last-played").firstChild === null)
$('last-played').appendChild(document.createElement("tbody")) $("last-played").appendChild(document.createElement("tbody"))
else if (last_played.time == $('last-played').firstChild.lastChild.firstChild.innerText) else if (last_played.time == $("last-played").firstChild.lastChild.firstChild.innerText)
return; return;
if ($('last-played').firstChild.children.length == 10) if ($("last-played").firstChild.children.length == 10)
$('last-played').firstChild.firstChild.remove(); $("last-played").firstChild.firstChild.remove();
let row = $('last-played').insertRow(); let row = $("last-played").insertRow();
row.insertCell().appendChild(document.createTextNode(last_played.time)); row.insertCell().appendChild(document.createTextNode(last_played.time));
row.insertCell().appendChild(document.createTextNode(last_played.listeners == 0 ? "" : last_played.listeners)); row.insertCell().appendChild(document.createTextNode(last_played.listeners == 0 ? "" : last_played.listeners));
row.insertCell().appendChild(document.createTextNode(last_played.song)); row.insertCell().appendChild(document.createTextNode(last_played.song));