Standardize cache_key generation

This commit is contained in:
Ruud committed 2013-09-03 12:48:24 +02:00
1 parent 97c456c9e1
commit 6af00bf026
3 files changed
+9 -8

No files matched your search

+4 -3
View File
@@ -259,8 +259,8 @@ class Plugin(object):
def getCache(self, cache_key, url = None, **kwargs):
cache_key = md5(ss(cache_key))
cache = Env.get('cache').get(cache_key)
cache_key_md5 = md5(ss(cache_key))
cache = Env.get('cache').get(cache_key_md5)
if cache:
if not Env.get('dev'): log.debug('Getting cache %s', cache_key)
return cache
@@ -284,8 +284,9 @@ class Plugin(object):
return ''
def setCache(self, cache_key, value, timeout = 300):
cache_key_md5 = md5(ss(cache_key))
log.debug('Setting cache %s', cache_key)
Env.get('cache').set(cache_key, value, timeout)
Env.get('cache').set(cache_key_md5, value, timeout)
return value
def createNzbName(self, data, movie):