From 080954fe5fe56bc641719ad2cb048136cf76f3c0 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Thu, 2 Sep 2021 01:13:02 +0400 Subject: [PATCH] Fixed updateLastPlayedSong() wrong current song checking. --- radio/static/assets/js/main.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/radio/static/assets/js/main.js b/radio/static/assets/js/main.js index 340a6bd..e8d8466 100644 --- a/radio/static/assets/js/main.js +++ b/radio/static/assets/js/main.js @@ -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();