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

@@ -143,6 +143,21 @@ class TheTvDbModule(_ModuleBase):
logger.error(f"获取TVDB信息失败: {str(err)}")
return None
def tvdb_slug(self, tvdbid: int) -> Optional[str]:
"""
获取TVDB剧集的 slug别名用于构建 TheTvDb 直达链接。
:param tvdbid: int
:return: slug 字符串,如 "speed-and-love"
"""
try:
result = self._handle_tvdb_call("get_series", tvdbid)
if result and isinstance(result, dict):
return result.get("slug")
return None
except Exception as err:
logger.error(f"获取TVDB slug 失败: {str(err)}")
return None
def search_tvdb(self, title: str) -> list:
"""
用标题搜索TVDB剧集