X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fclient.py;fp=sima%2Fclient.py;h=499250fccd2d04c01ad96fab717a9b5a79b6c13d;hb=5a10f68f5d4b6bda63db74f205e6024d48c60e51;hp=66894a77a3516faeb3918a76a9943e4451d76825;hpb=113157e3ae7b1fd57654542030c3de9c03c4261a;p=mpd-sima.git diff --git a/sima/client.py b/sima/client.py index 66894a7..499250f 100644 --- a/sima/client.py +++ b/sima/client.py @@ -169,17 +169,18 @@ class PlayerClient(Player): @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