Browse Source

fix pokemon error

pull/218/head
mrjvs 2 years ago
parent
commit
5419430369
  1. 4
      src/backend/metadata/justwatch.ts
  2. 2
      src/backend/metadata/types.ts
  3. 8
      src/components/media/MediaCard.tsx

4
src/backend/metadata/justwatch.ts

@ -21,7 +21,7 @@ export type JWMediaResult = { @@ -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( @@ -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,

2
src/backend/metadata/types.ts

@ -24,7 +24,7 @@ export type MWSeasonWithEpisodeMeta = { @@ -24,7 +24,7 @@ export type MWSeasonWithEpisodeMeta = {
type MWMediaMetaBase = {
title: string;
id: string;
year: string;
year?: string;
poster?: string;
};

8
src/components/media/MediaCard.tsx

@ -33,6 +33,9 @@ function MediaCardContent({ @@ -33,6 +33,9 @@ function MediaCardContent({
const canLink = linkable && !closable;
const dotListContent = [t(`media.${media.type}`)];
if (media.year) dotListContent.push(media.year);
return (
<div
className={`group -m-3 mb-2 rounded-xl bg-denim-300 bg-opacity-0 transition-colors duration-100 ${
@ -115,10 +118,7 @@ function MediaCardContent({ @@ -115,10 +118,7 @@ function MediaCardContent({
<h1 className="mb-1 max-h-[4.5rem] text-ellipsis break-words font-bold text-white line-clamp-3">
<span>{media.title}</span>
</h1>
<DotList
className="text-xs"
content={[t(`media.${media.type}`), media.year]}
/>
<DotList className="text-xs" content={dotListContent} />
</article>
</div>
);

Loading…
Cancel
Save