Fix for omgwtfnzb skipping: release error

This commit is contained in:
Adam 2014-08-15 11:43:11 +08:00
parent 872dd2b9fc
commit 96f918742a
2 changed files with 25 additions and 1 deletions

View File

@ -154,6 +154,26 @@ class OmgwtfnzbsCache(tvcache.TVCache):
tvcache.TVCache.__init__(self, provider)
self.minTime = 20
def _get_title_and_url(self, item):
"""
Retrieves the title and URL data from the item XML node
item: An elementtree.ElementTree element representing the <item> tag of the RSS feed
Returns: A tuple containing two strings representing title and URL respectively
"""
title = item.title if item.title else None
if title:
title = u'' + title
title = title.replace(' ', '.')
url = item.link if item.link else None
if url:
url = url.replace('&amp;', '&')
return (title, url)
def _getDailyData(self):
params = {'user': provider.username,
'api': provider.api_key,

View File

@ -96,6 +96,10 @@ class TVCache():
myDB = self._getDB()
myDB.action("DELETE FROM [" + self.providerID + "] WHERE time < ?", [int(time.mktime(curDate.timetuple()))])
def _get_title_and_url(self, item):
# override this in the provider if daily search has a different data layout to backlog searches
return self.provider._get_title_and_url(item)
def _getRSSData(self):
data = None
@ -128,7 +132,7 @@ class TVCache():
# parse data
cl = []
for item in data:
title, url = self.provider._get_title_and_url(item)
title, url = self._get_title_and_url(item)
ci = self._parseItem(title, url)
if ci is not None:
cl.append(ci)