From 64eed7ac7e441d00532f3fbcf6b8b5a482338e1f Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Tue, 30 Aug 2022 00:51:21 +0400 Subject: [PATCH] Oops, last line also has a newline. So the last one is empty. --- internal/radio/icecast.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/radio/icecast.go b/internal/radio/icecast.go index e0120f3..80128f4 100644 --- a/internal/radio/icecast.go +++ b/internal/radio/icecast.go @@ -140,7 +140,7 @@ func lastPlayedSong(playlistPath string) (*Song, error) { return nil, nil } - fields := bytes.Split(lines[len(lines)-2], []byte("|")) + fields := bytes.Split(lines[len(lines)-3], []byte("|")) tim, _ := time.Parse(IcecastPlaylistDateFormat, string(fields[0]))