diff --git a/internal/radio/icecast.go b/internal/radio/icecast.go index c8f92d6..516235e 100644 --- a/internal/radio/icecast.go +++ b/internal/radio/icecast.go @@ -73,7 +73,9 @@ func IcecastLastPlayedSongs(lastNSongs int, playlistPath string) ([]Song, error) if lastNSongs > lpcLen { lastNSongs = lpcLen } - return lastPlayedCache[lpcLen-lastNSongs:], nil + var ret []Song = make([]Song, lastNSongs) + copy(ret[:], lastPlayedCache[lpcLen-lastNSongs:]) + return ret, nil } }