feat(web): MP-style media detail with seasons and episodes, shared by library and TMDB preview (MD-1)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-29 17:28:16 +08:00
1 parent 9cd5a28943
commit 97ac59c7ac
9 files changed
+1250 -190

No files matched your search

@@ -0,0 +1,23 @@
// 外部身份 → 外站链接(媒体详情头部):TMDB / IMDb / TVDB / Wikidata。只拼公开地址,不带任何凭证。
export function externalLinks(ids: {
tmdb?: { type: "movie" | "tv"; id: string } | null;
imdb?: string | null;
tvdb?: string | null;
wikidata?: string | null;
tvdbKind?: "movie" | "series";
}): { label: string; href: string }[] {
const out: { label: string; href: string }[] = [];
if (ids.tmdb && /^\d+$/.test(ids.tmdb.id))
out.push({ label: "TMDB", href: `https://www.themoviedb.org/${ids.tmdb.type}/${ids.tmdb.id}` });
if (ids.imdb && /^tt\d+$/.test(ids.imdb))
out.push({ label: "IMDb", href: `https://www.imdb.com/title/${ids.imdb}/` });
if (ids.tvdb && /^\d+$/.test(ids.tvdb))
out.push({
label: "TVDB",
href: `https://thetvdb.com/dereferrer/${ids.tvdbKind ?? (ids.tmdb?.type === "movie" ? "movie" : "series")}/${ids.tvdb}`,
});
if (ids.wikidata && /^Q\d+$/.test(ids.wikidata))
out.push({ label: "Wikidata", href: `https://www.wikidata.org/wiki/${ids.wikidata}` });
return out;
}