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,6 +1333,7 @@ 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:
try:
group = sickbeard.ADBA_CONNECTION.group(gname=groupName) group = sickbeard.ADBA_CONNECTION.group(gname=groupName)
for line in group.datalines: for line in group.datalines:
if line["shortname"]: if line["shortname"]:
@ -1340,6 +1341,10 @@ class Home(WebRoot):
else: else:
if not groupName in shortWhiteList: if not groupName in shortWhiteList:
shortWhiteList.append(groupName) shortWhiteList.append(groupName)
except Exception as e:
ui.notifications.error('Unable to retreive whitelist short name from AniDB.')
if not groupName in shortWhiteList:
shortWhiteList.append(groupName)
else: else:
shortWhiteList = whitelist shortWhiteList = whitelist
bwl.set_white_keywords_for("release_group", shortWhiteList) bwl.set_white_keywords_for("release_group", shortWhiteList)
@ -1351,6 +1356,7 @@ 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:
try:
group = sickbeard.ADBA_CONNECTION.group(gname=groupName) group = sickbeard.ADBA_CONNECTION.group(gname=groupName)
for line in group.datalines: for line in group.datalines:
if line["shortname"]: if line["shortname"]:
@ -1358,6 +1364,10 @@ class Home(WebRoot):
else: else:
if not groupName in shortBlacklist: if not groupName in shortBlacklist:
shortBlacklist.append(groupName) shortBlacklist.append(groupName)
except Exception as e:
ui.notifications.error('Unable to retreive blacklist short name from AniDB.')
if not groupName in shortBlacklist:
shortBlacklist.append(groupName)
else: else:
shortBlacklist = blacklist shortBlacklist = blacklist
bwl.set_black_keywords_for("release_group", shortBlacklist) bwl.set_black_keywords_for("release_group", shortBlacklist)