mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
- Removed annoying alert message when failed to retrieve newsnab capabilities (categories)
- Added backend debug logging
This commit is contained in:
parent
88479e7e1b
commit
3366108255
@ -32,7 +32,6 @@ $(document).ready(function(){
|
||||
$.getJSON(sbRoot + '/config/providers/getNewznabCategories', params,
|
||||
function(data){
|
||||
if (data.error != "") {
|
||||
alert(data.error);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -661,4 +660,5 @@ $(document).ready(function(){
|
||||
|
||||
$("#provider_order_list").disableSelection();
|
||||
|
||||
});
|
||||
});
|
@ -118,11 +118,19 @@ class NewznabProvider(generic.NZBProvider):
|
||||
if self.needs_auth and self.key:
|
||||
params['apikey'] = self.key
|
||||
|
||||
categories = self.getURL("%s/api" % (self.url), params=params)
|
||||
try:
|
||||
categories = self.getURL("%s/api" % (self.url), params=params, timeout=10)
|
||||
except:
|
||||
logger.log(u"Error getting html for [%s]" %
|
||||
("%s/api?%s" % (self.url, '&'.join("%s=%s" % (x,y) for x,y in params.items())) ), logger.DEBUG)
|
||||
return (False, return_categories, "Error getting html for [%s]" %
|
||||
("%s/api?%s" % (self.url, '&'.join("%s=%s" % (x,y) for x,y in params.items()) )))
|
||||
|
||||
xml_categories = helpers.parse_xml(categories)
|
||||
|
||||
if not xml_categories:
|
||||
logger.log(u"Error parsing xml for [%s]" % (self.name),
|
||||
logger.DEBUG)
|
||||
return (False, return_categories, "Error parsing xml for [%s]" % (self.name))
|
||||
|
||||
try:
|
||||
@ -131,6 +139,8 @@ class NewznabProvider(generic.NZBProvider):
|
||||
for subcat in category.findall('subcat'):
|
||||
return_categories.append(subcat.attrib)
|
||||
except:
|
||||
logger.log(u"Error parsing result for [%s]" % (self.name),
|
||||
logger.DEBUG)
|
||||
return (False, return_categories, "Error parsing result for [%s]" % (self.name))
|
||||
|
||||
return (True, return_categories, "")
|
||||
|
Loading…
Reference in New Issue
Block a user