@blacklist(track=True)
def find_track(self, artist, title=None):
tracks = set()
- for name in artist.names:
- if title:
- tracks |= set(self.find('artist', name, 'title', title))
- else:
- tracks |= set(self.find('artist', name))
if artist.mbid:
if title:
- tracks |= set(self.find('musicbrainz_artistid', artist.mbid))
- else:
tracks |= set(self.find('musicbrainz_artistid', artist.mbid,
'title', title))
+ else:
+ tracks |= set(self.find('musicbrainz_artistid', artist.mbid))
+ else:
+ for name in artist.names:
+ if title:
+ tracks |= set(self.find('artist', name, 'title', title))
+ else:
+ tracks |= set(self.find('artist', name))
return list(tracks)
@bl_artist
artists = self.get_local_similar_artists()
nbtracks_target = self.plugin_conf.getint('track_to_add')
for artist in artists:
- self.log.debug('Trying to find titles to add for "{}"'.format(
+ self.log.debug('Trying to find titles to add for "{!r}"'.format(
artist))
found = self.player.find_track(artist)
random.shuffle(found)