From 32e1c13510fb4dbf2a21ca07c49538c708ea2181 Mon Sep 17 00:00:00 2001 From: Jayme Date: Thu, 30 May 2013 09:30:00 +0200 Subject: [PATCH 1/2] Fix Python 2.6 compatibility --- beetsplug/discogs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py index 9c7a40058..0ac4a55a5 100644 --- a/beetsplug/discogs.py +++ b/beetsplug/discogs.py @@ -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']) From 5bb0881cddfa14ecdc296c7c784f57496770ee37 Mon Sep 17 00:00:00 2001 From: Jayme Date: Thu, 30 May 2013 10:09:39 +0200 Subject: [PATCH 2/2] Replace two more flag arguments --- beetsplug/discogs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py index 0ac4a55a5..bb8d37146 100644 --- a/beetsplug/discogs.py +++ b/beetsplug/discogs.py @@ -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):