mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-26 19:01:51 +01:00
re-add tmdbId
This commit is contained in:
parent
bb869fd7e3
commit
fa36493c50
@ -4,6 +4,7 @@ import { MWMediaType } from "@/backend/metadata/types";
|
||||
export const testData: DetailedMeta[] = [
|
||||
{
|
||||
imdbId: "tt10954562",
|
||||
tmdbId: "572716",
|
||||
meta: {
|
||||
id: "439596",
|
||||
title: "Hamilton",
|
||||
@ -14,6 +15,7 @@ export const testData: DetailedMeta[] = [
|
||||
},
|
||||
{
|
||||
imdbId: "tt11126994",
|
||||
tmdbId: "94605",
|
||||
meta: {
|
||||
id: "222333",
|
||||
title: "Arcane",
|
||||
|
@ -30,6 +30,7 @@ interface JWDetailedMeta extends JWMediaResult {
|
||||
export interface DetailedMeta {
|
||||
meta: MWMediaMeta;
|
||||
imdbId?: string;
|
||||
tmdbId?: string;
|
||||
}
|
||||
|
||||
export async function getMetaFromId(
|
||||
@ -60,6 +61,12 @@ export async function getMetaFromId(
|
||||
if (!imdbId)
|
||||
imdbId = data.external_ids.find((v) => v.provider === "imdb")?.external_id;
|
||||
|
||||
let tmdbId = data.external_ids.find(
|
||||
(v) => v.provider === "tmdb_latest"
|
||||
)?.external_id;
|
||||
if (!tmdbId)
|
||||
tmdbId = data.external_ids.find((v) => v.provider === "tmdb")?.external_id;
|
||||
|
||||
let seasonData: JWSeasonMetaResult | undefined;
|
||||
if (data.object_type === "show") {
|
||||
const seasonToScrape = seasonId ?? data.seasons?.[0].id.toString() ?? "";
|
||||
@ -72,5 +79,6 @@ export async function getMetaFromId(
|
||||
return {
|
||||
meta: formatJWMeta(data, seasonData),
|
||||
imdbId,
|
||||
tmdbId,
|
||||
};
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ const testData: VideoData = {
|
||||
};
|
||||
const testMeta: DetailedMeta = {
|
||||
imdbId: "",
|
||||
tmdbId: "",
|
||||
meta: {
|
||||
id: "hello-world",
|
||||
title: "Big Buck Bunny",
|
||||
|
Loading…
Reference in New Issue
Block a user