A reduntant method Song.ArtistTitle() was removed.
This commit is contained in:
parent
4a4c228984
commit
131ea35341
@ -54,7 +54,7 @@ func CheckAndUpdateMostListenedSong(cur Song) {
|
||||
mostListened = MostListenedSong{
|
||||
Listeners: cur.MaxListeners,
|
||||
Date: cur.StartAt,
|
||||
Song: cur.ArtistTitle()}
|
||||
Song: cur.Artist + " - " + cur.Title}
|
||||
}
|
||||
mlsChanged = true
|
||||
}
|
||||
|
@ -16,11 +16,6 @@ type Song struct {
|
||||
StartAt time.Time
|
||||
}
|
||||
|
||||
// ArtistTitle returns a string formatted as "<artist> - <title>".
|
||||
func (s *Song) ArtistTitle() string {
|
||||
return s.Artist + " - " + s.Title
|
||||
}
|
||||
|
||||
// DurationString returns song's duration as a string formatted as [H:]M:SS.
|
||||
func (s *Song) DurationString() string {
|
||||
if s.Duration.Hours() >= 1 {
|
||||
|
@ -47,7 +47,7 @@ html(lang='en')
|
||||
div
|
||||
if (songList.Current() != nil)
|
||||
- cur := *songList.Current()
|
||||
p Now playing: #[span#radio-song #{cur.ArtistTitle()}] ( #[span#radio-duration-estimate ] #[span#radio-duration #{cur.DurationString()}] )
|
||||
p Now playing: #[span#radio-song #{cur.Artist} - #{cur.Title}] ( #[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()}]
|
||||
@ -64,7 +64,7 @@ html(lang='en')
|
||||
td= song.MaxListeners
|
||||
else
|
||||
td
|
||||
td= song.ArtistTitle()
|
||||
td #{song.Artist} - #{song.Title}
|
||||
- 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.
|
||||
|
Loading…
Reference in New Issue
Block a user