From 7f1a49ec91ccbf2ca6344062b1cffc3fc1d0657f Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 8 Oct 2023 04:09:41 +0400 Subject: [PATCH] In main.js also update MLS. --- web/assets/js/main.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/assets/js/main.js b/web/assets/js/main.js index 4d80079..cbd5db4 100644 --- a/web/assets/js/main.js +++ b/web/assets/js/main.js @@ -21,6 +21,16 @@ async function updateStatus() { const s = await resp.json(); + if (undefined != s.most_listened_song) { + $("radio-mls-song").textContent = s.most_listened_song.song; + $("radio-mls-listeners").textContent = s.most_listened_song.listeners; + $("radio-mls-date").textContent = (new Intl.DateTimeFormat('en-GB', + {timeStyle: "long", + dateStyle: "long", + timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone})) + .format(new Date(s.most_listened_song.date)) + } + if (undefined == s.current_song) return [-1, null];