aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-10-15 06:10:04 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-10-15 06:10:04 +0300
commit2a39b27b2f08ccaba418e303cbb3e6cac980875e (patch)
tree75621efaee61013bc48acca945e28e47a8da04a2 /client
parent305ba5ecee65d9d608134a2c4a754acc748f68b2 (diff)
downloadarching-kaos-radio-2a39b27b2f08ccaba418e303cbb3e6cac980875e.tar.gz
arching-kaos-radio-2a39b27b2f08ccaba418e303cbb3e6cac980875e.tar.bz2
arching-kaos-radio-2a39b27b2f08ccaba418e303cbb3e6cac980875e.zip
Don't duplicate shows in every iteration
Diffstat (limited to 'client')
-rw-r--r--client/js/radio_emulator.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/client/js/radio_emulator.js b/client/js/radio_emulator.js
index 2388196..592426b 100644
--- a/client/js/radio_emulator.js
+++ b/client/js/radio_emulator.js
@@ -267,9 +267,13 @@ function syncOnDOMfromListCallback(now, hash_of_list, json)
}
function appendPreviouslyPlayedShows(listItem){
- var tmp = document.createElement('pre');
- tmp.innerText = JSON.stringify(listItem, null, 2);
- placeholders.previouslyPlayed.append(tmp);
+ if ( document.querySelector(`#s-${listItem.hash}`) === null )
+ {
+ var tmp = document.createElement('pre');
+ tmp.id = `s-${listItem.hash}`;
+ tmp.innerText = JSON.stringify(listItem, null, 2);
+ placeholders.previouslyPlayed.append(tmp);
+ }
}
function listCallback(json, params)