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 }