]> kaliko git repositories - mpd-sima.git/commitdiff
Fixed client cache initialising, filters out empty strings
authorkaliko <kaliko@azylum.org>
Sat, 23 Jul 2016 08:36:17 +0000 (10:36 +0200)
committerkaliko <kaliko@azylum.org>
Sat, 23 Jul 2016 08:36:17 +0000 (10:36 +0200)
doc/Changelog
sima/client.py
sima/plugins/internal/random.py

index fb30f68976e2c1edb9908f630686c03acda4f888..e539281f3e0578b3f82e4fd881576f1d7c85db8e 100644 (file)
@@ -1,6 +1,6 @@
 MPD_sima v0.14.2
 
- * 
+ * Fixed MPD client cache (filters empty strings)
 
 -- kaliko jack <kaliko@azylum.org> UNRELEASED
 
index 9c12f8be1a9e55456636a6bb88fac9d76a6d0587..236ab10cbec3f1138448cf7c7e813659a735b4e9 100644 (file)
@@ -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):
index feca9d80275ed4b90be5de3d15c03f11274fa049..ec17e9a679a0d8a0c3a60a0f092c89029cde0b21 100644 (file)
@@ -47,6 +47,7 @@ class Random(Plugin):
             self.log.warning('Bad value for flavour, '
                              '"%s" not in ["pure", "sensible"]', self.mode)
             self.mode = 'pure'
+        self.log.debug('Random flavour: %s', self.mode)
 
     def get_played_artist(self,):
         """Constructs list of already played artists.