diff --git a/beets/dbcore/db.py b/beets/dbcore/db.py index 9d7469689..ca60f50ca 100755 --- a/beets/dbcore/db.py +++ b/beets/dbcore/db.py @@ -159,8 +159,8 @@ class FormattedMapping(Mapping[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 1ac16a8e2..6dbaa9e73 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -106,6 +106,9 @@ Bug fixes ``duplicate_action`` config options were silently ignored for as-is imports. - :doc:`/plugins/convert`: Fix extension substitution inside path of the exported playlist. +- :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). For plugin developers ~~~~~~~~~~~~~~~~~~~~~