1
0

Moved IcecastStatusDTO's method Song() under its struct.

This commit is contained in:
Alexander Andreev 2022-03-30 18:54:50 +04:00
parent d601ec607b
commit 4216c9c82a
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -22,6 +22,10 @@ type IcecastStatusDTO struct {
} `json:"icestats"`
}
func (is *IcecastStatusDTO) Song() string {
return fmt.Sprintf("%s - %s", is.Icestats.Source.Artist, is.Icestats.Source.Title)
}
type IcecastStatus struct {
ServerStartISO8601 string `json:"server_start_iso8601"`
ServerStartDate string `json:"server_start"`
@ -59,10 +63,6 @@ func IcecastGetStatus(icecastURL string) (*IcecastStatus, error) {
return iceStat, nil
}
func (is *IcecastStatusDTO) Song() string {
return fmt.Sprintf("%s - %s", is.Icestats.Source.Artist, is.Icestats.Source.Title)
}
func IcecastLastPlayedSongs(lastNSongs int, playlistPath string) []Song {
songs := make([]Song, 0)