X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fplugins%2Finternal%2Flastfm.py;h=280519729bbafec13de7aff60f7ea5fc20514169;hb=cfe6dafed6e43714316c39c401475ed840e66a02;hp=be87094ca208f1a49ea9cf2b8b0b3301bcd7b3d9;hpb=8bf0d37a99b80af5674a639bfbc155db18ac557d;p=mpd-sima.git diff --git a/sima/plugins/internal/lastfm.py b/sima/plugins/internal/lastfm.py index be87094..2805197 100644 --- a/sima/plugins/internal/lastfm.py +++ b/sima/plugins/internal/lastfm.py @@ -29,7 +29,8 @@ from os.path import join # local import from ...lib.simafm import SimaFM from ...lib.webserv import WebService -from ...lib.cache import FileCache, DictCache +from ...lib.cache import FileCache +from ...lib.http import CacheController class Lastfm(WebService): @@ -38,14 +39,14 @@ class Lastfm(WebService): def __init__(self, daemon): WebService.__init__(self, daemon) - self.ws = SimaFM # Set persitent cache vardir = daemon.config['sima']['var_dir'] persitent_cache = daemon.config.getboolean('lastfm', 'cache') if persitent_cache: + CacheController.CACHE_ANYWAY = True + self.log.debug('Persistant cache enabled in {}'.format(join(vardir, 'http', 'LastFM'))) SimaFM.cache = FileCache(join(vardir, 'http', 'LastFM')) - else: - SimaFM.cache = DictCache() + self.ws = SimaFM() # VIM MODLINE