diff --git a/internal/handlers/web/assets/js/main.js b/internal/handlers/web/assets/js/main.js index e10f897..fdd4001 100644 --- a/internal/handlers/web/assets/js/main.js +++ b/internal/handlers/web/assets/js/main.js @@ -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();