From 6992284a7777d6d764d055554c006a735d088528 Mon Sep 17 00:00:00 2001 From: Attente <19653207+wikrin@users.noreply.github.com> Date: Fri, 29 Nov 2024 07:25:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(api):=20=E4=BF=AE=E5=A4=8D=E8=A7=84?= =?UTF-8?q?=E5=88=99=E6=B5=8B=E8=AF=95=E6=9C=AA=E8=8E=B7=E5=8F=96=E5=88=B0?= =?UTF-8?q?=E5=AA=92=E4=BD=93=E4=BF=A1=E6=81=AF=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/endpoints/system.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/api/endpoints/system.py b/app/api/endpoints/system.py index 62776774..7fcd2b6a 100644 --- a/app/api/endpoints/system.py +++ b/app/api/endpoints/system.py @@ -16,6 +16,7 @@ from app import schemas from app.chain.search import SearchChain from app.chain.system import SystemChain from app.core.config import global_vars, settings +from app.core.metainfo import MetaInfo from app.core.module import ModuleManager from app.core.security import verify_apitoken, verify_resource_token, verify_token from app.db.models import User @@ -385,9 +386,12 @@ def ruletest(title: str, if not rulegroup: return schemas.Response(success=False, message=f"过滤规则组 {rulegroup_name} 不存在!") + # 根据标题查询媒体信息 + media_info =SearchChain().recognize_media(MetaInfo(title=title, subtitle=subtitle)) + # 过滤 result = SearchChain().filter_torrents(rule_groups=[rulegroup.name], - torrent_list=[torrent]) + torrent_list=[torrent],mediainfo=media_info) if not result: return schemas.Response(success=False, message="不符合过滤规则!") return schemas.Response(success=True, data={ From 76643f13ed25408277ad4b1b13b1478ae32cb0d3 Mon Sep 17 00:00:00 2001 From: Attente <19653207+wikrin@users.noreply.github.com> Date: Fri, 29 Nov 2024 07:33:02 +0800 Subject: [PATCH 2/2] Update system.py --- app/api/endpoints/system.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/endpoints/system.py b/app/api/endpoints/system.py index 7fcd2b6a..a7e1ddb3 100644 --- a/app/api/endpoints/system.py +++ b/app/api/endpoints/system.py @@ -391,7 +391,7 @@ def ruletest(title: str, # 过滤 result = SearchChain().filter_torrents(rule_groups=[rulegroup.name], - torrent_list=[torrent],mediainfo=media_info) + torrent_list=[torrent], mediainfo=media_info) if not result: return schemas.Response(success=False, message="不符合过滤规则!") return schemas.Response(success=True, data={