]> kaliko git repositories - mpd-sima.git/blobdiff - sima/client.py
Honors artist blacklisting in Random plugin (Closes #14)
[mpd-sima.git] / sima / client.py
index 9c12f8be1a9e55456636a6bb88fac9d76a6d0587..525f268d0c5b5c02ee067388145d1fe357a496d8 100644 (file)
@@ -62,7 +62,7 @@ def bl_artist(func):
         names = list()
         for art in result.names:
             if cls.database.get_bl_artist(art, add_not=True):
-                cls.log.debug('Blacklisted "{0}"'.format(art))
+                cls.log.debug('Blacklisted "%s"', art)
                 continue
             names.append(art)
         if not names:
@@ -159,9 +159,9 @@ class PlayerClient(Player):
             self.log.info('Player: Initialising cache!')
         self._cache = {'artists': frozenset(),
                        'nombid_artists': frozenset(),}
-        self._cache['artists'] = frozenset(self._execute('list', ['artist']))
+        self._cache['artists'] = frozenset(filter(None, self._execute('list', ['artist'])))
         if Artist.use_mbid:
-            self._cache['nombid_artists'] = frozenset(self._execute('list', ['artist', 'musicbrainz_artistid', '']))
+            self._cache['nombid_artists'] = frozenset(filter(None, self._execute('list', ['artist', 'musicbrainz_artistid', ''])))
 
     @blacklist(track=True)
     def find_track(self, artist, title=None):