From c9bac3ed68f2688ceabbeaac68bb845443b551b7 Mon Sep 17 00:00:00 2001 From: castdrian Date: Thu, 15 Jun 2023 08:30:05 +0200 Subject: [PATCH] show poster in bookmarks --- src/backend/metadata/getmeta.ts | 8 ++++++-- src/components/media/MediaCard.tsx | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/backend/metadata/getmeta.ts b/src/backend/metadata/getmeta.ts index 41e67772..bba3948e 100644 --- a/src/backend/metadata/getmeta.ts +++ b/src/backend/metadata/getmeta.ts @@ -53,7 +53,9 @@ export function fromatTMDBMetaResult( id: details.id, title: (details as TMDBMovieData).title, object_type: mediaTypeToTMDB(type), - poster: (details as TMDBMovieData).poster_path ?? undefined, + poster: + Tmdb.getMediaPoster((details as TMDBMovieData).poster_path) ?? + undefined, original_release_year: Number( (details as TMDBMovieData).release_date?.split("-")[0] ), @@ -69,7 +71,9 @@ export function fromatTMDBMetaResult( season_number: v.season_number, title: v.name, })), - poster: (details as TMDBMovieData).poster_path ?? undefined, + poster: + Tmdb.getMediaPoster((details as TMDBMovieData).poster_path) ?? + undefined, original_release_year: Number( (details as TMDBShowData).first_air_date?.split("-")[0] ), diff --git a/src/components/media/MediaCard.tsx b/src/components/media/MediaCard.tsx index 695027a2..ece6d293 100644 --- a/src/components/media/MediaCard.tsx +++ b/src/components/media/MediaCard.tsx @@ -2,6 +2,7 @@ import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; import { TMDBMediaToId } from "@/backend/metadata/getmeta"; +import { Tmdb } from "@/backend/metadata/tmdb"; import { MWMediaMeta } from "@/backend/metadata/types"; import { DotList } from "@/components/text/DotList"; @@ -55,7 +56,9 @@ function MediaCardContent({ closable ? "" : "group-hover:rounded-lg", ].join(" ")} style={{ - backgroundImage: media.poster ? `url(${media.poster})` : undefined, + backgroundImage: media.poster + ? `url(${Tmdb.getMediaPoster(media.poster)})` + : undefined, }} > {series ? (