From: kaliko Date: Fri, 15 May 2020 15:38:57 +0000 (+0200) Subject: MPD client: Improved album search X-Git-Tag: 0.16.0.dev0~8 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=45e8a0624444617ee9e86fe4576d9bb4aedfbb8a;p=mpd-sima.git MPD client: Improved album search --- diff --git a/sima/mpdclient.py b/sima/mpdclient.py index 6b461ba..ed2fbcd 100644 --- a/sima/mpdclient.py +++ b/sima/mpdclient.py @@ -331,15 +331,16 @@ class MPD(MPDClient): raise PlayerError('Album object have no artist attribute') albums = [] if self.use_mbid and album.mbid: - filt = f'(MUSICBRAINZ_ALBUMID == {album.mbid})' + filt = f"(MUSICBRAINZ_ALBUMID == '{album.mbid}')" albums = self.find(filt) # Now look for album with no MusicBrainzIdentifier if not albums and album.artist.mbid and self.use_mbid: # Use album artist MBID if possible filt = f"((MUSICBRAINZ_ALBUMARTISTID == '{album.artist.mbid}') AND (album == '{album.name_sz}'))" albums = self.find(filt) if not albums: # Falls back to (album)?artist/album name - filt = f"((albumartist == '{album.artist!s}') AND (album == '{album.name_sz}'))" - albums = self.find(filt) + for artist in album.artist.names_sz: + filt = f"((albumartist == '{artist}') AND (album == '{album.name_sz}'))" + albums.extend(self.find(filt)) return albums # #### / find_tracks ##