X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fmpdclient.py;h=abc8282ea545e50722ecf0dcfcb4c70d79bdc05a;hb=c2772b384c9a73397733a81bce3d7f21c52370a7;hp=bf3ce5dbfb08d2f99b07c33813f17d8817c0e1e7;hpb=1167ed537fc43affb7d6e068092ff920ea0d308b;p=mpd-sima.git 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'