From e7202339af54734f16ae8659e4592db9dbf64c6a Mon Sep 17 00:00:00 2001 From: Deluan Date: Sun, 31 Oct 2021 20:43:30 -0400 Subject: [PATCH] Ignore empty lines in M3U files --- core/playlists.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/playlists.go b/core/playlists.go index 744139371..bfec3b5e9 100644 --- a/core/playlists.go +++ b/core/playlists.go @@ -110,9 +110,9 @@ func (s *playlists) parseM3U(ctx context.Context, pls *model.Playlist, baseDir s scanner.Split(scanLines) var mfs model.MediaFiles for scanner.Scan() { - path := scanner.Text() - // Skip extended info - if strings.HasPrefix(path, "#") { + path := strings.TrimSpace(scanner.Text()) + // Skip empty lines and extended info + if path == "" || strings.HasPrefix(path, "#") { continue } if strings.HasPrefix(path, "file://") {