From 119919da51d50803b2569610d8bfdbc44fe3d328 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 24 Oct 2024 09:56:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E9=99=84=E5=B1=9E=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=95=B4=E7=90=86=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/modules/filemanager/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/modules/filemanager/__init__.py b/app/modules/filemanager/__init__.py index efd6ee9a..4f099087 100644 --- a/app/modules/filemanager/__init__.py +++ b/app/modules/filemanager/__init__.py @@ -578,6 +578,8 @@ class FileManagerModule(_ModuleBase): # 识别文件名 metainfo = MetaInfoPath(org_path) for sub_item in file_list: + if sub_item.type == "dir" or not sub_item.extension: + continue if f".{sub_item.extension.lower()}" not in settings.RMT_SUBEXT: continue # 识别字幕文件名 @@ -665,7 +667,9 @@ class FileManagerModule(_ModuleBase): return False, f"{org_path} 上级目录获取失败" file_list: List[FileItem] = storage_oper.list(parent_item) # 匹配音轨文件 - pending_file_list: List[FileItem] = [file for file in file_list if Path(file.name).stem == org_path.name + pending_file_list: List[FileItem] = [file for file in file_list + if Path(file.name).stem == org_path.name + and file.type == "file" and file.extension and f".{file.extension.lower()}" in settings.RMT_AUDIOEXT] if len(pending_file_list) == 0: return True, f"{parent_item.path} 目录下没有找到匹配的音轨文件"