A little reorganisation in icecast.go.
This commit is contained in:
parent
e8ad10a16d
commit
7bb91cfcbe
@ -46,15 +46,9 @@ func (is *IcecastStatusDTO) SongName() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type IcecastStatus struct {
|
type IcecastStatus struct {
|
||||||
SongName string `json:"song"`
|
|
||||||
ListenerPeak int `json:"listener_peak"`
|
ListenerPeak int `json:"listener_peak"`
|
||||||
Listeners int `json:"listeners"`
|
Listeners int `json:"listeners"`
|
||||||
}
|
SongName string `json:"song"`
|
||||||
|
|
||||||
type Song struct {
|
|
||||||
Time string `json:"time"`
|
|
||||||
Listeners string `json:"listeners"`
|
|
||||||
Song string `json:"song"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func IcecastGetStatus(icecastURL string) (*IcecastStatus, error) {
|
func IcecastGetStatus(icecastURL string) (*IcecastStatus, error) {
|
||||||
@ -76,6 +70,12 @@ func IcecastGetStatus(icecastURL string) (*IcecastStatus, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Song struct {
|
||||||
|
Time string `json:"time"`
|
||||||
|
Listeners string `json:"listeners"`
|
||||||
|
Song string `json:"song"`
|
||||||
|
}
|
||||||
|
|
||||||
func IcecastLastSongs(playlistPath string) []Song {
|
func IcecastLastSongs(playlistPath string) []Song {
|
||||||
lastPlayedCacheMutex.Lock()
|
lastPlayedCacheMutex.Lock()
|
||||||
defer lastPlayedCacheMutex.Unlock()
|
defer lastPlayedCacheMutex.Unlock()
|
||||||
@ -84,7 +84,6 @@ func IcecastLastSongs(playlistPath string) []Song {
|
|||||||
copy(ret, lastPlayedCache)
|
copy(ret, lastPlayedCache)
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user