diff --git a/beets/dbcore/db.py b/beets/dbcore/db.py index 9d7469689c..ca60f50caa 100755 --- a/beets/dbcore/db.py +++ b/beets/dbcore/db.py @@ -159,8 +159,8 @@ def _get_formatted(self, model: Model, key: str) -> str: sep_repl: str = beets.config["path_sep_replace"].as_str() sep_drive: str = beets.config["drive_sep_replace"].as_str() - if re.match(r"^\w:", value): - value = re.sub(r"(?<=^\w):", sep_drive, value) + if re.match(r"^[a-zA-Z]:", value): + value = re.sub(r"(?<=[a-zA-Z]):", sep_drive, value) for sep in (os.path.sep, os.path.altsep): if sep: diff --git a/docs/changelog.rst b/docs/changelog.rst index 1ac16a8e27..4a944484f7 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -16,6 +16,9 @@ Unreleased Bug fixes ~~~~~~~~~ +- :ref:`replace`: Made ``drive_sep_replace`` regex logic more precise to prevent + edge-case mismatches (e.g., a song titled "1:00 AM" would incorrectly be + considered a Windows drive path). - :doc:`plugins/fish`: Fix AttributeError. :bug:`6340` ..