Oops, last line also has a newline. So the last one is empty.
This commit is contained in:
parent
ef9af21de1
commit
64eed7ac7e
@ -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]))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user