]> kaliko git repositories - mpd-sima.git/commitdiff
Fixed bad implementation of blocklist for albums
authorkaliko <kaliko@azylum.org>
Mon, 7 Jun 2021 13:09:06 +0000 (15:09 +0200)
committerkaliko <kaliko@azylum.org>
Mon, 7 Jun 2021 13:09:06 +0000 (15:09 +0200)
sima/mpdclient.py

index 0883b009e8f45826226f66694f9c7b3ba754a634..92ca0ceee21e1ec92a3d1450652047a8da3b4eec 100644 (file)
@@ -517,6 +517,8 @@ class MPD(MPDClient):
         candidates = []
         for album in albums:
             album_trks = self.find_tracks(album)
+            if not album_trks:  # find_track result can be empty, blocklist applied
+                continue
             album_artists = {tr.albumartist for tr in album_trks if tr.albumartist}
             if album.Artist.names & album_artists:
                 candidates.append(album)
@@ -548,9 +550,6 @@ class MPD(MPDClient):
                 self.log.debug('"%s" probably not an album of "%s" (ratio=%.2f)',
                                album, artist, ratio)
             continue
-        for alb in albums:
-            if self.database.get_bl_album(album, add=False):
-                candidates.remove(album)
         return candidates
 # #### / Search Methods ###