Fixed updateLastPlayedSong() wrong current song checking.

This commit is contained in:
Alexander Andreev 2021-09-02 01:13:02 +04:00
parent fe823ae56f
commit 080954fe5f
Signed by: Arav
GPG Key ID: 610DF2574456329F

View File

@ -23,9 +23,10 @@ function updateLastPlayedSong() {
fetch('/lastsong')
.then(r => r.json())
.then(last_played => {
let { cur_artist, cur_song } = $('radio-song').innerText.split(' - ');
let cur_artist = $('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_song)
if (last_played.artist == cur_artist && last_played.title == cur_title)
return;
$('last-played').firstChild.firstChild.remove();