diff --git a/couchpotato/core/plugins/base.py b/couchpotato/core/plugins/base.py index de64c6d0..ef38d565 100644 --- a/couchpotato/core/plugins/base.py +++ b/couchpotato/core/plugins/base.py @@ -158,6 +158,17 @@ class Plugin(object): except: log.error("Something went wrong when finishing the plugin function. Could not find the 'is_running' key") + + def getCache(self, cache_key): + cache = Env.get('cache').get(cache_key) + if cache: + log.debug('Getting cache %s' % cache_key) + return cache + + def setCache(self, cache_key, value, timeout = 300): + log.debug('Setting cache %s' % cache_key) + Env.get('cache').set(cache_key, value, timeout) + def isDisabled(self): return not self.isEnabled() diff --git a/couchpotato/core/providers/base.py b/couchpotato/core/providers/base.py index b4346fb6..199f4248 100644 --- a/couchpotato/core/providers/base.py +++ b/couchpotato/core/providers/base.py @@ -17,16 +17,6 @@ class Provider(Plugin): last_available_check = {} is_available = {} - def getCache(self, cache_key): - cache = Env.get('cache').get(cache_key) - if cache: - log.debug('Getting cache %s' % cache_key) - return cache - - def setCache(self, cache_key, value, timeout = 300): - log.debug('Setting cache %s' % cache_key) - Env.get('cache').set(cache_key, value, timeout) - def isAvailable(self, test_url): if Env.get('debug'): return True