1
0

Okay, there is actually a new line at the end of file. Let's skip that.

This commit is contained in:
Alexander Andreev 2023-03-13 05:10:17 +04:00
parent c58ef0685a
commit c02442ebcd
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -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:]
}