添加可选的翻译功能
This commit is contained in:
12
core.py
12
core.py
@@ -207,10 +207,20 @@ def get_data_from_json(file_number, filepath, conf: config.Config): # 从JSON
|
||||
json_data['release'] = release
|
||||
json_data['cover_small'] = cover_small
|
||||
json_data['tag'] = tag
|
||||
json_data['naming_rule'] = eval(conf.naming_rule())
|
||||
json_data['location_rule'] = location_rule
|
||||
json_data['year'] = year
|
||||
json_data['actor_list'] = actor_list
|
||||
if conf.is_transalte():
|
||||
translate_values = conf.transalte_values().split(",")
|
||||
for translate_value in translate_values:
|
||||
json_data[translate_value] = translate(json_data[translate_value])
|
||||
naming_rule=""
|
||||
for i in conf.naming_rule().split("+"):
|
||||
if i not in json_data:
|
||||
naming_rule+=i.strip("'").strip('"')
|
||||
else:
|
||||
naming_rule+=json_data[i]
|
||||
json_data['naming_rule'] = naming_rule
|
||||
return json_data
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user