From 4a99e2896f41ba399bc6f6abaaf3a01b86c8457e Mon Sep 17 00:00:00 2001 From: REinject <22788893+0xlane@users.noreply.github.com> Date: Sat, 29 Nov 2025 22:12:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=97=B6=E5=A2=9E=E5=8A=A0=E8=BE=85=E5=8A=A9?= =?UTF-8?q?=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/endpoints/download.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/api/endpoints/download.py b/app/api/endpoints/download.py index 5eb6a4c5..23a137dc 100644 --- a/app/api/endpoints/download.py +++ b/app/api/endpoints/download.py @@ -6,12 +6,13 @@ from app import schemas from app.chain.download import DownloadChain from app.chain.media import MediaChain from app.core.context import MediaInfo, Context, TorrentInfo +from app.core.event import eventmanager from app.core.metainfo import MetaInfo from app.core.security import verify_token from app.db.models.user import User from app.db.systemconfig_oper import SystemConfigOper from app.db.user_oper import get_current_active_user -from app.schemas.types import SystemConfigKey +from app.schemas.types import ChainEventType, SystemConfigKey router = APIRouter() @@ -77,7 +78,11 @@ def add( # 媒体信息 mediainfo = MediaChain().recognize_media(meta=metainfo, tmdbid=tmdbid, doubanid=doubanid) if not mediainfo: - return schemas.Response(success=False, message="无法识别媒体信息") + # 尝试使用辅助识别,如果有注册响应事件的话 + if eventmanager.check(ChainEventType.NameRecognize): + mediainfo = MediaChain().recognize_help(title=torrent_in.title, org_meta=metainfo) + if not mediainfo: + return schemas.Response(success=False, message="无法识别媒体信息") # 种子信息 torrentinfo = TorrentInfo() torrentinfo.from_dict(torrent_in.model_dump())