mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 11:32:20 -05:00
Fix for HDbits tvcache issue
This commit is contained in:
parent
9714fc3299
commit
e19f1ee53e
@ -207,50 +207,13 @@ class HDBitsCache(tvcache.TVCache):
|
|||||||
# only poll HDBits every 15 minutes max
|
# only poll HDBits every 15 minutes max
|
||||||
self.minTime = 15
|
self.minTime = 15
|
||||||
|
|
||||||
def updateCache(self):
|
def _getDailyData(self):
|
||||||
|
parsedJSON = self.provider.getURL(self.provider.rss_url, post_data=self.provider._make_post_data_JSON(), json=True)
|
||||||
# delete anything older then 7 days
|
if parsedJSON and 'data' in parsedJSON:
|
||||||
self._clearCache()
|
return parsedJSON['data']
|
||||||
|
|
||||||
if not self.shouldUpdate():
|
|
||||||
return
|
|
||||||
|
|
||||||
if self._checkAuth(None):
|
|
||||||
|
|
||||||
parsedJSON = self._getRSSData()
|
|
||||||
if not parsedJSON:
|
|
||||||
logger.log(u"Error trying to load " + self.provider.name + " JSON feed", logger.ERROR)
|
|
||||||
return []
|
|
||||||
|
|
||||||
# mark updated
|
|
||||||
self.setLastUpdate()
|
|
||||||
|
|
||||||
if self._checkAuth(parsedJSON):
|
|
||||||
if parsedJSON and 'data' in parsedJSON:
|
|
||||||
items = parsedJSON['data']
|
|
||||||
else:
|
|
||||||
logger.log(u"Resulting JSON from " + self.provider.name + " isn't correct, not parsing it",
|
|
||||||
logger.ERROR)
|
|
||||||
return []
|
|
||||||
|
|
||||||
cl = []
|
|
||||||
for item in items:
|
|
||||||
ci = self._parseItem(item)
|
|
||||||
if ci is not None:
|
|
||||||
cl.append(ci)
|
|
||||||
|
|
||||||
if len(cl) > 0:
|
|
||||||
myDB = self._getDB()
|
|
||||||
myDB.mass_action(cl)
|
|
||||||
else:
|
|
||||||
raise exceptions.AuthException(
|
|
||||||
"Your authentication info for " + self.provider.name + " is incorrect, check your config")
|
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def _getRSSData(self):
|
|
||||||
return self.provider.getURL(self.provider.rss_url, post_data=self.provider._make_post_data_JSON(), json=True)
|
|
||||||
|
|
||||||
def _checkAuth(self, data):
|
def _checkAuth(self, data):
|
||||||
return self.provider._checkAuthFromData(data)
|
return self.provider._checkAuthFromData(data)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user