From 567522c87a51afc1a593cc14bcbcf07578040ea9 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 21 Jan 2026 17:59:18 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=BB=9F=E4=B8=80=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=96=87=E4=BB=B6=E7=B1=BB=E5=9E=8B=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/download.py | 5 +++-- app/core/meta/metavideo.py | 3 ++- app/core/metainfo.py | 3 ++- app/modules/filemanager/transhandler.py | 3 ++- app/monitor.py | 2 +- app/workflow/actions/scan_file.py | 3 ++- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/chain/download.py b/app/chain/download.py index 04855238..9da32917 100644 --- a/app/chain/download.py +++ b/app/chain/download.py @@ -332,9 +332,10 @@ class DownloadChain(ChainBase): if not file_meta.begin_episode \ or file_meta.begin_episode not in episodes: continue - # 只处理视频格式 + # 只处理音视频、字幕格式 + media_exts = settings.RMT_MEDIAEXT + settings.RMT_SUBEXT + settings.RMT_AUDIOEXT if not Path(file).suffix \ - or Path(file).suffix.lower() not in settings.RMT_MEDIAEXT: + or Path(file).suffix.lower() not in media_exts: continue files_to_add.append({ "download_hash": _hash, diff --git a/app/core/meta/metavideo.py b/app/core/meta/metavideo.py index c612cd74..541d1424 100644 --- a/app/core/meta/metavideo.py +++ b/app/core/meta/metavideo.py @@ -301,7 +301,8 @@ class MetaVideo(MetaBase): return else: # 后缀名不要 - if ".%s".lower() % token in settings.RMT_MEDIAEXT: + media_exts = settings.RMT_MEDIAEXT + settings.RMT_SUBEXT + settings.RMT_AUDIOEXT + if ".%s".lower() % token in media_exts: return # 英文或者英文+数字,拼装起来 if self.en_name: diff --git a/app/core/metainfo.py b/app/core/metainfo.py index ad4c3985..12ff758b 100644 --- a/app/core/metainfo.py +++ b/app/core/metainfo.py @@ -25,7 +25,8 @@ def MetaInfo(title: str, subtitle: Optional[str] = None, custom_words: List[str] # 获取标题中媒体信息 title, metainfo = find_metainfo(title) # 判断是否处理文件 - if title and Path(title).suffix.lower() in settings.RMT_MEDIAEXT: + media_exts = settings.RMT_MEDIAEXT + settings.RMT_SUBEXT + settings.RMT_AUDIOEXT + if title and Path(title).suffix.lower() in media_exts: isfile = True # 去掉后缀 title = Path(title).stem diff --git a/app/modules/filemanager/transhandler.py b/app/modules/filemanager/transhandler.py index c4f96597..7359a037 100644 --- a/app/modules/filemanager/transhandler.py +++ b/app/modules/filemanager/transhandler.py @@ -790,7 +790,8 @@ class TransHandler: continue if media_file.type != "file": continue - if f".{media_file.extension.lower()}" not in settings.RMT_MEDIAEXT: + media_exts = settings.RMT_MEDIAEXT + settings.RMT_SUBEXT + settings.RMT_AUDIOEXT + if f".{media_file.extension.lower()}" not in media_exts: continue # 识别文件中的季集信息 filemeta = MetaInfoPath(media_path) diff --git a/app/monitor.py b/app/monitor.py index b7ef3a72..0b893732 100644 --- a/app/monitor.py +++ b/app/monitor.py @@ -80,7 +80,7 @@ class Monitor(ConfigReloadMixin, metaclass=SingletonClass): # 快照文件缓存 self._snapshot_cache = FileCache(base=settings.CACHE_PATH / "snapshots") # 监控的文件扩展名 - self.all_exts = settings.RMT_MEDIAEXT + self.all_exts = settings.RMT_MEDIAEXT + settings.RMT_SUBEXT + settings.RMT_AUDIOEXT # 启动目录监控和文件整理 self.init() diff --git a/app/workflow/actions/scan_file.py b/app/workflow/actions/scan_file.py index c170ed74..eb64219e 100644 --- a/app/workflow/actions/scan_file.py +++ b/app/workflow/actions/scan_file.py @@ -65,7 +65,8 @@ class ScanFileAction(BaseAction): for file in files: if global_vars.is_workflow_stopped(workflow_id): break - if not file.extension or f".{file.extension.lower()}" not in settings.RMT_MEDIAEXT: + media_exts = settings.RMT_MEDIAEXT + settings.RMT_SUBEXT + settings.RMT_AUDIOEXT + if not file.extension or f".{file.extension.lower()}" not in media_exts: continue # 添加文件到队列,而不是目录 self._fileitems.append(file)