From 580d57cd756b9c4a0c00b33a3d439857cd0a7dd0 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 8 Dec 2020 13:56:08 +0800 Subject: [PATCH] Fix file name too long in Linux --- core.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/core.py b/core.py index fd55148..90a55c1 100755 --- a/core.py +++ b/core.py @@ -191,15 +191,13 @@ def get_data_from_json(file_number, filepath, conf: config.Config): # 从JSON location_rule = eval(conf.location_rule()) - # Process only Windows. - if platform.system() == "Windows": - if 'actor' in conf.location_rule() and len(actor) > 100: - print(conf.location_rule()) - location_rule = eval(conf.location_rule().replace("actor","'多人作品'")) - 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) + if 'actor' in conf.location_rule() and len(actor) > 100: + print(conf.location_rule()) + location_rule = eval(conf.location_rule().replace("actor","'多人作品'")) + 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 json_data['title'] = title