From 7bb91cfcbe0bbc686aa2a4ed68cf2174abcd256e Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Fri, 15 Sep 2023 03:20:12 +0400 Subject: [PATCH] A little reorganisation in icecast.go. --- internal/radio/icecast.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/internal/radio/icecast.go b/internal/radio/icecast.go index 3c6ca44..3d99b9b 100644 --- a/internal/radio/icecast.go +++ b/internal/radio/icecast.go @@ -46,15 +46,9 @@ func (is *IcecastStatusDTO) SongName() string { } type IcecastStatus struct { - SongName string `json:"song"` ListenerPeak int `json:"listener_peak"` Listeners int `json:"listeners"` -} - -type Song struct { - Time string `json:"time"` - Listeners string `json:"listeners"` - Song string `json:"song"` + SongName string `json:"song"` } func IcecastGetStatus(icecastURL string) (*IcecastStatus, error) { @@ -76,6 +70,12 @@ func IcecastGetStatus(icecastURL string) (*IcecastStatus, error) { }, nil } +type Song struct { + Time string `json:"time"` + Listeners string `json:"listeners"` + Song string `json:"song"` +} + func IcecastLastSongs(playlistPath string) []Song { lastPlayedCacheMutex.Lock() defer lastPlayedCacheMutex.Unlock() @@ -84,7 +84,6 @@ func IcecastLastSongs(playlistPath string) []Song { copy(ret, lastPlayedCache) return ret } - return nil }