From 54194303692c6f16241203f1197f370bef9b57f2 Mon Sep 17 00:00:00 2001 From: mrjvs Date: Wed, 22 Mar 2023 22:31:23 +0100 Subject: [PATCH] fix pokemon error --- src/backend/metadata/justwatch.ts | 4 ++-- src/backend/metadata/types.ts | 2 +- src/components/media/MediaCard.tsx | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/backend/metadata/justwatch.ts b/src/backend/metadata/justwatch.ts index b3ef32f7..5c79c1e3 100644 --- a/src/backend/metadata/justwatch.ts +++ b/src/backend/metadata/justwatch.ts @@ -21,7 +21,7 @@ export type JWMediaResult = { title: string; poster?: string; id: number; - original_release_year: number; + original_release_year?: number; jw_entity_id: string; object_type: JWContentTypes; seasons?: JWSeasonShort[]; @@ -67,7 +67,7 @@ export function formatJWMeta( return { title: media.title, id: media.id.toString(), - year: media.original_release_year.toString(), + year: media.original_release_year?.toString(), poster: media.poster ? `${JW_IMAGE_BASE}${media.poster.replace("{profile}", "s166")}` : undefined, diff --git a/src/backend/metadata/types.ts b/src/backend/metadata/types.ts index 66bb9c1a..2723fbe7 100644 --- a/src/backend/metadata/types.ts +++ b/src/backend/metadata/types.ts @@ -24,7 +24,7 @@ export type MWSeasonWithEpisodeMeta = { type MWMediaMetaBase = { title: string; id: string; - year: string; + year?: string; poster?: string; }; diff --git a/src/components/media/MediaCard.tsx b/src/components/media/MediaCard.tsx index ca7ad96f..a2e331d4 100644 --- a/src/components/media/MediaCard.tsx +++ b/src/components/media/MediaCard.tsx @@ -33,6 +33,9 @@ function MediaCardContent({ const canLink = linkable && !closable; + const dotListContent = [t(`media.${media.type}`)]; + if (media.year) dotListContent.push(media.year); + return (
{media.title} - +
);