diff --git a/web/assets/js/main.js b/web/assets/js/main.js index 45e36b1..c8ac224 100644 --- a/web/assets/js/main.js +++ b/web/assets/js/main.js @@ -11,8 +11,9 @@ async function updateStatus() { if (!resp.ok || 200 != resp.status) { $("radio-song").textContent = - $("radio-duration-estimate").textContent = - $("radio-duration").textContent = ""; + $("radio-song-listeners").textContent = + $("radio-duration-estimate").textContent = + $("radio-duration").textContent = ""; $("radio-listeners").textContent = $("radio-listener-peak").textContent = "0"; $("last-songs").lastChild.remove(); @@ -36,6 +37,7 @@ async function updateStatus() { return [-1, null]; $("radio-song").textContent = `${s.current_song.artist} - ${s.current_song.title}`; + $("radio-song-listeners").textContent = `${s.listeners.overall} / ${s.listeners.current_peak}`; $("radio-duration").textContent = formatDuration(new Date(s.current_song.duration_msec)); $("radio-listeners").textContent = s.listeners.current; $("radio-listener-peak").textContent = s.listeners.peak; diff --git a/web/index.templ b/web/index.templ index 8f9d549..a9acd48 100644 --- a/web/index.templ +++ b/web/index.templ @@ -67,16 +67,16 @@ templ Index(curSong *radio.Song, sl []radio.Song, slLen int64, lstnrs *radio.Lis
Now playing: { curSong.Artist } - { curSong.Title }
- Now playing: { curSong.Artist } - { curSong.Title } - { strconv.FormatInt(lstnrs.Overall(), 10) }/{ strconv.FormatInt(lstnrs.CurrentPeak(), 10) } - { curSong.DurationString() } + O/P: { strconv.FormatInt(lstnrs.Overall(), 10) } / { strconv.FormatInt(lstnrs.CurrentPeak(), 10) } + Time: { curSong.DurationString() }
} else { +Now playing:
- Now playing: - - + O/P: + Time:
}Current/peak listeners: { strconv.FormatInt(lstnrs.Current(), 10) } / { strconv.FormatInt(lstnrs.Peak(), 10) }