More specific caching keys

This commit is contained in:
Ruud
2011-06-04 21:37:19 +02:00
parent 452fdef136
commit f1c9ed3cea
3 changed files with 5 additions and 4 deletions
@@ -54,7 +54,7 @@ class Newznab(NZBProvider, RSS):
})
url = "%s&%s" % (self.getUrl(self.urls['search']), arguments)
cache_key = '%s-%s' % (movie['library']['identifier'], cat_id[0])
cache_key = 'newznab.%s.%s' % (movie['library']['identifier'], cat_id[0])
single_cat = (len(cat_id) == 1 and cat_id[0] != self.cat_backup_id)
try:
@@ -53,7 +53,7 @@ class NZBMatrix(NZBProvider, RSS):
url = "%s?%s" % (self.urls['search'], arguments)
log.info('Searching: %s' % url)
cache_key = '%s-%s' % (movie['library'].get('identifier'), cat_ids)
cache_key = 'nzbmatrix.%s.%s' % (movie['library'].get('identifier'), cat_ids)
single_cat = True
try:
+3 -2
View File
@@ -50,7 +50,7 @@ class Nzbs(NZBProvider, RSS):
})
url = "%s?%s" % (self.urls['api'], arguments)
cache_key = '%s-%s' % (movie['library'].get('identifier'), str(cat_id))
cache_key = 'nzbs.%s.%s' % (movie['library'].get('identifier'), str(cat_id))
try:
data = self.getCache(cache_key)
@@ -72,8 +72,9 @@ class Nzbs(NZBProvider, RSS):
for nzb in nzbs:
id = int(self.getTextElement(nzb, "link").partition('nzbid=')[2])
new = {
'id': int(self.getTextElement(nzb, "link").partition('nzbid=')[2]),
'id': id,
'type': 'nzb',
'name': self.getTextElement(nzb, "title"),
'age': self.calculateAge(int(time.mktime(parse(self.getTextElement(nzb, "pubDate")).timetuple()))),