1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-25 01:08:50 -05:00

AniDB: Catch exception when generating white and blacklist

This commit is contained in:
Alexandre Beloin 2015-02-18 17:16:53 -05:00
parent 4ad2b7e2cc
commit a5de329edb

View File

@ -1333,11 +1333,16 @@ class Home(WebRoot):
shortWhiteList = [] shortWhiteList = []
if helpers.set_up_anidb_connection(): if helpers.set_up_anidb_connection():
for groupName in whitelist: for groupName in whitelist:
group = sickbeard.ADBA_CONNECTION.group(gname=groupName) try:
for line in group.datalines: group = sickbeard.ADBA_CONNECTION.group(gname=groupName)
if line["shortname"]: for line in group.datalines:
shortWhiteList.append(line["shortname"]) if line["shortname"]:
else: shortWhiteList.append(line["shortname"])
else:
if not groupName in shortWhiteList:
shortWhiteList.append(groupName)
except Exception as e:
ui.notifications.error('Unable to retreive whitelist short name from AniDB.')
if not groupName in shortWhiteList: if not groupName in shortWhiteList:
shortWhiteList.append(groupName) shortWhiteList.append(groupName)
else: else:
@ -1351,11 +1356,16 @@ class Home(WebRoot):
shortBlacklist = [] shortBlacklist = []
if helpers.set_up_anidb_connection(): if helpers.set_up_anidb_connection():
for groupName in blacklist: for groupName in blacklist:
group = sickbeard.ADBA_CONNECTION.group(gname=groupName) try:
for line in group.datalines: group = sickbeard.ADBA_CONNECTION.group(gname=groupName)
if line["shortname"]: for line in group.datalines:
shortBlacklist.append(line["shortname"]) if line["shortname"]:
else: shortBlacklist.append(line["shortname"])
else:
if not groupName in shortBlacklist:
shortBlacklist.append(groupName)
except Exception as e:
ui.notifications.error('Unable to retreive blacklist short name from AniDB.')
if not groupName in shortBlacklist: if not groupName in shortBlacklist:
shortBlacklist.append(groupName) shortBlacklist.append(groupName)
else: else: