增加direct是否写入nfo文件配置

This commit is contained in:
todoXu
2023-09-02 03:24:19 +08:00
parent bea12db8bb
commit fbc741521d
3 changed files with 12 additions and 1 deletions

View File

@@ -151,3 +151,6 @@ multi_part_fanart = 0
[actor_photo] [actor_photo]
download_for_kodi = 0 download_for_kodi = 0
[direct]
switch = 1

View File

@@ -373,6 +373,9 @@ class Config:
def debug(self) -> bool: def debug(self) -> bool:
return self.conf.getboolean("debug_mode", "switch") return self.conf.getboolean("debug_mode", "switch")
def get_direct(self) -> bool:
return self.conf.getboolean("direct", "switch")
def is_storyline(self) -> bool: def is_storyline(self) -> bool:
try: try:
return self.conf.getboolean("storyline", "switch") return self.conf.getboolean("storyline", "switch")

View File

@@ -314,6 +314,8 @@ def image_download(cover, fanart_path, thumb_path, path, filepath, json_headers=
def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, filepath, tag, actor_list, liuchu, def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, filepath, tag, actor_list, liuchu,
uncensored, hack, hack_word, _4k, fanart_path, poster_path, thumb_path, iso): uncensored, hack, hack_word, _4k, fanart_path, poster_path, thumb_path, iso):
conf = config.getInstance()
title, studio, year, outline, runtime, director, actor_photo, release, number, cover, trailer, website, series, label = get_info( title, studio, year, outline, runtime, director, actor_photo, release, number, cover, trailer, website, series, label = get_info(
json_data) json_data)
if config.getInstance().main_mode() == 3: # 模式3下由于视频文件不做任何改变.nfo文件必须和视频文件名称除后缀外完全一致KODI等软件方可支持 if config.getInstance().main_mode() == 3: # 模式3下由于视频文件不做任何改变.nfo文件必须和视频文件名称除后缀外完全一致KODI等软件方可支持
@@ -369,7 +371,10 @@ def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, f
print(" <outline>" + outline + "</outline>", file=code) print(" <outline>" + outline + "</outline>", file=code)
print(" <plot>" + outline + "</plot>", file=code) print(" <plot>" + outline + "</plot>", file=code)
print(" <runtime>" + str(runtime).replace(" ", "") + "</runtime>", file=code) print(" <runtime>" + str(runtime).replace(" ", "") + "</runtime>", file=code)
print(" <director>" + director + "</director>", file=code)
if False != conf.get_direct():
print(" <director>" + director + "</director>", file=code)
print(" <poster>" + poster_path + "</poster>", file=code) print(" <poster>" + poster_path + "</poster>", file=code)
print(" <thumb>" + thumb_path + "</thumb>", file=code) print(" <thumb>" + thumb_path + "</thumb>", file=code)
if not config.getInstance().jellyfin(): # jellyfin 不需要保存fanart if not config.getInstance().jellyfin(): # jellyfin 不需要保存fanart