Moved IcecastStatusDTO's method Song() under its struct.
This commit is contained in:
parent
d601ec607b
commit
4216c9c82a
@ -22,6 +22,10 @@ type IcecastStatusDTO struct {
|
|||||||
} `json:"icestats"`
|
} `json:"icestats"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (is *IcecastStatusDTO) Song() string {
|
||||||
|
return fmt.Sprintf("%s - %s", is.Icestats.Source.Artist, is.Icestats.Source.Title)
|
||||||
|
}
|
||||||
|
|
||||||
type IcecastStatus struct {
|
type IcecastStatus struct {
|
||||||
ServerStartISO8601 string `json:"server_start_iso8601"`
|
ServerStartISO8601 string `json:"server_start_iso8601"`
|
||||||
ServerStartDate string `json:"server_start"`
|
ServerStartDate string `json:"server_start"`
|
||||||
@ -59,10 +63,6 @@ func IcecastGetStatus(icecastURL string) (*IcecastStatus, error) {
|
|||||||
return iceStat, nil
|
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 {
|
func IcecastLastPlayedSongs(lastNSongs int, playlistPath string) []Song {
|
||||||
songs := make([]Song, 0)
|
songs := make([]Song, 0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user