Add max_title_len config

default value is 50
This commit is contained in:
Mathhew
2020-09-25 11:49:15 +08:00
parent 0f16ddc198
commit cc2d44b728
2 changed files with 13 additions and 2 deletions

View File

@@ -196,8 +196,9 @@ def get_data_from_json(file_number, filepath, conf: config.Config): # 从JSON
if 'actor' in conf.location_rule() and len(actor) > 100:
print(conf.location_rule())
location_rule = eval(conf.location_rule().replace("actor","'多人作品'"))
if 'title' in conf.location_rule() and len(title) > 100:
shorttitle = title[0:100]
maxlen = conf.max_title_len()
if 'title' in conf.location_rule() and len(title) > maxlen:
shorttitle = title[0:maxlen]
location_rule = location_rule.replace(title, shorttitle)
# 返回处理后的json_data