@@ -435,7 +435,7 @@ def __list_files(_fileitem: schemas.FileItem):
435435 """
436436 列出下级文件
437437 """
438- return storagechain .list_files (fileitem = _fileitem )
438+ return storagechain .list_files (fileitem = _fileitem ) or []
439439
440440 def __save_file (_fileitem : schemas .FileItem , _path : Path , _content : Union [bytes , str ]):
441441 """
@@ -668,7 +668,7 @@ def __download_and_save_image(_fileitem: schemas.FileItem, _path: Path, _url: st
668668 if (
669669 file .type == "dir"
670670 and file .name not in settings .RENAME_FORMAT_S0_NAMES
671- and not file .name . lower (). startswith ( "season" )
671+ and MetaInfo ( file .name ). begin_season is None
672672 ):
673673 # 电视剧不处理非季子目录
674674 continue
@@ -689,9 +689,13 @@ def __download_and_save_image(_fileitem: schemas.FileItem, _path: Path, _url: st
689689 if filepath .name in settings .RENAME_FORMAT_S0_NAMES :
690690 season_meta .begin_season = 0
691691 elif season_meta .name and season_meta .begin_season is not None :
692- # 当前目录含有非季目录的名称,但却有季信息(通常是被辅助识别词指定了)
693- # 这种情况应该是剧集根目录,不能按季目录刮削,否则会导致`season_poster`的路径错误 详见issue#5373
694- season_meta .begin_season = None
692+ # 目录含剧名且包含季号,需排除辅助词重新识别元数据,避免误判根目录 (issue 5501)
693+ season_meta_no_custom = MetaInfo (
694+ filepath .name , custom_words = ["#" ]
695+ )
696+ if season_meta_no_custom .begin_season is None :
697+ # 季号是由辅助词指定的,按剧集根目录处理,避免`season_poster`路径错误 (issue 5373)
698+ season_meta .begin_season = None
695699 if season_meta .begin_season is not None :
696700 # 检查季NFO开关
697701 if scraping_switchs .get ('season_nfo' , True ):
@@ -812,6 +816,8 @@ def __download_and_save_image(_fileitem: schemas.FileItem, _path: Path, _url: st
812816 logger .info (f"已存在图片文件:{ image_path } " )
813817 else :
814818 logger .info (f"电视剧图片刮削已关闭,跳过:{ image_name } " )
819+ else :
820+ logger .warn ("无法识别元数据,跳过" )
815821 logger .info (f"{ filepath .name } 刮削完成" )
816822
817823 async def async_recognize_by_meta (self , metainfo : MetaBase ,
0 commit comments