1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Merge pull request #719 from adam111316/omgwtfnzbfix

Fix for omgwtfnzb skipping: release error
This commit is contained in:
echel0n 2014-08-14 21:54:58 -07:00
commit 701842ba71
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)