diff --git a/internal/radio/song.go b/internal/radio/song.go index 28e3ee0..f9d90e3 100644 --- a/internal/radio/song.go +++ b/internal/radio/song.go @@ -24,13 +24,15 @@ func (s *Song) MarshalJSON() ([]byte, error) { return json.Marshal(&struct { Artist string `json:"artist"` Title string `json:"title"` - Duration int64 `json:"duration_milliseconds"` + DurationMill int64 `json:"duration_milliseconds"` + Duration string `json:"duration"` MaxListeners int `json:"listeners"` StartAt string `json:"start_at"` }{ Artist: s.Artist, Title: s.Title, - Duration: s.Duration.Milliseconds(), + DurationMill: s.Duration.Milliseconds(), + Duration: time.UnixMilli(s.Duration.Milliseconds()).Format("04:05"), MaxListeners: s.MaxListeners, StartAt: s.StartAt.UTC().Format(time.RFC3339)}) }