Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions beetsplug/playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import TYPE_CHECKING, ClassVar

import beets
from beets.dbcore import pathutils
from beets.dbcore.query import BLOB_TYPE, InQuery
from beets.util import path_as_posix

Expand Down Expand Up @@ -59,13 +60,16 @@ def __init__(self, _, pattern: str, __):
relative_to_bytes = beets.util.bytestring_path(relative_to)

for line in f:
if line[0] == "#":
# ignore comments, and extm3u extension
line = line.rstrip(b"\r\n")
if not line or line.startswith(b"#"):
# ignore blank lines, comments, and extm3u extension
continue

paths.append(
beets.util.normpath(
os.path.join(relative_to_bytes, line.rstrip())
pathutils.normalize_path_for_db(
beets.util.normpath(
os.path.join(relative_to_bytes, line)
)
)
)
f.close()
Expand Down
Loading