1
0

Comparison by time is enough.

This commit is contained in:
Alexander Andreev 2022-03-31 17:55:36 +04:00
parent ccabc859e9
commit 790a507f0d
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -21,10 +21,9 @@ function updateLastPlayedSong() {
fetch('/lastsong')
.then(r => r.json())
.then(last_played => {
let cur_artist = $('last-played').firstChild.lastChild.children[1].innerText;
let cur_title = $('last-played').firstChild.lastChild.lastChild.innerText;
let cur_time = $('last-played').firstChild.lastChild.firstChild.innerText;
if (last_played.artist == cur_artist && last_played.title == cur_title)
if (last_played.time == cur_time)
return;
$('last-played').firstChild.firstChild.remove();