From: kaliko Date: Sat, 23 Jul 2016 08:36:17 +0000 (+0200) Subject: Fixed client cache initialising, filters out empty strings X-Git-Tag: 0.14.2~4 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=0248e11c84a42df201feda6aa62062dc8c1df330;p=mpd-sima.git Fixed client cache initialising, filters out empty strings --- diff --git a/doc/Changelog b/doc/Changelog index fb30f68..e539281 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,6 @@ MPD_sima v0.14.2 - * + * Fixed MPD client cache (filters empty strings) -- kaliko jack UNRELEASED diff --git a/sima/client.py b/sima/client.py index 9c12f8b..236ab10 100644 --- a/sima/client.py +++ b/sima/client.py @@ -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): diff --git a/sima/plugins/internal/random.py b/sima/plugins/internal/random.py index feca9d8..ec17e9a 100644 --- a/sima/plugins/internal/random.py +++ b/sima/plugins/internal/random.py @@ -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.