From fc881333cc71eef653c7c48a964ca43e757bf8ae Mon Sep 17 00:00:00 2001 From: runoob Date: Sun, 14 Jan 2024 21:11:20 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20nfo=E6=96=87=E4=BB=B6=E5=86=99=E5=85=A5?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A9=BA=E6=A0=BC=EF=BC=9B=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=BC=94=E5=91=98=E5=86=99=E5=85=A5nfo?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/core/nfo.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/models/core/nfo.py b/src/models/core/nfo.py index a272e4b..3084b7a 100644 --- a/src/models/core/nfo.py +++ b/src/models/core/nfo.py @@ -81,8 +81,10 @@ def write_nfo(json_data, nfo_new_path, folder_new_path, file_path, edit_mode=Fal nfo_title = config.naming_media if not number: number = title + #默认emby视频标题配置为 [number title],国产重复时需去掉一个,去重需注意空格也应一起去掉,否则国产的nfo标题中会多一个空格 + #读取nfo title信息会去掉前面的number和空格以保留title展示出来,同时number和标题一致时,去掉number的逻辑变成去掉整个标题导致读取失败,见424行 if number == title and 'number' in nfo_title and 'title' in nfo_title: - nfo_title = nfo_title.replace('originaltitle', '').replace('title', '') + nfo_title = nfo_title.replace('originaltitle', '').replace('title', '').strip() first_letter = get_number_first_letter(number) # 处理演员 @@ -204,20 +206,22 @@ def write_nfo(json_data, nfo_new_path, folder_new_path, file_path, edit_mode=Fal # 输出国家 if 'country,' in nfo_include_new: print(f" {country}", file=code) - + + #初始化 actor_list + actor_list = [] # 输出男女演员 if 'actor_all,' in nfo_include_new: actor = all_actor # 有演员时输出演员 - if 'actor,' in nfo_include_new and actor and actor not in ['未知演员','未知演員']: + if 'actor,' in nfo_include_new and actor: actor_list = actor.split(',') # 字符串转列表 actor_list = [actor.strip() for actor in actor_list if actor.strip()] # 去除空白 # 无演员时输出演员 以文件命名设置中未知演员设置项为演员名,默认设置和空值不写入NFO - elif not actor_list and config.actor_no_name not in ["未知演员",'未知演員','']: + elif 'actor,' in nfo_include_new and config.actor_no_name not in ["未知演员",'未知演員','']: actor = config.actor_no_name actor_list = actor.split(',') # 字符串转列表 actor_list = [actor.strip() for actor in actor_list if actor.strip()] # 去除空白 - signal.add_log(f'⛑️ 无演员名, 使用手动设置项 🛠未知演员 写入NFO {config.actor_no_name}') + signal.add_log(f'⛑️ 无演员名, 使用手动命名 写入NFO {config.actor_no_name}') if actor_list: for each in actor_list: print(" ", file=code)