Skip to content

🎧 Your Personal Streaming Service

Ignore empty lines in M3U files

Deluane7202339af54
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://") {