diff --git a/internal/radio/icecast.go b/internal/radio/icecast.go index 9e9a07f..c908759 100644 --- a/internal/radio/icecast.go +++ b/internal/radio/icecast.go @@ -130,10 +130,12 @@ func icecastLastPlayedSongs(playlistPath string, n int) ([]Song, error) { lines := bytes.Split(buf, []byte("\n")) - if len(lines) < 1 { + if len(lines) < 2 { return nil, nil } + lines = lines[:len(lines)-1] + if len(lines) > n { lines = lines[len(lines)-n:] }