Skip to content

Commit 069c6cf

Browse files
committed
Ignore artist likely derived from track number in filename
1 parent d1acce0 commit 069c6cf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Contents/Code/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,14 @@ def getDateFromString(self, string):
244244
except:
245245
return None
246246

247+
def firstIntegerFromString(self, string):
248+
try:
249+
result = re.search(r'(\d+)', string)
250+
if result is not None:
251+
return result.group(0)
252+
except:
253+
return None
254+
247255
def getStringContentFromXPath(self, source, query):
248256
return source.xpath('string(' + query + ')')
249257

@@ -321,6 +329,10 @@ def search(self, results, media, lang, manual):
321329
self.Log('Album Title is [Unknown Album] on an automatic search. Returning')
322330
return
323331

332+
# ignore artist likely derived from track number in filename
333+
if media.artist == self.firstIntegerFromString(media.artist):
334+
media.artist = None
335+
324336
if manual:
325337
Log('You clicked \'fix match\'. This may have returned no useful results because it\'s searching using the title of the first track.')
326338
Log('There\'s not currently a way around this initial failure. But clicking \'Search Options\' and entering the title works just fine.')

0 commit comments

Comments
 (0)