mirror of
https://github.com/beetbox/beets.git
synced 2026-02-01 04:55:38 +01:00
Use case insensitive regex for substitute
This commit is contained in:
parent
03f1205629
commit
e613a57ca4
1 changed files with 2 additions and 2 deletions
|
|
@ -34,7 +34,7 @@ class Substitute(BeetsPlugin):
|
|||
"""Do the actual replacing."""
|
||||
if text:
|
||||
for pattern, replacement in self.substitute_rules:
|
||||
if pattern.match(text.lower()):
|
||||
if pattern.match(text):
|
||||
return replacement
|
||||
return text
|
||||
else:
|
||||
|
|
@ -52,5 +52,5 @@ class Substitute(BeetsPlugin):
|
|||
|
||||
for key, view in self.config.items():
|
||||
value = view.as_str()
|
||||
pattern = re.compile(key.lower())
|
||||
pattern = re.compile(key, flags=re.IGNORECASE)
|
||||
self.substitute_rules.append((pattern, value))
|
||||
|
|
|
|||
Loading…
Reference in a new issue