1
0

Updated index.pug.

This commit is contained in:
Alexander Andreev 2023-10-02 03:19:48 +04:00
parent bd9b80076a
commit 3e0a1fe181
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -1,4 +1,4 @@
:go:func Index(mainSite string, songsNum int, status *radio.IcecastStatus, songs *[]radio.Song, r *http.Request)
:go:func Index(mainSite string, songList *radio.SongList, listeners *radio.ListenerCounter, r *http.Request)
:go:import "dwelling-radio/internal/radio"
:go:import "dwelling-radio/pkg/utils"
@ -45,21 +45,21 @@ html(lang='en')
source(src='/live/stream.ogg' type='audio/ogg')
| Your browser doesn't support an audio element, it's sad... But you always can take the #[a(href='/playlist') playlist]!
div
p Now playing: #[span#radio-song #{status.SongName}]
p Current/peak listeners: #[span#radio-listeners #{status.Listeners}] / #[span#radio-listener-peak #{status.ListenerPeak}]
p Now playing: #[span#radio-song #{songList.Current().ArtistTitle()}]
p Current/peak listeners: #[span#radio-listeners #{listeners.Current()}] / #[span#radio-listener-peak #{listeners.Peak()}]
p
small Notice: information updates every 45 seconds. But you can #[button#radio-update update] it forcibly.
section
h2 Last #{songsNum} songs
h2 Last #{songList.Len()} songs
table#last-songs
each song in *songs
each song in songList.List()
tr
td= song.Time
if song.Listeners != "0"
td= song.Listeners
td= utils.ToClientTimezone(song.StartAt, r).Format("15:04")
if song.MaxListeners != 0
td= song.MaxListeners
else
td
td= song.Song
td= song.ArtistTitle()
- ml := radio.MostListened()
if ml.Song != ""
p.right Most listened song was "#{ml.Song}" on #{utils.ToClientTimezone(ml.Date, r).Format(radio.MostListenedDateFormat)} with #[b #{ml.Listeners}] listeners.