From c2772b384c9a73397733a81bce3d7f21c52370a7 Mon Sep 17 00:00:00 2001 From: kaliko Date: Sat, 16 May 2020 13:40:33 +0200 Subject: [PATCH] MPD client: Fixed bad changes introduce in 62332aa --- sima/mpdclient.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sima/mpdclient.py b/sima/mpdclient.py index bf3ce5d..abc8282 100644 --- a/sima/mpdclient.py +++ b/sima/mpdclient.py @@ -206,19 +206,22 @@ class MPD(MPDClient): def _reset_cache(self): """ Both flushes and instantiates _cache + + * artists: all artists + * nombid_artists: artists with no mbid (set only when self.use_mbid is True) + * artist_tracks: caching last artist tracks, used in search_track """ if isinstance(self._cache, dict): self.log.info('Player: Flushing cache!') else: self.log.info('Player: Initialising cache!') self._cache = {'artists': frozenset(), - 'nombid_artists': frozenset()} - self._cache['artist_tracks'] = {} + 'nombid_artists': frozenset(), + 'artist_tracks': {}} + self._cache['artists'] = frozenset(filter(None, self.list('artist'))) if self.use_mbid: artists = self.list('artist', "(MUSICBRAINZ_ARTISTID == '')") self._cache['nombid_artists'] = frozenset(filter(None, artists)) - else: - self._cache['artists'] = frozenset(filter(None, self.list('artist'))) def _skipped_track(self, previous): if (self.state == 'stop' -- 2.39.5