From 5e538256844c2b15e51ad63297f39fb022ced1d4 Mon Sep 17 00:00:00 2001 From: thsrite Date: Wed, 30 Oct 2024 16:20:37 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=A2=9E=E5=8A=A0=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E6=9C=AC=E5=9C=B0=E5=AA=92=E4=BD=93=E5=BA=93?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=E8=B5=84=E6=BA=90=E5=BC=80?= =?UTF-8?q?=E5=85=B3=EF=BC=8C=E6=8C=89=E9=9C=80=E5=BC=80=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/core/config.py | 2 ++ app/modules/filemanager/__init__.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/app/core/config.py b/app/core/config.py index c1805cbb..cd6af6be 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -145,6 +145,8 @@ class ConfigModel(BaseModel): SUBSCRIBE_STATISTIC_SHARE: bool = True # 订阅搜索开关 SUBSCRIBE_SEARCH: bool = False + # 检查本地媒体库是否存在资源开关 + LOCAL_EXISTS_SEARCH: bool = False # 搜索多个名称 SEARCH_MULTIPLE_NAME: bool = False # 站点数据刷新间隔(小时) diff --git a/app/modules/filemanager/__init__.py b/app/modules/filemanager/__init__.py index e2387576..7d930658 100644 --- a/app/modules/filemanager/__init__.py +++ b/app/modules/filemanager/__init__.py @@ -1173,6 +1173,9 @@ class FileManagerModule(_ModuleBase): :param mediainfo: 识别的媒体信息 :return: 如不存在返回None,存在时返回信息,包括每季已存在所有集{type: movie/tv, seasons: {season: [episodes]}} """ + if not settings.LOCAL_EXISTS_SEARCH: + return None + # 检查媒体库 fileitems = self.media_files(mediainfo) if not fileitems: