From c33ff03bd8ac072b03739adfac92080540fce481 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Thu, 5 Oct 2023 18:53:57 +0400 Subject: [PATCH] Updated using of SongList.Current() in an index.pug file. --- web/templates/index.pug | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/templates/index.pug b/web/templates/index.pug index e7d54de..9ed6342 100644 --- a/web/templates/index.pug +++ b/web/templates/index.pug @@ -45,8 +45,9 @@ 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 - if (songList.Current() != nil) - p Now playing: #[span#radio-song #{songList.Current().ArtistTitle()}] ( #[span#radio-duration-estimate ] #[span#radio-duration #{songList.Current().DurationString()}] ) + - cur := songList.Current() + if (cur.Artist != "") + p Now playing: #[span#radio-song #{cur.ArtistTitle()}] ( #[span#radio-duration-estimate ] #[span#radio-duration #{cur.DurationString()}] ) else p Now playing: #[span#radio-song ] ( #[span#radio-duration-estimate ] #[span#radio-duration ] ) p Current/peak listeners: #[span#radio-listeners #{listeners.Current()}] / #[span#radio-listener-peak #{listeners.Peak()}]