fix(media): restore legacy discover detail fallback

This commit is contained in:
jxxghp
2026-08-05 07:27:44 +08:00
parent a700ba9379
commit 7a2b003d02
2 changed files with 132 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ from app.db.user_oper import get_current_active_user, get_current_active_superus
from app.schemas import MediaType, MediaRecognizeConvertEventData
from app.schemas.category import CategoryConfig
from app.schemas.types import ChainEventType
from app.utils.media import parse_media_key
from app.utils.media import MEDIA_SOURCE_ID_FIELDS, parse_media_key
router = APIRouter()
MediaSource = str
@@ -414,8 +414,10 @@ async def detail(
mediaid=source_media_id,
mtype=mtype,
)
else:
# 广播事件解析媒体信息
if not mediainfo and (
not media_source or media_source not in MEDIA_SOURCE_ID_FIELDS
):
# 旧探索插件可能只提供列表或转换事件,原生 ID 直识别失败后需保留原有兼容链路。
event_data = MediaRecognizeConvertEventData(
mediaid=mediaid, convert_type=settings.RECOGNIZE_SOURCE
)
@@ -432,7 +434,7 @@ async def detail(
mediaid=str(new_id),
mtype=mtype,
)
elif title:
if not mediainfo and title:
# 使用名称识别兜底
meta = MetaInfo(title)
if year: