feat(media): 媒体信息补充 TVDB slug 字段,修复 TheTvDb 数字 ID 链接 404

TVDB 已弃用数字 ID 直达 URL,仅 slug 形式可访问。详情接口在电视剧有 TVDB ID 时通过轻量 get_series 接口获取 slug,并随 MediaInfo 合并下发。Closes jxxghp/MoviePilot-Frontend#643
This commit is contained in:
jxxghp
2026-08-10 21:41:04 +08:00
parent 4a14af706c
commit a322c4c375
6 changed files with 38 additions and 1 deletions

View File

@@ -521,6 +521,11 @@ async def detail(
# 识别
if mediainfo:
await mediachain.async_obtain_images(mediainfo)
# 电视剧且有 TVDB ID 时,补充获取 slug 用于构建 TheTvDb 直达链接
if mediainfo.type == MediaType.TV and mediainfo.tvdb_id and not mediainfo.tvdb_slug:
slug = mediachain.tvdb_slug(mediainfo.tvdb_id)
if slug:
mediainfo.tvdb_slug = slug
return mediainfo.to_dict()
return schemas.MediaInfo()