From 904af3107af27f18f7b4ffcc8be5b001345f52a3 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sat, 11 May 2024 05:03:20 +0400 Subject: [PATCH] Show overall and peak numbers of listeners for a currently playing song. --- web/index.templ | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/web/index.templ b/web/index.templ index 8149dbc..d331f3b 100644 --- a/web/index.templ +++ b/web/index.templ @@ -66,10 +66,18 @@ templ Index(curSong *radio.Song, sl []radio.Song, slLen int64, lstnrs *radio.Lis Your browser doesn't support an audio element, it's sad... But you always can take the playlist!
- if curSong != nil { -

Now playing: { curSong.Artist } - { curSong.Title } ( { curSong.DurationString() } )

+ if curSong != nil && curSong.Artist != "" { +

+ Now playing: { curSong.Artist } - { curSong.Title } + { strconv.FormatInt(lstnrs.Overall(), 10) }/{ strconv.FormatInt(lstnrs.CurrentPeak(), 10) } + { curSong.DurationString() } +

} else { -

Now playing: ( )

+

+ Now playing: + + +

}

Current/peak listeners: { strconv.FormatInt(lstnrs.Current(), 10) } / { strconv.FormatInt(lstnrs.Peak(), 10) }

Notice: information updates every new song. But you can it forcibly.