Skip to content

Commit

Permalink
artist/title: treat tabs like spaces when splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
snejus committed Dec 2, 2024
1 parent f078cc3 commit ac4b64a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions beetsplug/bandcamp/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Names:

# Title [Some Album EP]
ALBUM_IN_TITLE = re.compile(r"[- ]*\[([^\]]+ [EL]P)\]+", re.I)
SEPARATOR_PAT = re.compile(r"(?<= )[|\u2013\u2014-](?= )")
SEPARATOR_PAT = re.compile(r"(?<=\s)[|\u2013\u2014-](?=\s)")
TITLE_IN_QUOTES = re.compile(r'^(.+[^ -])[ -]+"([^"]+)"$')
NUMBER_PREFIX = re.compile(r"((?<=^)|(?<=- ))\d{1,2}\W+(?=\D)")

Expand Down Expand Up @@ -142,7 +142,7 @@ def normalize_delimiter(cls, names: list[str]) -> list[str]:
accordingly.
"""
delim = cls.find_common_track_delimiter(names)
pat = re.compile(rf" +[{re.escape(delim)}] +|\t")
pat = re.compile(rf"\s+[{re.escape(delim)}]\s+|\t")
return [pat.sub(" - ", n) for n in names]

def remove_label(self, names: list[str]) -> list[str]:
Expand Down

0 comments on commit ac4b64a

Please # to comment.