# -*- coding: utf-8 -*-
-# Copyright (c) 2013, 2014 Jack Kaliko <kaliko@azylum.org>
+# Copyright (c) 2013, 2014, 2020 kaliko <kaliko@azylum.org>
#
# This file is part of sima
#
# 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):
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 %s',
+ join(vardir, 'http', 'LastFM'))
SimaFM.cache = FileCache(join(vardir, 'http', 'LastFM'))
- else:
- SimaFM.cache = DictCache()
+ self.ws = SimaFM()
# VIM MODLINE