From 4216c9c82aad377e98bac056a11039d3ce8b1d39 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Wed, 30 Mar 2022 18:54:50 +0400 Subject: [PATCH] Moved IcecastStatusDTO's method Song() under its struct. --- internal/radio/icecast.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/radio/icecast.go b/internal/radio/icecast.go index d46c85f..566d893 100644 --- a/internal/radio/icecast.go +++ b/internal/radio/icecast.go @@ -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)