mirror of
https://github.com/moparisthebest/SickRage
synced 2025-01-07 03:48:02 -05:00
Fixed issues with network timezone downloads crashing on a empty return.
Changed version checker url.
This commit is contained in:
parent
40b8e2d64d
commit
3f29439ff3
@ -47,10 +47,6 @@ In Progress<br />
|
|||||||
#end if
|
#end if
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<h3>Version Check:</h3>
|
|
||||||
<a class="btn" href="$sbRoot/manage/manageSearches/forceVersionCheck"><i class="icon-check"></i> Force Check</a>
|
|
||||||
<br /> <br />
|
|
||||||
|
|
||||||
<h3>Search Queue:</h3>
|
<h3>Search Queue:</h3>
|
||||||
Backlog: <i>$queueLength['backlog'] pending items</i></br>
|
Backlog: <i>$queueLength['backlog'] pending items</i></br>
|
||||||
Daily: <i>$queueLength['daily'] pending items</i></br>
|
Daily: <i>$queueLength['daily'] pending items</i></br>
|
||||||
|
@ -75,19 +75,23 @@ def _update_zoneinfo():
|
|||||||
# now check if the zoneinfo needs update
|
# now check if the zoneinfo needs update
|
||||||
url_zv = 'https://raw.githubusercontent.com/Prinz23/sb_network_timezones/master/zoneinfo.txt'
|
url_zv = 'https://raw.githubusercontent.com/Prinz23/sb_network_timezones/master/zoneinfo.txt'
|
||||||
|
|
||||||
url_data = helpers.getURL(url_zv)
|
try:
|
||||||
if url_data is None:
|
url_data = helpers.getURL(url_zv)
|
||||||
|
if not url_data:
|
||||||
|
raise
|
||||||
|
|
||||||
|
if lib.dateutil.zoneinfo.ZONEINFOFILE is not None:
|
||||||
|
cur_zoneinfo = ek.ek(basename, lib.dateutil.zoneinfo.ZONEINFOFILE)
|
||||||
|
else:
|
||||||
|
cur_zoneinfo = None
|
||||||
|
|
||||||
|
(new_zoneinfo, zoneinfo_md5) = url_data.decode('utf-8').strip().rsplit(u' ')
|
||||||
|
except:
|
||||||
# When urlData is None, trouble connecting to github
|
# When urlData is None, trouble connecting to github
|
||||||
logger.log(u'Loading zoneinfo.txt failed, this can happen from time to time. Unable to get URL: %s' % url_zv,
|
logger.log(u'Loading zoneinfo.txt failed, this can happen from time to time. Unable to get URL: %s' % url_zv,
|
||||||
logger.WARNING)
|
logger.WARNING)
|
||||||
return
|
return
|
||||||
|
|
||||||
if lib.dateutil.zoneinfo.ZONEINFOFILE is not None:
|
|
||||||
cur_zoneinfo = ek.ek(basename, lib.dateutil.zoneinfo.ZONEINFOFILE)
|
|
||||||
else:
|
|
||||||
cur_zoneinfo = None
|
|
||||||
(new_zoneinfo, zoneinfo_md5) = url_data.decode('utf-8').strip().rsplit(u' ')
|
|
||||||
|
|
||||||
if (cur_zoneinfo is not None) and (new_zoneinfo == cur_zoneinfo):
|
if (cur_zoneinfo is not None) and (new_zoneinfo == cur_zoneinfo):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ class KATProvider(generic.TorrentProvider):
|
|||||||
logger.log(u"Search string: " + searchURL, logger.DEBUG)
|
logger.log(u"Search string: " + searchURL, logger.DEBUG)
|
||||||
|
|
||||||
entries = self.cache.getRSSFeed(url, items=['entries', 'feed'])['entries']
|
entries = self.cache.getRSSFeed(url, items=['entries', 'feed'])['entries']
|
||||||
if entries and len(entries) > 0:
|
if entries:
|
||||||
break
|
break
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -361,7 +361,7 @@ class KATCache(tvcache.TVCache):
|
|||||||
logger.log(u"KAT cache update URL: " + searchURL, logger.DEBUG)
|
logger.log(u"KAT cache update URL: " + searchURL, logger.DEBUG)
|
||||||
|
|
||||||
data = self.getRSSFeed(url, items=['entries', 'feed'])
|
data = self.getRSSFeed(url, items=['entries', 'feed'])
|
||||||
if data and len(data) > 0:
|
if data['entries']:
|
||||||
break
|
break
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
@ -145,6 +145,8 @@ class BaseHandler(RequestHandler):
|
|||||||
self.redirect(url)
|
self.redirect(url)
|
||||||
else:
|
else:
|
||||||
self.write('Wrong API key used')
|
self.write('Wrong API key used')
|
||||||
|
self.finish()
|
||||||
|
|
||||||
elif self.settings.get("debug") and "exc_info" in kwargs:
|
elif self.settings.get("debug") and "exc_info" in kwargs:
|
||||||
exc_info = kwargs["exc_info"]
|
exc_info = kwargs["exc_info"]
|
||||||
trace_info = ''.join(["%s<br/>" % line for line in traceback.format_exception(*exc_info)])
|
trace_info = ''.join(["%s<br/>" % line for line in traceback.format_exception(*exc_info)])
|
||||||
@ -196,8 +198,11 @@ class WebHandler(BaseHandler):
|
|||||||
# process request async
|
# process request async
|
||||||
self.async_worker(method, self.async_done)
|
self.async_worker(method, self.async_done)
|
||||||
except:
|
except:
|
||||||
|
logger.log('Failed doing webui request "%s": %s' % (route, traceback.format_exc()), logger.ERROR)
|
||||||
raise HTTPError(404)
|
raise HTTPError(404)
|
||||||
|
|
||||||
|
def post(self, route, *args, **kwargs):
|
||||||
|
super(WebHandler, self).get(route, *args, **kwargs)
|
||||||
|
|
||||||
@run_on_executor
|
@run_on_executor
|
||||||
def async_worker(self, method, callback):
|
def async_worker(self, method, callback):
|
||||||
@ -207,22 +212,25 @@ class WebHandler(BaseHandler):
|
|||||||
kwargs[arg] = value[0]
|
kwargs[arg] = value[0]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
callback(method(**kwargs))
|
res = method(**kwargs)
|
||||||
except Exception as e:
|
callback(res)
|
||||||
|
except:
|
||||||
|
logger.log('Failed doing webui callback: %s' % (traceback.format_exc()), logger.ERROR)
|
||||||
callback()
|
callback()
|
||||||
|
|
||||||
def async_done(self, result=None):
|
def async_done(self, result=None):
|
||||||
if result:
|
try:
|
||||||
try:
|
result = ek.ss(result).encode('utf-8', 'xmlcharrefreplace')
|
||||||
result = ek.ss(result).encode('utf-8', 'xmlcharrefreplace')
|
except:
|
||||||
except:
|
result = str(result)
|
||||||
result = str(result)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.write(result)
|
self.write(result)
|
||||||
self.finish()
|
self.finish()
|
||||||
except:
|
except:
|
||||||
pass
|
logger.log('Failed sending webui reponse: %s' % (traceback.format_exc()), logger.DEBUG)
|
||||||
|
try:self.finish()
|
||||||
|
except:pass
|
||||||
|
|
||||||
def _genericMessage(self, subject, message):
|
def _genericMessage(self, subject, message):
|
||||||
t = PageTemplate(rh=self, file="genericMessage.tmpl")
|
t = PageTemplate(rh=self, file="genericMessage.tmpl")
|
||||||
@ -266,9 +274,6 @@ class WebHandler(BaseHandler):
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# post and get use same method
|
|
||||||
post = get
|
|
||||||
|
|
||||||
class LoginHandler(BaseHandler):
|
class LoginHandler(BaseHandler):
|
||||||
def get(self, *args, **kwargs):
|
def get(self, *args, **kwargs):
|
||||||
|
|
||||||
@ -614,7 +619,6 @@ class WebRoot(WebHandler):
|
|||||||
|
|
||||||
return ical
|
return ical
|
||||||
|
|
||||||
|
|
||||||
@route('/ui/(.*)(/?)')
|
@route('/ui/(.*)(/?)')
|
||||||
class UI(WebRoot):
|
class UI(WebRoot):
|
||||||
def add_message(self, *args, **kwargs):
|
def add_message(self, *args, **kwargs):
|
||||||
@ -658,8 +662,6 @@ class Home(WebRoot):
|
|||||||
{'title': 'Update KODI', 'path': 'home/updateKODI/', 'requires': self.haveKODI},
|
{'title': 'Update KODI', 'path': 'home/updateKODI/', 'requires': self.haveKODI},
|
||||||
{'title': 'Update Plex', 'path': 'home/updatePLEX/', 'requires': self.havePLEX},
|
{'title': 'Update Plex', 'path': 'home/updatePLEX/', 'requires': self.havePLEX},
|
||||||
{'title': 'Manage Torrents', 'path': 'manage/manageTorrents', 'requires': self.haveTORRENT},
|
{'title': 'Manage Torrents', 'path': 'manage/manageTorrents', 'requires': self.haveTORRENT},
|
||||||
{'title': 'Restart', 'path': 'home/restart/?pid=' + str(sickbeard.PID), 'confirm': True},
|
|
||||||
{'title': 'Shutdown', 'path': 'home/shutdown/?pid=' + str(sickbeard.PID), 'confirm': True},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
return menu
|
return menu
|
||||||
@ -1003,14 +1005,18 @@ class Home(WebRoot):
|
|||||||
|
|
||||||
updated = sickbeard.versionCheckScheduler.action.update() # @UndefinedVariable
|
updated = sickbeard.versionCheckScheduler.action.update() # @UndefinedVariable
|
||||||
if updated:
|
if updated:
|
||||||
# do a hard restart
|
# do a hard restart
|
||||||
sickbeard.events.put(sickbeard.events.SystemEvent.RESTART)
|
sickbeard.events.put(sickbeard.events.SystemEvent.RESTART)
|
||||||
|
|
||||||
t = PageTemplate(rh=self, file="restart_bare.tmpl")
|
t = PageTemplate(rh=self, file="restart_bare.tmpl")
|
||||||
return t
|
return t
|
||||||
else:
|
else:
|
||||||
return self._genericMessage("Update Failed",
|
if do_update:
|
||||||
"Update wasn't successful, not restarting. Check your log for more information.")
|
return self._genericMessage("Update Failed",
|
||||||
|
"Update wasn't successful, not restarting. Check your log for more information.")
|
||||||
|
|
||||||
|
if force:
|
||||||
|
self.redirect("/home/")
|
||||||
|
|
||||||
def branchCheckout(self, branch):
|
def branchCheckout(self, branch):
|
||||||
sickbeard.BRANCH = branch
|
sickbeard.BRANCH = branch
|
||||||
|
Loading…
Reference in New Issue
Block a user