X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fplugins%2Finternal%2Flastfm.py;h=be87094ca208f1a49ea9cf2b8b0b3301bcd7b3d9;hb=8bf0d37a99b80af5674a639bfbc155db18ac557d;hp=ba10a48b063eb1701bf0bece1b89f255127b752b;hpb=63563d000f2646724c1ff91eb6fcca01f5201d23;p=mpd-sima.git diff --git a/sima/plugins/internal/lastfm.py b/sima/plugins/internal/lastfm.py index ba10a48..be87094 100644 --- a/sima/plugins/internal/lastfm.py +++ b/sima/plugins/internal/lastfm.py @@ -29,7 +29,7 @@ from os.path import join # local import from ...lib.simafm import SimaFM from ...lib.webserv import WebService -from ...lib.cache import FileCache +from ...lib.cache import FileCache, DictCache class Lastfm(WebService): @@ -41,7 +41,11 @@ class Lastfm(WebService): self.ws = SimaFM # Set persitent cache vardir = daemon.config['sima']['var_dir'] - SimaFM.cache = FileCache(join(vardir, 'http', 'LastFM')) + persitent_cache = daemon.config.getboolean('lastfm', 'cache') + if persitent_cache: + SimaFM.cache = FileCache(join(vardir, 'http', 'LastFM')) + else: + SimaFM.cache = DictCache() # VIM MODLINE