From 6d4a276dd8df68458da1148fbb82f4fa62d1e4ba Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 12 Mar 2023 21:32:29 +0400 Subject: [PATCH] IcecastLastSongs() (formerly known as IcecastLastPlayedSongs()) args were changed, so let's delete unneeded arg. --- internal/http/handlers.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/http/handlers.go b/internal/http/handlers.go index 5ecfd04..500cd0f 100644 --- a/internal/http/handlers.go +++ b/internal/http/handlers.go @@ -40,8 +40,7 @@ func (h *Handlers) Index(w http.ResponseWriter, r *http.Request) { } } - songs, err := radio.IcecastLastPlayedSongs(h.conf.ListLastNSongs, - h.conf.Icecast.Playlist) + songs, err := radio.IcecastLastSongs(h.conf.Icecast.Playlist) if err != nil { log.Println("cannot retrieve last songs:", err) } else { @@ -81,7 +80,7 @@ func (h *Handlers) LastSong(w http.ResponseWriter, r *http.Request) { log.Println("cannot retrieve last songs:", err) } - if song.Time == "" { + if song == nil { w.WriteHeader(http.StatusNotFound) return }