From: kaliko Date: Sat, 16 May 2020 11:40:33 +0000 (+0200) Subject: MPD client: Fixed bad changes introduce in 62332aa X-Git-Tag: 0.16.0.dev0~1 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=c2772b384c9a73397733a81bce3d7f21c52370a7;p=mpd-sima.git MPD client: Fixed bad changes introduce in 62332aa --- 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'