- exact_m = self.list('artist', f"(MUSICBRAINZ_ARTISTID == '{artist.mbid}')")
- if exact_m:
- found = True
- # Looking for "Esthero" adds "DJ Krush feat. Esthero" to aliases
- # This seems wrong, disables it for now
- #_ = [artist.add_alias(name) for name in exact_m]
- # then complete with fuzzy search on artist with no musicbrainz_artistid
- if artist.mbid:
- # we already performed a lookup on artists with mbid set
- # search through remaining artists
- artists = self._cache.get('nombid_artists')
- else:
- artists = self._cache.get('artists')
+ found = bool(self.list('artist', f"(MUSICBRAINZ_ARTISTID == '{artist.mbid}')"))
+ if found:
+ self.log.trace('Found mbid "%r" in library', artist)
+ # Fetches remaining artists for potential match
+ artists = self._cache['nombid_artists']
+ else: # not using MusicBrainzIDs
+ artists = self._cache['artists']