]> kaliko git repositories - mpd-sima.git/commitdiff
MPD client: Improved album search
authorkaliko <kaliko@azylum.org>
Fri, 15 May 2020 15:38:57 +0000 (17:38 +0200)
committerkaliko <kaliko@azylum.org>
Fri, 15 May 2020 15:38:57 +0000 (17:38 +0200)
sima/mpdclient.py

index 6b461bacc28e86476bf5c0471ba419c3d2c2562f..ed2fbcdb37ec31bf93f3b9f497ad4612096bb2fa 100644 (file)
@@ -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 ##