mirror of
https://github.com/moparisthebest/SickRage
synced 2024-11-17 23:05:11 -05:00
Skip anidb query if previously failed
This commit is contained in:
parent
a5de329edb
commit
f04a3449ec
@ -1227,6 +1227,7 @@ class Home(WebRoot):
|
|||||||
rls_require_words=None, anime=None, blackWords=None, whiteWords=None, blacklist=None, whitelist=None,
|
rls_require_words=None, anime=None, blackWords=None, whiteWords=None, blacklist=None, whitelist=None,
|
||||||
scene=None, defaultEpStatus=None):
|
scene=None, defaultEpStatus=None):
|
||||||
|
|
||||||
|
anidb_failed = False
|
||||||
if show is None:
|
if show is None:
|
||||||
errString = "Invalid show ID: " + str(show)
|
errString = "Invalid show ID: " + str(show)
|
||||||
if directCall:
|
if directCall:
|
||||||
@ -1269,11 +1270,12 @@ class Home(WebRoot):
|
|||||||
t.blacklist = bwl.blackDict["release_group"]
|
t.blacklist = bwl.blackDict["release_group"]
|
||||||
|
|
||||||
t.groups = []
|
t.groups = []
|
||||||
if helpers.set_up_anidb_connection():
|
if helpers.set_up_anidb_connection() and not anidb_failed:
|
||||||
try:
|
try:
|
||||||
anime = adba.Anime(sickbeard.ADBA_CONNECTION, name=showObj.name)
|
anime = adba.Anime(sickbeard.ADBA_CONNECTION, name=showObj.name)
|
||||||
t.groups = anime.get_groups()
|
t.groups = anime.get_groups()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
anidb_failed = True
|
||||||
ui.notifications.error('Unable to retreive Fansub Groups from AniDB.')
|
ui.notifications.error('Unable to retreive Fansub Groups from AniDB.')
|
||||||
|
|
||||||
with showObj.lock:
|
with showObj.lock:
|
||||||
@ -1331,9 +1333,9 @@ class Home(WebRoot):
|
|||||||
if whitelist:
|
if whitelist:
|
||||||
whitelist = whitelist.split(",")
|
whitelist = whitelist.split(",")
|
||||||
shortWhiteList = []
|
shortWhiteList = []
|
||||||
if helpers.set_up_anidb_connection():
|
if helpers.set_up_anidb_connection() and not anidb_failed:
|
||||||
for groupName in whitelist:
|
|
||||||
try:
|
try:
|
||||||
|
for groupName in whitelist:
|
||||||
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"]:
|
||||||
@ -1342,9 +1344,9 @@ class Home(WebRoot):
|
|||||||
if not groupName in shortWhiteList:
|
if not groupName in shortWhiteList:
|
||||||
shortWhiteList.append(groupName)
|
shortWhiteList.append(groupName)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
ui.notifications.error('Unable to retreive whitelist short name from AniDB.')
|
anidb_failed = True
|
||||||
if not groupName in shortWhiteList:
|
ui.notifications.error('Unable to retreive data from AniDB.')
|
||||||
shortWhiteList.append(groupName)
|
shortWhiteList = whitelist
|
||||||
else:
|
else:
|
||||||
shortWhiteList = whitelist
|
shortWhiteList = whitelist
|
||||||
bwl.set_white_keywords_for("release_group", shortWhiteList)
|
bwl.set_white_keywords_for("release_group", shortWhiteList)
|
||||||
@ -1354,9 +1356,9 @@ class Home(WebRoot):
|
|||||||
if blacklist:
|
if blacklist:
|
||||||
blacklist = blacklist.split(",")
|
blacklist = blacklist.split(",")
|
||||||
shortBlacklist = []
|
shortBlacklist = []
|
||||||
if helpers.set_up_anidb_connection():
|
if helpers.set_up_anidb_connection() and not anidb_failed:
|
||||||
for groupName in blacklist:
|
|
||||||
try:
|
try:
|
||||||
|
for groupName in blacklist:
|
||||||
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"]:
|
||||||
@ -1365,9 +1367,9 @@ class Home(WebRoot):
|
|||||||
if not groupName in shortBlacklist:
|
if not groupName in shortBlacklist:
|
||||||
shortBlacklist.append(groupName)
|
shortBlacklist.append(groupName)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
anidb_failed = True
|
||||||
ui.notifications.error('Unable to retreive blacklist short name from AniDB.')
|
ui.notifications.error('Unable to retreive blacklist short name from AniDB.')
|
||||||
if not groupName in shortBlacklist:
|
shortBlacklist = blacklist
|
||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user