mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-21 14:47:41 +01:00
directly get poster url
This commit is contained in:
parent
7c3d4aac27
commit
dccab9b0bf
2 changed files with 4 additions and 6 deletions
|
@ -7,6 +7,7 @@ import {
|
||||||
getEpisodes,
|
getEpisodes,
|
||||||
getExternalIds,
|
getExternalIds,
|
||||||
getMediaDetails,
|
getMediaDetails,
|
||||||
|
getMediaPoster,
|
||||||
mediaTypeToTMDB,
|
mediaTypeToTMDB,
|
||||||
} from "./tmdb";
|
} from "./tmdb";
|
||||||
import {
|
import {
|
||||||
|
@ -56,7 +57,7 @@ export function formatTMDBMetaResult(
|
||||||
id: details.id,
|
id: details.id,
|
||||||
title: movie.title,
|
title: movie.title,
|
||||||
object_type: mediaTypeToTMDB(type),
|
object_type: mediaTypeToTMDB(type),
|
||||||
poster: movie.poster_path ?? undefined,
|
poster: getMediaPoster(movie.poster_path) ?? undefined,
|
||||||
original_release_year: new Date(movie.release_date).getFullYear(),
|
original_release_year: new Date(movie.release_date).getFullYear(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,7 @@ import { useTranslation } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
import { TMDBMediaToId } from "@/backend/metadata/getmeta";
|
import { TMDBMediaToId } from "@/backend/metadata/getmeta";
|
||||||
import { getMediaPoster } from "@/backend/metadata/tmdb";
|
import { MWMediaMeta } from "@/backend/metadata/types/mw";
|
||||||
import { MWMediaMeta } from "@/backend/metadata/types";
|
|
||||||
import { DotList } from "@/components/text/DotList";
|
import { DotList } from "@/components/text/DotList";
|
||||||
|
|
||||||
import { IconPatch } from "../buttons/IconPatch";
|
import { IconPatch } from "../buttons/IconPatch";
|
||||||
|
@ -56,9 +55,7 @@ function MediaCardContent({
|
||||||
closable ? "" : "group-hover:rounded-lg",
|
closable ? "" : "group-hover:rounded-lg",
|
||||||
].join(" ")}
|
].join(" ")}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: media.poster
|
backgroundImage: media.poster ? `url(${media.poster})` : undefined,
|
||||||
? `url(${getMediaPoster(media.poster)})`
|
|
||||||
: undefined,
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{series ? (
|
{series ? (
|
||||||
|
|
Loading…
Reference in a new issue