Update api.py #1033
更新“无演员自动填充佚名”功能中对目标语言的判断条件,添加符合DeepLX的目标语言“ZH”,修正原代码在使用DeepLX翻译到中文时将无演员的情况填充为Anonymous的问题
This commit is contained in:
@@ -107,7 +107,7 @@ class Scraping:
|
|||||||
# If actor is anonymous, Fill in Anonymous
|
# If actor is anonymous, Fill in Anonymous
|
||||||
if len(json_data['actor']) == 0:
|
if len(json_data['actor']) == 0:
|
||||||
if config.getInstance().anonymous_fill() == True:
|
if config.getInstance().anonymous_fill() == True:
|
||||||
if "zh_" in config.getInstance().get_target_language():
|
if "zh_" in config.getInstance().get_target_language() or "ZH" in config.getInstance().get_target_language():
|
||||||
json_data['actor'] = "佚名"
|
json_data['actor'] = "佚名"
|
||||||
else:
|
else:
|
||||||
json_data['actor'] = "Anonymous"
|
json_data['actor'] = "Anonymous"
|
||||||
@@ -167,7 +167,7 @@ class Scraping:
|
|||||||
# If actor is anonymous, Fill in Anonymous
|
# If actor is anonymous, Fill in Anonymous
|
||||||
if len(json_data['actor']) == 0:
|
if len(json_data['actor']) == 0:
|
||||||
if config.getInstance().anonymous_fill() == True:
|
if config.getInstance().anonymous_fill() == True:
|
||||||
if "zh_" in config.getInstance().get_target_language():
|
if "zh_" in config.getInstance().get_target_language() or "ZH" in config.getInstance().get_target_language():
|
||||||
json_data['actor'] = "佚名"
|
json_data['actor'] = "佚名"
|
||||||
else:
|
else:
|
||||||
json_data['actor'] = "Anonymous"
|
json_data['actor'] = "Anonymous"
|
||||||
@@ -263,4 +263,4 @@ class Scraping:
|
|||||||
and (data["cover_small"] is None or data["cover_small"] == "" or
|
and (data["cover_small"] is None or data["cover_small"] == "" or
|
||||||
data["cover_small"] == "null"):
|
data["cover_small"] == "null"):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user