Fix carousel breaking homePage

This commit is contained in:
prayag17 committed 2023-05-01 19:37:27 +05:30
1 parent fbe31a190a
commit 2570c96f31
4 files changed
+138 -10

No files matched your search

+38 -3
View File
@@ -47,6 +47,7 @@ import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
import { useNavigate } from "react-router-dom";
import { endsAt, getRuntime } from "../../utils/date/time";
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
const Home = () => {
const authUser = useQuery({
@@ -94,7 +95,7 @@ const Home = () => {
const media = await getUserLibraryApi(window.api).getLatestMedia(
{
userId: user.data.Id,
fields: "Overview",
fields: [ItemFields.Overview, ItemFields.ParentId],
enableUserData: true,
},
);
@@ -252,8 +253,42 @@ const Home = () => {
key={index}
>
<div className="hero-carousel-background-container">
{item.ImageBlurHashes
.Backdrop ? (
{item.Type ==
BaseItemKind.MusicAlbum ? (
item
.ParentBackdropImageTags
.length != 0 && (
<>
<Blurhash
hash={
item
.ImageBlurHashes
.Backdrop[
item
.ParentBackdropImageTags[0]
]
}
// hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
width="1080"
height="720"
resolutionX={
64
}
resolutionY={
96
}
className="hero-carousel-background-blurhash"
/>
<div
className="hero-carousel-background-image"
style={{
backgroundImage: `url(${window.api.basePath}/Items/${item.ParentBackdropItemId}/Images/Backdrop)`,
}}
></div>
</>
)
) : item.ImageBlurHashes
.Backdrop ? (
<>
<Blurhash
hash={