1
0

Show overall and peak numbers of listeners for a currently playing song.

This commit is contained in:
Alexander Andreev 2024-05-11 05:03:20 +04:00
parent 872e8f4978
commit 904af3107a
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34

View File

@ -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 <a href="/playlist">playlist</a>!
</audio>
<div>
if curSong != nil {
<p>Now playing: <span id="radio-song">{ curSong.Artist } - { curSong.Title }</span> ( <span id="radio-duration-estimate"></span> <span id="radio-duration">{ curSong.DurationString() }</span> )</p>
if curSong != nil && curSong.Artist != "" {
<p>
Now playing: <span id="radio-song">{ curSong.Artist } - { curSong.Title }</span>
<abbr id="radio-song-listeners" title="Overall and peak numbers of listeners for a currently playing song">{ strconv.FormatInt(lstnrs.Overall(), 10) }/{ strconv.FormatInt(lstnrs.CurrentPeak(), 10) }</abbr>
<span id="radio-duration-estimate"></span> <span id="radio-duration">{ curSong.DurationString() }</span>
</p>
} else {
<p>Now playing: <span id="radio-song"></span> ( <span id="radio-duration-estimate"></span> <span id="radio-duration"></span> )</p>
<p>
Now playing: <span id="radio-song"></span>
<abbr id="radio-song-listeners" title="Overall and peak numbers of listeners for a currently playing song"></abbr>
<span id="radio-duration-estimate"></span> <span id="radio-duration"></span>
</p>
}
<p>Current/peak listeners: <span id="radio-listeners">{ strconv.FormatInt(lstnrs.Current(), 10) }</span> / <span id="radio-listener-peak">{ strconv.FormatInt(lstnrs.Peak(), 10) }</span></p>
<p class="small">Notice: information updates every new song. But you can <button id="radio-update">update</button> it forcibly.</p>