mirror of
https://github.com/beetbox/beets.git
synced 2026-01-02 14:03:12 +01:00
Merge pull request #298 from jayme-github/python26-resub
Fix Python 2.6 compatibility
This commit is contained in:
commit
18bbe9f645
1 changed files with 3 additions and 3 deletions
|
|
@ -98,10 +98,10 @@ class DiscogsPlugin(BeetsPlugin):
|
|||
# cause a query to return no results, even if they match the artist or
|
||||
# album title. Use `re.UNICODE` flag to avoid stripping non-english
|
||||
# word characters.
|
||||
query = re.sub(r'\W+', ' ', query, re.UNICODE)
|
||||
query = re.sub(r'(?u)\W+', ' ', query)
|
||||
# Strip medium information from query, Things like "CD1" and "disk 1"
|
||||
# can also negate an otherwise positive result.
|
||||
query = re.sub(r'\b(CD|disc)\s*\d+', '', query, re.I)
|
||||
query = re.sub(r'(?i)\b(CD|disc)\s*\d+', '', query)
|
||||
albums = []
|
||||
for result in Search(query).results():
|
||||
if isinstance(result, Release):
|
||||
|
|
@ -157,7 +157,7 @@ class DiscogsPlugin(BeetsPlugin):
|
|||
# Strip disambiguation number.
|
||||
name = re.sub(r' \(\d+\)$', '', name)
|
||||
# Move articles to the front.
|
||||
name = re.sub(r'^(.*?), (a|an|the)$', r'\2 \1', name, flags=re.I)
|
||||
name = re.sub(r'(?i)^(.*?), (a|an|the)$', r'\2 \1', name)
|
||||
bits.append(name)
|
||||
if artist['join']:
|
||||
bits.append(artist['join'])
|
||||
|
|
|
|||
Loading…
Reference in a new issue