- for close_art in match:
- # Regular lowered string comparison
- if artist.name.lower() == close_art.lower():
- artist.add_alias(close_art)
- return artist
- else:
- return None
- for fuzz_art in match:
- # Regular lowered string comparison
- if artist.name.lower() == fuzz_art.lower():
- found = True
- artist.add_alias(fuzz_art)
- if artist.name != fuzz_art:
- self.log.debug('"%s" matches "%s".', fuzz_art, artist)
+ self.log.trace('no fuzzy matching for %r', artist)
+ if found:
+ return artist
+ # Now perform fuzzy search
+ for fuzz in match:
+ if fuzz in artist.names: # Already found in lower cased comparison