Comparison by time is enough.
This commit is contained in:
parent
ccabc859e9
commit
790a507f0d
@ -21,10 +21,9 @@ function updateLastPlayedSong() {
|
|||||||
fetch('/lastsong')
|
fetch('/lastsong')
|
||||||
.then(r => r.json())
|
.then(r => r.json())
|
||||||
.then(last_played => {
|
.then(last_played => {
|
||||||
let cur_artist = $('last-played').firstChild.lastChild.children[1].innerText;
|
let cur_time = $('last-played').firstChild.lastChild.firstChild.innerText;
|
||||||
let cur_title = $('last-played').firstChild.lastChild.lastChild.innerText;
|
|
||||||
|
|
||||||
if (last_played.artist == cur_artist && last_played.title == cur_title)
|
if (last_played.time == cur_time)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$('last-played').firstChild.firstChild.remove();
|
$('last-played').firstChild.firstChild.remove();
|
||||||
|
Loading…
Reference in New Issue
Block a user