Show overall and peak numbers of listeners for a currently playing song.
This commit is contained in:
parent
872e8f4978
commit
904af3107a
@ -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>!
|
Your browser doesn't support an audio element, it's sad... But you always can take the <a href="/playlist">playlist</a>!
|
||||||
</audio>
|
</audio>
|
||||||
<div>
|
<div>
|
||||||
if curSong != nil {
|
if curSong != nil && curSong.Artist != "" {
|
||||||
<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>
|
<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 {
|
} 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>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>
|
<p class="small">Notice: information updates every new song. But you can <button id="radio-update">update</button> it forcibly.</p>
|
||||||
|
Loading…
Reference in New Issue
Block a user