package web import "dwelling-radio/internal/radio" import "strconv" import "dwelling-radio/pkg/utils" import "net/http" templ Index(curSong *radio.Song, sl []radio.Song, slLen int64, lstnrs *radio.ListenerCounter, r *http.Request) {
Now playing: { curSong.Artist } - { curSong.Title } { strconv.FormatInt(lstnrs.Overall(), 10) }/{ strconv.FormatInt(lstnrs.CurrentPeak(), 10) } { curSong.DurationString() }
} else {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.
Start | O/P | Song | |
{ utils.ToClientTimezone(sl[i].StartAt, r).Format("15:04") } | if sl[i].PeakListeners != 0 {{ strconv.FormatInt(sl[i].Listeners, 10) }/{ strconv.FormatInt(sl[i].PeakListeners, 10) } | } else {} | { sl[i].Artist } - { sl[i].Title } |