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() {
fetch('/lastsong')
fetch("/lastsong")
.then(r => r.json())
.then(last_played => {
if ($('last-played').firstChild === null)
$('last-played').appendChild(document.createElement("tbody"))
else if (last_played.time == $('last-played').firstChild.lastChild.firstChild.innerText)
if ($("last-played").firstChild === null)
$("last-played").appendChild(document.createElement("tbody"))
else if (last_played.time == $("last-played").firstChild.lastChild.firstChild.innerText)
return;
if ($('last-played').firstChild.children.length == 10)
$('last-played').firstChild.firstChild.remove();
if ($("last-played").firstChild.children.length == 10)
$("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.listeners == 0 ? "" : last_played.listeners));
row.insertCell().appendChild(document.createTextNode(last_played.song));