From 26af362e57b0ac4dc179633c8082e60b5b6f327e Mon Sep 17 00:00:00 2001 From: sqzw-x Date: Wed, 20 Mar 2024 17:45:40 +0800 Subject: [PATCH] fix: write unknown actor to nfo (close #151) --- src/models/core/nfo.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/models/core/nfo.py b/src/models/core/nfo.py index c6b2603..e87ff08 100644 --- a/src/models/core/nfo.py +++ b/src/models/core/nfo.py @@ -213,15 +213,11 @@ def write_nfo(json_data, nfo_new_path, folder_new_path, file_path, edit_mode=Fal if 'actor_all,' in nfo_include_new: actor = all_actor # 有演员时输出演员 - if 'actor,' in nfo_include_new and actor: + if 'actor,' in nfo_include_new: + if not actor: + actor = config.actor_no_name actor_list = actor.split(',') # 字符串转列表 actor_list = [actor.strip() for actor in actor_list if actor.strip()] # 去除空白 - # 无演员时输出演员 以文件命名设置中未知演员设置项为演员名,默认设置和空值不写入NFO - 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}') if actor_list: for each in actor_list: print(" ", file=code)