fix pokemon error

This commit is contained in:
mrjvs 2023-03-22 22:31:23 +01:00
parent 731ef6a9aa
commit 5419430369
3 changed files with 7 additions and 7 deletions

View file

@ -21,7 +21,7 @@ export type JWMediaResult = {
title: string; title: string;
poster?: string; poster?: string;
id: number; id: number;
original_release_year: number; original_release_year?: number;
jw_entity_id: string; jw_entity_id: string;
object_type: JWContentTypes; object_type: JWContentTypes;
seasons?: JWSeasonShort[]; seasons?: JWSeasonShort[];
@ -67,7 +67,7 @@ export function formatJWMeta(
return { return {
title: media.title, title: media.title,
id: media.id.toString(), id: media.id.toString(),
year: media.original_release_year.toString(), year: media.original_release_year?.toString(),
poster: media.poster poster: media.poster
? `${JW_IMAGE_BASE}${media.poster.replace("{profile}", "s166")}` ? `${JW_IMAGE_BASE}${media.poster.replace("{profile}", "s166")}`
: undefined, : undefined,

View file

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

View file

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