X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fmpdclient.py;h=ea6132c457ff5825e9d8a91d02b18aac01645c3a;hb=101e516622d9a3dc9b88bc91ee1be65423b705e7;hp=a0dbfdfa9332ad00b9717dab960f4f6bacf465aa;hpb=0c8b44f8c141795961516542c9feef0ab2fb1d88;p=mpd-sima.git diff --git a/sima/mpdclient.py b/sima/mpdclient.py index a0dbfdf..ea6132c 100644 --- a/sima/mpdclient.py +++ b/sima/mpdclient.py @@ -92,7 +92,7 @@ def blacklist(artist=False, album=False, track=False): if track and cls.database.get_bl_album(elem, add_not=True): # filter album as well in track mode # (artist have already been) - cls.log.debug('Blacklisted alb. "{0.album}"'.format(elem)) + cls.log.debug('Blacklisted alb. "%s"', elem) continue results.append(elem) return results @@ -251,9 +251,9 @@ class MPD(MPDClient): super().__getattr__('add')(payload.file) elif isinstance(payload, list): self.command_list_ok_begin() - for tr in payload: # TODO: use send command here + for tr in payload: self.add(tr) - results = client.command_list_end() + self.command_list_end() else: self.log.error('Cannot add %s', payload) @@ -388,7 +388,7 @@ class MPD(MPDClient): fuzz, artist) if found: if artist.aliases: - self.log.debug('Found: %s', '/'.join(list(artist.names)[:4])) + self.log.debug('Found aliases: %s', '/'.join(artist.names)) return artist return None @@ -442,7 +442,7 @@ class MPD(MPDClient): if 'Various Artists' in [tr.albumartist for tr in album_trks]: self.log.debug('Discarding %s ("Various Artists" set)', album) continue - if name not in album_artists: + if album_artists and name not in album_artists: self.log.debug('Discarding "%s", "%s" not set as albumartist', album, name) continue arts = {trk.artist for trk in album_trks}