chore(deps); update and migrate to latest node and cargo packages
This commit is contained in:
100 files changed
+7417
-8802
No files matched your search
+13
-6
@@ -20,9 +20,9 @@ import "material-symbols/rounded.scss";
|
||||
import type { Api, Jellyfin } from "@jellyfin/sdk";
|
||||
import type { UserDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import type { QueryClient } from "@tanstack/react-query";
|
||||
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||
import { TanStackRouterDevtools } from "@tanstack/react-router-devtools";
|
||||
// import { TanStackRouterDevtools } from "@tanstack/react-router-devtools";
|
||||
import { TanStackDevtools } from "@tanstack/react-devtools";
|
||||
import { ReactQueryDevtoolsPanel } from "@tanstack/react-query-devtools";
|
||||
import { TanStackRouterDevtoolsPanel } from "@tanstack/react-router-devtools";
|
||||
import { DndProvider } from "react-dnd";
|
||||
import { HTML5Backend } from "react-dnd-html5-backend";
|
||||
import Backdrop from "@/components/backdrop";
|
||||
@@ -59,12 +59,19 @@ export const Route = createRootRouteWithContext<ApiContext>()({
|
||||
<AppBar />
|
||||
<AudioPlayer />
|
||||
<Outlet />
|
||||
<ReactQueryDevtools />
|
||||
<TanStackRouterDevtools />
|
||||
<TanStackDevtools
|
||||
plugins={[
|
||||
{ name: "TanStack Query", render: <ReactQueryDevtoolsPanel /> },
|
||||
{
|
||||
name: "TanStack Router",
|
||||
render: <TanStackRouterDevtoolsPanel />,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</SnackbarProvider>
|
||||
</ThemeProvider>
|
||||
</DndProvider>
|
||||
);
|
||||
},
|
||||
errorComponent: ErrorNotice,
|
||||
});
|
||||
});
|
||||
@@ -1,279 +0,0 @@
|
||||
import {
|
||||
BaseItemKind,
|
||||
ItemFields,
|
||||
LocationType,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { motion } from "motion/react";
|
||||
import React, { useLayoutEffect, useRef } from "react";
|
||||
import LikeButton from "@/components/buttons/likeButton";
|
||||
import MarkPlayedButton from "@/components/buttons/markPlayedButton";
|
||||
import PlayButton from "@/components/buttons/playButton";
|
||||
import { Card } from "@/components/card/card";
|
||||
import CardScroller from "@/components/cardScroller/cardScroller";
|
||||
import ItemHeader from "@/components/itemHeader";
|
||||
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
|
||||
import ShowMoreText from "@/components/showMoreText";
|
||||
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||
import "./boxset.scss";
|
||||
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import IconLink from "@/components/iconLink";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
|
||||
export const Route = createFileRoute("/_api/boxset/$id")({
|
||||
component: BoxSetTitlePage,
|
||||
});
|
||||
|
||||
function BoxSetTitlePage() {
|
||||
const { id } = Route.useParams();
|
||||
const api = Route.useRouteContext().api;
|
||||
|
||||
const user = useCentralStore((s) => s.currentUser);
|
||||
|
||||
const item = useQuery({
|
||||
queryKey: ["item", id],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getUserLibraryApi(api).getItem({
|
||||
userId: user?.Id,
|
||||
itemId: id,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: !!user?.Id,
|
||||
networkMode: "always",
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const collectionItems = useQuery({
|
||||
queryKey: ["item", id, "collection"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
parentId: id,
|
||||
fields: [ItemFields.SeasonUserData, ItemFields.Overview],
|
||||
excludeLocationTypes: [LocationType.Virtual],
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const similarItems = useQuery({
|
||||
queryKey: ["item", "similarItem", id],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getLibraryApi(api).getSimilarItems({
|
||||
userId: user?.Id,
|
||||
itemId: id,
|
||||
limit: 16,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const setBackdrop = useBackdropStore((s) => s.setBackdrop);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (api && item.isSuccess) {
|
||||
if (item.data?.BackdropImageTags?.length) {
|
||||
setBackdrop(
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data.Id ?? "",
|
||||
"Backdrop",
|
||||
{
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
},
|
||||
),
|
||||
);
|
||||
} else {
|
||||
setBackdrop("");
|
||||
}
|
||||
}
|
||||
}, [item.isSuccess]);
|
||||
|
||||
const scrollTargetRef = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
if (item.isPending || similarItems.isPending) {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
width: "100%",
|
||||
height: "100vh",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
if (item.isSuccess && item.data && similarItems.isSuccess) {
|
||||
return (
|
||||
<motion.div
|
||||
key={id}
|
||||
initial={{
|
||||
opacity: 0,
|
||||
}}
|
||||
animate={{
|
||||
opacity: 1,
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.25,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY item item-boxset padded-top"
|
||||
>
|
||||
<div ref={scrollTargetRef} />
|
||||
<ItemHeader
|
||||
item={item.data}
|
||||
api={api}
|
||||
scrollTargetRef={scrollTargetRef}
|
||||
>
|
||||
<div className="item-hero-buttons-container flex flex-row">
|
||||
<div className="flex flex-row fullWidth">
|
||||
<PlayButton
|
||||
item={item.data}
|
||||
itemType={item.data.Type ?? "BoxSet"}
|
||||
userId={user?.Id}
|
||||
buttonProps={{
|
||||
fullWidth: true,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-row" style={{ gap: "1em" }}>
|
||||
<LikeButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
queryKey={["item", id]}
|
||||
isFavorite={item.data.UserData?.IsFavorite}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
<MarkPlayedButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
queryKey={["item", id]}
|
||||
isPlayed={item.data.UserData?.Played}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</ItemHeader>
|
||||
<div
|
||||
className="item-detail"
|
||||
style={{
|
||||
marginBottom: "2em",
|
||||
}}
|
||||
>
|
||||
<ShowMoreText content={item.data.Overview ?? ""} collapsedLines={4} />
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "0.6em",
|
||||
alignSelf: "end",
|
||||
marginTop: "1em",
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls?.map((url) => (
|
||||
<IconLink
|
||||
url={url.Url ?? ""}
|
||||
name={url.Name ?? ""}
|
||||
key={url.Url}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{(collectionItems.data?.TotalRecordCount ?? 0) > 0 && (
|
||||
<CardScroller title="" displayCards={7} disableDecoration>
|
||||
{collectionItems.data?.Items?.map((similar) => {
|
||||
return (
|
||||
<Card
|
||||
key={similar.Id}
|
||||
item={similar}
|
||||
seriesId={similar.SeriesId}
|
||||
cardTitle={
|
||||
similar.Type === BaseItemKind.Episode
|
||||
? similar.SeriesName
|
||||
: similar.Name
|
||||
}
|
||||
imageType={"Primary"}
|
||||
cardCaption={similar.ProductionYear}
|
||||
cardType={"portrait"}
|
||||
queryKey={["item", id]}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
)}
|
||||
{similarItems.data?.TotalRecordCount && (
|
||||
<CardScroller
|
||||
title="You might also like"
|
||||
displayCards={7}
|
||||
disableDecoration
|
||||
>
|
||||
{similarItems.data?.Items?.map((similar) => {
|
||||
return (
|
||||
<Card
|
||||
key={similar.Id}
|
||||
item={similar}
|
||||
seriesId={similar.SeriesId}
|
||||
cardTitle={
|
||||
similar.Type === BaseItemKind.Episode
|
||||
? similar.SeriesName
|
||||
: similar.Name
|
||||
}
|
||||
imageType={"Primary"}
|
||||
cardCaption={
|
||||
similar.Type === BaseItemKind.Episode
|
||||
? `S${similar.ParentIndexNumber}:E${similar.IndexNumber} - ${similar.Name}`
|
||||
: similar.Type === BaseItemKind.Series
|
||||
? `${similar.ProductionYear} - ${
|
||||
similar.EndDate
|
||||
? new Date(similar.EndDate).toLocaleString([], {
|
||||
year: "numeric",
|
||||
})
|
||||
: "Present"
|
||||
}`
|
||||
: similar.ProductionYear
|
||||
}
|
||||
cardType={
|
||||
similar.Type === BaseItemKind.MusicAlbum ||
|
||||
similar.Type === BaseItemKind.Audio
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
queryKey={["item", id, "similarItem"]}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
)}
|
||||
</motion.div>
|
||||
);
|
||||
}
|
||||
if (item.isError || similarItems.isError) {
|
||||
return <ErrorNotice />;
|
||||
}
|
||||
}
|
||||
|
||||
export default BoxSetTitlePage;
|
||||
@@ -1,66 +0,0 @@
|
||||
$cardWidth: 18%;
|
||||
.item-boxset.item {
|
||||
gap: 1em;
|
||||
|
||||
.item-detail {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 35%;
|
||||
justify-items: center;
|
||||
align-items: start;
|
||||
gap: 3em;
|
||||
|
||||
&-cast {
|
||||
&-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
}
|
||||
&-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
gap: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
&-card {
|
||||
display: grid;
|
||||
grid-template-columns: 6em 1fr;
|
||||
gap: 0.5em;
|
||||
align-items: center;
|
||||
color: white !important;
|
||||
text-decoration: none;
|
||||
padding: 0.5em;
|
||||
background: rgb(255 255 255 / 0);
|
||||
transition: background $transition-time-default;
|
||||
border-radius: $border-radius-default;
|
||||
&:hover {
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
}
|
||||
&-image,
|
||||
&-icon {
|
||||
width: 6em;
|
||||
height: 6em;
|
||||
object-fit: cover;
|
||||
border-radius: 100%;
|
||||
box-shadow: $shadow-card-image;
|
||||
}
|
||||
&-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1em;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
.material-symbols-rounded {
|
||||
font-size: 3em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&-link {
|
||||
color: white;
|
||||
text-decoration-color: rgb(255 255 255 / 0.5);
|
||||
&:hover {
|
||||
text-decoration-color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,653 +0,0 @@
|
||||
import {
|
||||
BaseItemKind,
|
||||
MediaStreamType,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import TextField from "@mui/material/TextField";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { motion } from "motion/react";
|
||||
import React, { useEffect, useMemo, useRef, useState } from "react";
|
||||
import LikeButton from "@/components/buttons/likeButton";
|
||||
import MarkPlayedButton from "@/components/buttons/markPlayedButton";
|
||||
import PlayButton from "@/components/buttons/playButton";
|
||||
import TrailerButton from "@/components/buttons/trailerButton";
|
||||
// import useParallax from "@/utils/hooks/useParallax";
|
||||
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
|
||||
import ShowMoreText from "@/components/showMoreText";
|
||||
import { getTypeIcon } from "@/components/utils/iconsCollection";
|
||||
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||
import "./episode.scss";
|
||||
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { createFileRoute, Link } from "@tanstack/react-router";
|
||||
import { Card } from "@/components/card/card";
|
||||
import CardScroller from "@/components/cardScroller/cardScroller";
|
||||
import IconLink from "@/components/iconLink";
|
||||
import ItemHeader from "@/components/itemHeader";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import type MediaQualityInfo from "@/utils/types/mediaQualityInfo";
|
||||
|
||||
export const Route = createFileRoute("/_api/episode/$id")({
|
||||
component: EpisodeTitlePage,
|
||||
});
|
||||
|
||||
function EpisodeTitlePage() {
|
||||
const { id } = Route.useParams();
|
||||
const api = Route.useRouteContext().api;
|
||||
|
||||
const user = useCentralStore((s) => s.currentUser);
|
||||
|
||||
const item = useQuery({
|
||||
queryKey: ["item", id],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getUserLibraryApi(api).getItem({
|
||||
userId: user?.Id,
|
||||
itemId: id,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: !!user?.Id,
|
||||
networkMode: "always",
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const upcomingEpisodes = useQuery({
|
||||
queryKey: ["item", id, "episode", "upcomingEpisodes"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
parentId: item.data?.ParentId ?? "",
|
||||
startIndex: item.data?.IndexNumber ?? 0,
|
||||
excludeLocationTypes: ["Virtual"],
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: item.isSuccess && item.data?.Type === BaseItemKind.Episode,
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const setBackdrop = useBackdropStore((state) => state.setBackdrop);
|
||||
|
||||
const [selectedVideoTrack, setSelectedVideoTrack] = useState(0);
|
||||
const [selectedAudioTrack, setSelectedAudioTrack] = useState(0);
|
||||
const [selectedSubtitleTrack, setSelectedSubtitleTrack] = useState(0);
|
||||
|
||||
const videoTracks = useMemo(() => {
|
||||
const result = item.data?.MediaStreams?.filter((source) => {
|
||||
if (source.Type === MediaStreamType.Video) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
setSelectedVideoTrack(result?.find((track) => track.IsDefault)?.Index ?? 0);
|
||||
return result ?? [];
|
||||
}, [item.data?.Id]);
|
||||
const audioTracks = useMemo(() => {
|
||||
const result = item.data?.MediaStreams?.filter((source) => {
|
||||
if (source.Type === MediaStreamType.Audio) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
setSelectedAudioTrack(
|
||||
item.data?.MediaSources?.[0].DefaultAudioStreamIndex ?? 0,
|
||||
);
|
||||
return result ?? [];
|
||||
}, [item.data?.Id]);
|
||||
const subtitleTracks = useMemo(() => {
|
||||
const result = item.data?.MediaStreams?.filter((source) => {
|
||||
if (source.Type === MediaStreamType.Subtitle) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
setSelectedSubtitleTrack(
|
||||
result?.find((track) => track.IsDefault)?.Index ?? -1,
|
||||
);
|
||||
return result ?? [];
|
||||
}, [item.data?.Id]);
|
||||
|
||||
const directors = useMemo(() => {
|
||||
return item.data?.People?.filter((itm) => itm.Type === "Director") ?? [];
|
||||
}, [item.data?.Id]);
|
||||
const writers = useMemo(() => {
|
||||
return item.data?.People?.filter((itm) => itm.Type === "Writer") ?? [];
|
||||
}, [item.data?.Id]);
|
||||
const actors = useMemo(() => {
|
||||
return item.data?.People?.filter((itm) => itm.Type === "Actor") ?? [];
|
||||
}, [item.data?.Id]);
|
||||
const producers = useMemo(() => {
|
||||
return item.data?.People?.filter((itm) => itm.Type === "Producer") ?? [];
|
||||
}, [item.data?.Id]);
|
||||
|
||||
const mediaQualityInfo = useMemo<MediaQualityInfo>(() => {
|
||||
const checkAtmos = audioTracks.filter((audio) =>
|
||||
audio.DisplayTitle?.toLocaleLowerCase().includes("atmos"),
|
||||
);
|
||||
const checkDolbyVision = videoTracks.filter(
|
||||
(video) =>
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("dv") ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("dolby vision") ||
|
||||
!!video.VideoDoViTitle ||
|
||||
video.VideoRangeType === "DOVI",
|
||||
);
|
||||
const checkDD = audioTracks.filter(
|
||||
(audio) =>
|
||||
(audio.DisplayTitle?.toLocaleLowerCase().includes("dd") &&
|
||||
!audio.DisplayTitle?.toLocaleLowerCase().includes("ddp")) ||
|
||||
(audio.DisplayTitle?.toLocaleLowerCase().includes("dolby digital") &&
|
||||
!audio.DisplayTitle?.toLocaleLowerCase().includes("dolby digital+")),
|
||||
);
|
||||
const checkDDP = audioTracks.filter(
|
||||
(audio) =>
|
||||
audio.DisplayTitle?.toLocaleLowerCase().includes("ddp") ||
|
||||
audio.DisplayTitle?.toLocaleLowerCase().includes("dolby digital+"),
|
||||
);
|
||||
const checkDts = audioTracks.filter(
|
||||
(audio) =>
|
||||
audio.DisplayTitle?.toLocaleLowerCase().includes("dts") &&
|
||||
!audio.DisplayTitle?.toLocaleLowerCase().includes("dts-hd ma") &&
|
||||
!audio.DisplayTitle?.toLocaleLowerCase().includes("dts-hd.ma"),
|
||||
);
|
||||
const checkDtsHDMA = audioTracks.filter(
|
||||
(audio) =>
|
||||
audio.DisplayTitle?.toLocaleLowerCase().includes("dts-hd ma") ||
|
||||
audio.DisplayTitle?.toLocaleLowerCase().includes("dts-hd.ma"),
|
||||
);
|
||||
const checkUHD = videoTracks.filter(
|
||||
(video) =>
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("4k") ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("2160p") ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("uhd"),
|
||||
);
|
||||
const checkHD = videoTracks.filter(
|
||||
(video) =>
|
||||
(video.DisplayTitle?.toLocaleLowerCase().includes("hd") &&
|
||||
!video.DisplayTitle?.toLocaleLowerCase().includes("hdr")) ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("1080p") ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("fhd"),
|
||||
);
|
||||
const checkSD = videoTracks.filter(
|
||||
(video) =>
|
||||
(video.DisplayTitle?.toLocaleLowerCase().includes("sd") &&
|
||||
!video.DisplayTitle?.toLocaleLowerCase().includes("sdr")) ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("720p"),
|
||||
);
|
||||
const checkSDR = videoTracks.filter(
|
||||
(video) => video.VideoRangeType === "SDR",
|
||||
);
|
||||
const checkHDR = videoTracks.filter(
|
||||
(video) =>
|
||||
video.VideoRange === "HDR" ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("dv"),
|
||||
);
|
||||
const checkHDR10 = videoTracks.filter(
|
||||
(video) =>
|
||||
video.VideoRangeType === "HDR10" &&
|
||||
!video.DisplayTitle?.toLocaleLowerCase().includes("hdr10+"),
|
||||
);
|
||||
const checkHDR10Plus = videoTracks.filter(
|
||||
(video) =>
|
||||
video.VideoRangeType === "HDR10Plus" ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("hdr10+"),
|
||||
);
|
||||
const checkTrueHD = audioTracks.filter((audio) =>
|
||||
audio.DisplayTitle?.toLocaleLowerCase().includes("truehd"),
|
||||
);
|
||||
const checkIMAX = videoTracks.filter((video) =>
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("imax"),
|
||||
);
|
||||
return {
|
||||
isAtmos: checkAtmos.length > 0,
|
||||
isDolbyVision: checkDolbyVision.length > 0,
|
||||
isDts: checkDts.length > 0,
|
||||
isDtsHDMA: checkDtsHDMA.length > 0,
|
||||
isDD: checkDD.length > 0,
|
||||
isDDP: checkDDP.length > 0,
|
||||
isUHD: checkUHD.length > 0,
|
||||
isHD: checkHD.length > 0,
|
||||
isSD: checkSD.length > 0,
|
||||
isSDR: checkSDR.length > 0,
|
||||
isHDR: checkHDR.length > 0,
|
||||
isHDR10: checkHDR10.length > 0,
|
||||
isHDR10Plus: checkHDR10Plus.length > 0,
|
||||
isTrueHD: checkTrueHD.length > 0,
|
||||
isIMAX: checkIMAX.length > 0,
|
||||
};
|
||||
}, [item.data?.Id]);
|
||||
|
||||
const lastBackdropRef = useRef<string | undefined>(undefined);
|
||||
useEffect(() => {
|
||||
if (!api || !item.isSuccess || !item.data) return;
|
||||
const tag = item.data.ParentBackdropImageTags?.[0];
|
||||
// Prefer blurhash if available; fallback to URL
|
||||
const hash = item.data.ImageBlurHashes?.Backdrop?.[tag ?? ""];
|
||||
|
||||
if (hash && lastBackdropRef.current !== hash) {
|
||||
lastBackdropRef.current = hash;
|
||||
setBackdrop(hash);
|
||||
}
|
||||
}, [api, item.isSuccess, item.data, setBackdrop]);
|
||||
|
||||
const containerRef = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
if (item.isPending) {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
width: "100%",
|
||||
height: "100vh",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
if (item.isSuccess && item.data) {
|
||||
return (
|
||||
<motion.div
|
||||
key={id}
|
||||
initial={{
|
||||
opacity: 0,
|
||||
}}
|
||||
animate={{
|
||||
opacity: 1,
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.25,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY padded-top flex flex-column item item-episode"
|
||||
ref={containerRef}
|
||||
>
|
||||
<ItemHeader
|
||||
item={item.data}
|
||||
api={api}
|
||||
mediaQualityInfo={mediaQualityInfo}
|
||||
scrollTargetRef={containerRef}
|
||||
>
|
||||
<div className="item-hero-buttons-container">
|
||||
<div className="flex flex-row">
|
||||
<PlayButton
|
||||
item={item.data}
|
||||
itemType="Episode"
|
||||
currentVideoTrack={selectedVideoTrack ?? 0}
|
||||
currentAudioTrack={selectedAudioTrack ?? 0}
|
||||
currentSubTrack={selectedSubtitleTrack ?? "nosub"}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-row" style={{ gap: "1em" }}>
|
||||
{item.data.RemoteTrailers && (
|
||||
<TrailerButton
|
||||
trailerItem={item.data.RemoteTrailers}
|
||||
disabled={item.data.RemoteTrailers?.length === 0}
|
||||
/>
|
||||
)}
|
||||
<LikeButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
queryKey={["item", id]}
|
||||
isFavorite={item.data.UserData?.IsFavorite}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
<MarkPlayedButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
queryKey={["item", id]}
|
||||
isPlayed={item.data.UserData?.Played}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</ItemHeader>
|
||||
<div className="item-detail">
|
||||
<div className="fullWidth">
|
||||
<ShowMoreText
|
||||
content={item.data.Overview ?? ""}
|
||||
collapsedLines={4}
|
||||
/>
|
||||
</div>
|
||||
<div className="fullWidth">
|
||||
{videoTracks.length > 0 && (
|
||||
<TextField
|
||||
label="Video"
|
||||
select
|
||||
style={{
|
||||
width: "100%",
|
||||
marginBottom: "1em",
|
||||
}}
|
||||
value={selectedVideoTrack}
|
||||
variant="filled"
|
||||
onChange={(e) => setSelectedVideoTrack(Number(e.target.value))}
|
||||
>
|
||||
{videoTracks.map((track) => (
|
||||
<MenuItem key={track.Index} value={track.Index}>
|
||||
{track.DisplayTitle}
|
||||
</MenuItem>
|
||||
))}
|
||||
</TextField>
|
||||
)}
|
||||
{audioTracks.length > 0 && (
|
||||
<TextField
|
||||
label="Audio"
|
||||
select
|
||||
style={{
|
||||
width: "100%",
|
||||
marginBottom: "1em",
|
||||
}}
|
||||
value={selectedAudioTrack}
|
||||
variant="filled"
|
||||
onChange={(e) => setSelectedAudioTrack(Number(e.target.value))}
|
||||
>
|
||||
{audioTracks.map((track) => (
|
||||
<MenuItem key={track.Index} value={track.Index}>
|
||||
{track.DisplayTitle}
|
||||
</MenuItem>
|
||||
))}
|
||||
</TextField>
|
||||
)}
|
||||
{subtitleTracks.length > 0 && (
|
||||
<TextField
|
||||
label="Subtitle"
|
||||
select
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
value={selectedSubtitleTrack}
|
||||
variant="filled"
|
||||
onChange={(e) =>
|
||||
setSelectedSubtitleTrack(Number(e.target.value))
|
||||
}
|
||||
>
|
||||
<MenuItem key={-1} value={-1}>
|
||||
No Subtitle
|
||||
</MenuItem>
|
||||
{subtitleTracks.map((track) => (
|
||||
<MenuItem key={track.Index} value={track.Index}>
|
||||
{track.DisplayTitle}
|
||||
</MenuItem>
|
||||
))}
|
||||
</TextField>
|
||||
)}
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "0.6em",
|
||||
alignSelf: "end",
|
||||
marginTop: "1em",
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls?.map((url) => (
|
||||
<IconLink
|
||||
key={url.Url}
|
||||
url={url.Url ?? ""}
|
||||
name={url.Name ?? ""}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{(item.data.People?.length ?? 0) > 0 && (
|
||||
<div className="item-detail-cast">
|
||||
<Typography variant="h5" mb={2}>
|
||||
Cast & Crew
|
||||
</Typography>
|
||||
{actors.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Actors</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{actors.map((actor) => (
|
||||
<Link
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to="/person/$id"
|
||||
params={{
|
||||
id: actor.Id ?? "",
|
||||
}}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name ?? ""}
|
||||
src={
|
||||
api &&
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id ?? "",
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)
|
||||
}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{writers.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Writers</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{writers.map((actor) => (
|
||||
<Link
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to="/person/$id"
|
||||
params={{
|
||||
id: actor.Id ?? "",
|
||||
}}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name ?? ""}
|
||||
src={
|
||||
api &&
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id ?? "",
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)
|
||||
}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{directors.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Directors</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{directors.map((actor) => (
|
||||
<Link
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to="/person/$id"
|
||||
params={{
|
||||
id: actor.Id ?? "",
|
||||
}}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name ?? ""}
|
||||
src={
|
||||
api &&
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id ?? "",
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)
|
||||
}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{producers.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Producers</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{producers.map((actor) => (
|
||||
<Link
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to="/person/$id"
|
||||
params={{
|
||||
id: actor.Id ?? "",
|
||||
}}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name ?? ""}
|
||||
src={
|
||||
api &&
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id ?? "",
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)
|
||||
}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{upcomingEpisodes.isSuccess &&
|
||||
(upcomingEpisodes.data?.Items?.length ?? 0) > 0 && (
|
||||
<CardScroller
|
||||
title="Upcoming Episodes"
|
||||
displayCards={4}
|
||||
disableDecoration
|
||||
>
|
||||
{upcomingEpisodes.data?.Items?.map((episode) => {
|
||||
return (
|
||||
<Card
|
||||
key={episode.Id}
|
||||
item={episode}
|
||||
cardTitle={episode.SeriesName}
|
||||
imageType="Primary"
|
||||
cardCaption={`S${episode.ParentIndexNumber}:E${episode.IndexNumber} - ${episode.Name}`}
|
||||
cardType="thumb"
|
||||
queryKey={["item", id, "episode", "upcomingEpisodes"]}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
)}
|
||||
</motion.div>
|
||||
);
|
||||
}
|
||||
if (item.isError) {
|
||||
return <ErrorNotice />;
|
||||
}
|
||||
}
|
||||
|
||||
export default EpisodeTitlePage;
|
||||
@@ -1,66 +0,0 @@
|
||||
$cardWidth: 30%;
|
||||
.item-episode.item {
|
||||
gap: 1em;
|
||||
|
||||
.item-detail {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 35%;
|
||||
justify-items: center;
|
||||
align-items: start;
|
||||
gap: 3em;
|
||||
|
||||
&-cast {
|
||||
&-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
}
|
||||
&-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
gap: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
&-card {
|
||||
display: grid;
|
||||
grid-template-columns: 6em 1fr;
|
||||
gap: 0.5em;
|
||||
align-items: center;
|
||||
color: white !important;
|
||||
text-decoration: none;
|
||||
padding: 0.5em;
|
||||
background: rgb(255 255 255 / 0);
|
||||
transition: background $transition-time-default;
|
||||
border-radius: $border-radius-default;
|
||||
&:hover {
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
}
|
||||
&-image,
|
||||
&-icon {
|
||||
width: 6em;
|
||||
height: 6em;
|
||||
object-fit: cover;
|
||||
border-radius: 100%;
|
||||
box-shadow: $shadow-card-image;
|
||||
}
|
||||
&-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1em;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
.material-symbols-rounded {
|
||||
font-size: 3em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&-link {
|
||||
color: white;
|
||||
text-decoration-color: rgb(255 255 255 / 0.5);
|
||||
&:hover {
|
||||
text-decoration-color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
type BaseItemDto,
|
||||
BaseItemKind,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import { Fade, Tab, Tabs, Typography } from "@mui/material";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { useShallow } from "zustand/react/shallow";
|
||||
@@ -32,7 +32,7 @@ function FavoritePage() {
|
||||
queryKey: ["favorite", "movies"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
const result = await getLibraryApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
isFavorite: true,
|
||||
includeItemTypes: [BaseItemKind.Movie],
|
||||
@@ -47,7 +47,7 @@ function FavoritePage() {
|
||||
queryKey: ["favorite", "series"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
const result = await getLibraryApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
isFavorite: true,
|
||||
includeItemTypes: [BaseItemKind.Series],
|
||||
@@ -61,7 +61,7 @@ function FavoritePage() {
|
||||
queryKey: ["favorite", "musicAlbum"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
const result = await getLibraryApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
isFavorite: true,
|
||||
includeItemTypes: [BaseItemKind.MusicAlbum],
|
||||
@@ -75,7 +75,7 @@ function FavoritePage() {
|
||||
queryKey: ["favorite", "audio"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
const result = await getLibraryApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
isFavorite: true,
|
||||
includeItemTypes: [BaseItemKind.Audio],
|
||||
@@ -89,7 +89,7 @@ function FavoritePage() {
|
||||
queryKey: ["favorite", "book"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
const result = await getLibraryApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
isFavorite: true,
|
||||
includeItemTypes: [BaseItemKind.Book],
|
||||
@@ -103,7 +103,7 @@ function FavoritePage() {
|
||||
queryKey: ["favorite", "musicArtist"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
const result = await getLibraryApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
isFavorite: true,
|
||||
includeItemTypes: [BaseItemKind.MusicArtist],
|
||||
@@ -117,7 +117,7 @@ function FavoritePage() {
|
||||
queryKey: ["favorite", "person"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
const result = await getLibraryApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
isFavorite: true,
|
||||
includeItemTypes: [BaseItemKind.Person],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useSuspenseQuery } from "@tanstack/react-query";
|
||||
import { useQueries, useSuspenseQuery } from "@tanstack/react-query";
|
||||
import React, { useCallback, useMemo } from "react";
|
||||
|
||||
import "./home.scss";
|
||||
@@ -10,9 +10,9 @@ import {
|
||||
ItemFields,
|
||||
type UserDto,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import { getShowApi } from "@jellyfin/sdk/lib/utils/api/show-api";
|
||||
import { getUserViewApi } from "@jellyfin/sdk/lib/utils/api/user-view-api";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { createFileRoute, useNavigate } from "@tanstack/react-router";
|
||||
import { ErrorBoundary } from "react-error-boundary";
|
||||
@@ -24,11 +24,25 @@ import Carousel from "@/components/carousel";
|
||||
import CircularPageLoadingAnimation from "@/components/circularPageLoadingAnimation";
|
||||
import { LatestMediaSection } from "@/components/layouts/homeSection/latestMediaSection";
|
||||
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
|
||||
import { getLatestItemsQueryOptions } from "@/utils/queries/items";
|
||||
import {
|
||||
getLatestItemsQueryOptions,
|
||||
getLibraryLatestQueryOptions,
|
||||
} from "@/utils/queries/items";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
|
||||
const heroItemTypes = new Set<string>([
|
||||
BaseItemKind.Movie,
|
||||
BaseItemKind.Series,
|
||||
BaseItemKind.Episode,
|
||||
BaseItemKind.MusicAlbum,
|
||||
]);
|
||||
|
||||
const combineLibraryLatest = (
|
||||
results: { data?: BaseItemDto[] | null }[],
|
||||
): BaseItemDto[][] => results.map((result) => result.data ?? []);
|
||||
|
||||
export const Route = createFileRoute("/_api/home/")({
|
||||
component: Home,
|
||||
pendingComponent: () => <CircularPageLoadingAnimation />,
|
||||
@@ -53,7 +67,7 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
const libraries = useSuspenseQuery({
|
||||
queryKey: ["libraries"],
|
||||
queryFn: async () => {
|
||||
const libs = await getUserViewsApi(api).getUserViews({
|
||||
const libs = await getUserViewApi(api).getUserViews({
|
||||
userId: user.Id,
|
||||
});
|
||||
return libs.data;
|
||||
@@ -68,7 +82,7 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
const resumeItemsVideo = useSuspenseQuery({
|
||||
queryKey: ["home", "resume", "video"],
|
||||
queryFn: async () => {
|
||||
const resumeItems = await getItemsApi(api).getResumeItems({
|
||||
const resumeItems = await getLibraryApi(api).getResumeItems({
|
||||
userId: user.Id,
|
||||
limit: 10,
|
||||
mediaTypes: ["Video"],
|
||||
@@ -82,7 +96,7 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
const resumeItemsAudio = useSuspenseQuery({
|
||||
queryKey: ["home", "resume", "audio"],
|
||||
queryFn: async () => {
|
||||
const resumeItems = await getItemsApi(api).getResumeItems({
|
||||
const resumeItems = await getLibraryApi(api).getResumeItems({
|
||||
userId: user.Id,
|
||||
limit: 10,
|
||||
mediaTypes: ["Audio"],
|
||||
@@ -96,7 +110,7 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
const upNextItems = useSuspenseQuery({
|
||||
queryKey: ["home", "upNext"],
|
||||
queryFn: async () => {
|
||||
const upNext = await getTvShowsApi(api).getNextUp({
|
||||
const upNext = await getShowApi(api).getNextUp({
|
||||
userId: user.Id,
|
||||
fields: [
|
||||
ItemFields.PrimaryImageAspectRatio,
|
||||
@@ -106,7 +120,6 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
],
|
||||
enableResumable: false,
|
||||
enableRewatching: false,
|
||||
disableFirstEpisode: false,
|
||||
limit: 10,
|
||||
});
|
||||
return upNext.data;
|
||||
@@ -128,6 +141,29 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
}
|
||||
}, [libraries.data?.Items?.length]);
|
||||
|
||||
// The per-library "latest" rows; shares cache entries with LatestMediaSection.
|
||||
const libraryLatest = useQueries({
|
||||
queries: (latestMediaLibs ?? []).map((lib) =>
|
||||
getLibraryLatestQueryOptions(api, user.Id, lib.Id),
|
||||
),
|
||||
combine: combineLibraryLatest,
|
||||
});
|
||||
|
||||
// Some servers return nothing for the global /Items/Latest query, so fall back to
|
||||
// interleaving the per-library results (each already newest-first).
|
||||
const heroItems = useMemo(() => {
|
||||
if (latestMedia.data?.length) return latestMedia.data;
|
||||
const items: BaseItemDto[] = [];
|
||||
const longest = Math.max(0, ...libraryLatest.map((list) => list.length));
|
||||
for (let index = 0; index < longest; index++) {
|
||||
for (const list of libraryLatest) {
|
||||
const item = list[index];
|
||||
if (item?.Type && heroItemTypes.has(item.Type)) items.push(item);
|
||||
}
|
||||
}
|
||||
return items.slice(0, 16);
|
||||
}, [latestMedia.data, libraryLatest]);
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
const setBackdrop = useBackdropStore(useShallow((s) => s.setBackdrop));
|
||||
@@ -153,16 +189,10 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
|
||||
const handleOnChangeCarousel = useCallback(
|
||||
(now: number) => {
|
||||
if (api && latestMedia.isSuccess && (latestMedia.data?.length ?? 0) > 0) {
|
||||
const currentItem = latestMedia.data?.[now];
|
||||
if (!currentItem) return;
|
||||
|
||||
// Extract this logic to a separate function
|
||||
setBackdropForItem(currentItem);
|
||||
}
|
||||
const currentItem = heroItems[now];
|
||||
if (currentItem) setBackdropForItem(currentItem);
|
||||
},
|
||||
// Only depend on what you need
|
||||
[latestMedia.isSuccess, api, setBackdrop],
|
||||
[heroItems, setBackdropForItem],
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -174,11 +204,8 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
}}
|
||||
>
|
||||
<ErrorBoundary FallbackComponent={ErrorNotice}>
|
||||
{latestMedia.data?.length && (
|
||||
<Carousel
|
||||
content={latestMedia.data}
|
||||
onChange={handleOnChangeCarousel}
|
||||
/>
|
||||
{heroItems.length > 0 && (
|
||||
<Carousel content={heroItems} onChange={handleOnChangeCarousel} />
|
||||
)}
|
||||
</ErrorBoundary>
|
||||
|
||||
|
||||
+64
-671
@@ -1,686 +1,79 @@
|
||||
import {
|
||||
BaseItemKind,
|
||||
MediaStreamType,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import TextField from "@mui/material/TextField";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
||||
import { motion } from "motion/react";
|
||||
import React, { useLayoutEffect, useMemo, useRef, useState } from "react";
|
||||
import { Card } from "@/components/card/card";
|
||||
import CardScroller from "@/components/cardScroller/cardScroller";
|
||||
import ItemHeader from "@/components/itemHeader";
|
||||
|
||||
import "./item.scss";
|
||||
|
||||
import { createFileRoute, Link } from "@tanstack/react-router";
|
||||
import { useShallow } from "zustand/shallow";
|
||||
import LikeButton from "@/components/buttons/likeButton";
|
||||
import MarkPlayedButton from "@/components/buttons/markPlayedButton";
|
||||
import PlayButton from "@/components/buttons/playButton";
|
||||
import TrailerButton from "@/components/buttons/trailerButton";
|
||||
import IconLink from "@/components/iconLink";
|
||||
import ShowMoreText from "@/components/showMoreText";
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { useSuspenseQuery } from "@tanstack/react-query";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import React from "react";
|
||||
import BoxSetView from "@/components/itemDetail/views/boxSetView";
|
||||
import DefaultView from "@/components/itemDetail/views/defaultView";
|
||||
import PersonView from "@/components/itemDetail/views/personView";
|
||||
import SeriesView from "@/components/itemDetail/views/seriesView";
|
||||
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
|
||||
import ItemSkeleton from "@/components/skeleton/item";
|
||||
import { getTypeIcon } from "@/components/utils/iconsCollection";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import {
|
||||
getUpcomingEpisodesQueryOptions,
|
||||
prefetchItemDetail,
|
||||
} from "@/utils/queries/itemDetail";
|
||||
import { getItemQueryOptions } from "@/utils/queries/items";
|
||||
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import type MediaQualityInfo from "@/utils/types/mediaQualityInfo";
|
||||
|
||||
type ItemSearch = {
|
||||
/** Item type hint from the link, used to prefetch type-specific data in parallel. */
|
||||
type?: BaseItemKind;
|
||||
};
|
||||
|
||||
const itemKinds = new Set<string>(Object.values(BaseItemKind));
|
||||
|
||||
export const Route = createFileRoute("/_api/item/$id")({
|
||||
component: ItemDetail,
|
||||
pendingComponent: () => <ItemSkeleton />,
|
||||
// pendingMs: 5000,
|
||||
loader: async ({ context: { queryClient, api, user }, params }) => {
|
||||
if (!api || !user?.Id) return null;
|
||||
validateSearch: (search: Record<string, unknown>): ItemSearch => ({
|
||||
type:
|
||||
typeof search.type === "string" && itemKinds.has(search.type)
|
||||
? (search.type as BaseItemKind)
|
||||
: undefined,
|
||||
}),
|
||||
loaderDeps: ({ search }) => ({ type: search.type }),
|
||||
loader: async ({
|
||||
context: { queryClient, api, user },
|
||||
params,
|
||||
deps: { type },
|
||||
}) => {
|
||||
if (!api || !user?.Id) return;
|
||||
const itemPromise = queryClient.ensureQueryData(
|
||||
getItemQueryOptions(params.id, api, user?.Id),
|
||||
getItemQueryOptions(params.id, api, user.Id),
|
||||
);
|
||||
queryClient.prefetchQuery({
|
||||
queryKey: ["item", params.id, "similarItem"],
|
||||
queryFn: async () =>
|
||||
(
|
||||
await getLibraryApi(api).getSimilarItems({
|
||||
userId: user?.Id,
|
||||
itemId: params.id,
|
||||
limit: 16,
|
||||
})
|
||||
).data,
|
||||
});
|
||||
await itemPromise;
|
||||
if (type) {
|
||||
prefetchItemDetail(queryClient, api, user.Id, params.id, type);
|
||||
}
|
||||
const item = await itemPromise;
|
||||
if (item.Type !== type) {
|
||||
// No (or wrong) hint, e.g. a deep link: prefetch now that the type is known.
|
||||
prefetchItemDetail(queryClient, api, user.Id, params.id, item.Type);
|
||||
}
|
||||
if (item.Type === BaseItemKind.Episode) {
|
||||
queryClient.prefetchQuery(
|
||||
getUpcomingEpisodesQueryOptions(api, user.Id, item),
|
||||
);
|
||||
}
|
||||
},
|
||||
component: ItemPage,
|
||||
pendingComponent: () => <ItemSkeleton />,
|
||||
errorComponent: () => <ErrorNotice />,
|
||||
});
|
||||
|
||||
function ItemDetail() {
|
||||
function ItemPage() {
|
||||
const { id } = Route.useParams();
|
||||
|
||||
const api = Route.useRouteContext().api;
|
||||
|
||||
const user = useCentralStore((s) => s.currentUser);
|
||||
const { data: item } = useSuspenseQuery(
|
||||
getItemQueryOptions(id, api, user?.Id),
|
||||
);
|
||||
|
||||
const item = useSuspenseQuery(getItemQueryOptions(id, api, user?.Id));
|
||||
|
||||
const similarItems = useQuery({
|
||||
queryKey: ["item", id, "similarItem"],
|
||||
queryFn: async () => {
|
||||
if (!api || !user?.Id) return null;
|
||||
return (
|
||||
await getLibraryApi(api).getSimilarItems({
|
||||
userId: user?.Id,
|
||||
itemId: id,
|
||||
limit: 16,
|
||||
})
|
||||
).data;
|
||||
},
|
||||
networkMode: "always",
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const [selectedVideoTrack, setSelectedVideoTrack] = useState(0);
|
||||
const [selectedAudioTrack, setSelectedAudioTrack] = useState(0);
|
||||
const [selectedSubtitleTrack, setSelectedSubtitleTrack] = useState(0);
|
||||
|
||||
const videoTracks = useMemo(() => {
|
||||
const result = item.data?.MediaStreams?.filter((source) => {
|
||||
if (source.Type === MediaStreamType.Video) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
setSelectedVideoTrack(
|
||||
result?.find((track) => track.IsDefault)?.Index ??
|
||||
result?.[0]?.Index ??
|
||||
0,
|
||||
);
|
||||
return result ?? [];
|
||||
}, [item.data?.Id]);
|
||||
const audioTracks = useMemo(() => {
|
||||
const result = item.data?.MediaStreams?.filter((source) => {
|
||||
if (source.Type === MediaStreamType.Audio) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
setSelectedAudioTrack(item.data.MediaSources?.[0].DefaultAudioStreamIndex ?? 0);
|
||||
return result ?? [];
|
||||
}, [item.data?.Id]);
|
||||
const subtitleTracks = useMemo(() => {
|
||||
const result = item.data.MediaStreams?.filter((source) => {
|
||||
if (source.Type === MediaStreamType.Subtitle) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
setSelectedSubtitleTrack(
|
||||
item.data.MediaSources?.[0].DefaultSubtitleStreamIndex ?? -1,
|
||||
);
|
||||
return result ?? [];
|
||||
}, [item.data?.Id]);
|
||||
|
||||
const directors = useMemo(() => {
|
||||
return item.data?.People?.filter((itm) => itm.Type === "Director") ?? [];
|
||||
}, [item.data?.Id]);
|
||||
const writers = useMemo(() => {
|
||||
return item.data?.People?.filter((itm) => itm.Type === "Writer") ?? [];
|
||||
}, [item.data?.Id]);
|
||||
const actors = useMemo(() => {
|
||||
return item.data?.People?.filter((itm) => itm.Type === "Actor") ?? [];
|
||||
}, [item.data?.Id]);
|
||||
const producers = useMemo(() => {
|
||||
return item.data?.People?.filter((itm) => itm.Type === "Producer") ?? [];
|
||||
}, [item.data?.Id]);
|
||||
|
||||
const mediaQualityInfo = useMemo<MediaQualityInfo>(() => {
|
||||
const checkAtmos = audioTracks.filter((audio) =>
|
||||
audio.DisplayTitle?.toLocaleLowerCase().includes("atmos"),
|
||||
);
|
||||
const checkDolbyVision = videoTracks.filter(
|
||||
(video) =>
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("dv") ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("dolby vision") ||
|
||||
!!video.VideoDoViTitle ||
|
||||
video.VideoRangeType === "DOVI",
|
||||
);
|
||||
const checkDD = audioTracks.filter(
|
||||
(audio) =>
|
||||
(audio.DisplayTitle?.toLocaleLowerCase().includes("dd") &&
|
||||
!audio.DisplayTitle?.toLocaleLowerCase().includes("ddp")) ||
|
||||
(audio.DisplayTitle?.toLocaleLowerCase().includes("dolby digital") &&
|
||||
!audio.DisplayTitle?.toLocaleLowerCase().includes("dolby digital+")),
|
||||
);
|
||||
const checkDDP = audioTracks.filter(
|
||||
(audio) =>
|
||||
audio.DisplayTitle?.toLocaleLowerCase().includes("ddp") ||
|
||||
audio.DisplayTitle?.toLocaleLowerCase().includes("dolby digital+"),
|
||||
);
|
||||
const checkDts = audioTracks.filter(
|
||||
(audio) =>
|
||||
audio.DisplayTitle?.toLocaleLowerCase().includes("dts") &&
|
||||
!audio.DisplayTitle?.toLocaleLowerCase().includes("dts-hd ma") &&
|
||||
!audio.DisplayTitle?.toLocaleLowerCase().includes("dts-hd.ma"),
|
||||
);
|
||||
const checkDtsHDMA = audioTracks.filter(
|
||||
(audio) =>
|
||||
audio.DisplayTitle?.toLocaleLowerCase().includes("dts-hd ma") ||
|
||||
audio.DisplayTitle?.toLocaleLowerCase().includes("dts-hd.ma"),
|
||||
);
|
||||
const checkUHD = videoTracks.filter(
|
||||
(video) =>
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("4k") ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("2160p") ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("uhd"),
|
||||
);
|
||||
const checkHD = videoTracks.filter(
|
||||
(video) =>
|
||||
(video.DisplayTitle?.toLocaleLowerCase().includes("hd") &&
|
||||
!video.DisplayTitle?.toLocaleLowerCase().includes("hdr")) ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("1080p") ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("fhd"),
|
||||
);
|
||||
const checkSD = videoTracks.filter(
|
||||
(video) =>
|
||||
(video.DisplayTitle?.toLocaleLowerCase().includes("sd") &&
|
||||
!video.DisplayTitle?.toLocaleLowerCase().includes("sdr")) ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("720p"),
|
||||
);
|
||||
const checkSDR = videoTracks.filter(
|
||||
(video) => video.VideoRangeType === "SDR",
|
||||
);
|
||||
const checkHDR = videoTracks.filter(
|
||||
(video) =>
|
||||
video.VideoRange === "HDR" ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("dv"),
|
||||
);
|
||||
const checkHDR10 = videoTracks.filter(
|
||||
(video) =>
|
||||
video.VideoRangeType === "HDR10" &&
|
||||
!video.DisplayTitle?.toLocaleLowerCase().includes("hdr10+"),
|
||||
);
|
||||
const checkHDR10Plus = videoTracks.filter(
|
||||
(video) =>
|
||||
video.VideoRangeType === "HDR10Plus" ||
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("hdr10+"),
|
||||
);
|
||||
const checkTrueHD = audioTracks.filter((audio) =>
|
||||
audio.DisplayTitle?.toLocaleLowerCase().includes("truehd"),
|
||||
);
|
||||
const checkIMAX = videoTracks.filter((video) =>
|
||||
video.DisplayTitle?.toLocaleLowerCase().includes("imax"),
|
||||
);
|
||||
return {
|
||||
isAtmos: checkAtmos.length > 0,
|
||||
isDolbyVision: checkDolbyVision.length > 0,
|
||||
isDts: checkDts.length > 0,
|
||||
isDtsHDMA: checkDtsHDMA.length > 0,
|
||||
isDD: checkDD.length > 0,
|
||||
isDDP: checkDDP.length > 0,
|
||||
isUHD: checkUHD.length > 0,
|
||||
isHD: checkHD.length > 0,
|
||||
isSD: checkSD.length > 0,
|
||||
isSDR: checkSDR.length > 0,
|
||||
isHDR: checkHDR.length > 0,
|
||||
isHDR10: checkHDR10.length > 0,
|
||||
isHDR10Plus: checkHDR10Plus.length > 0,
|
||||
isTrueHD: checkTrueHD.length > 0,
|
||||
isIMAX: checkIMAX.length > 0,
|
||||
};
|
||||
}, [item.data?.Id]);
|
||||
|
||||
const setBackdrop = useBackdropStore(useShallow((state) => state.setBackdrop));
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (api && item.data) {
|
||||
if (item.data?.BackdropImageTags?.length) {
|
||||
setBackdrop(
|
||||
item.data.ImageBlurHashes?.Backdrop?.[
|
||||
item.data.BackdropImageTags?.[0]
|
||||
],
|
||||
);
|
||||
} else {
|
||||
setBackdrop("");
|
||||
}
|
||||
}
|
||||
}, [item.data.Id]);
|
||||
|
||||
// Provide a scroll target ref to the backdrop component.
|
||||
const scrollTargetRef = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
key={id}
|
||||
initial={{
|
||||
opacity: 0,
|
||||
}}
|
||||
animate={{
|
||||
opacity: 1,
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.35,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY padded-top flex flex-column item item-default"
|
||||
ref={scrollTargetRef}
|
||||
>
|
||||
<ItemHeader
|
||||
item={item.data}
|
||||
api={api}
|
||||
mediaQualityInfo={mediaQualityInfo}
|
||||
scrollTargetRef={scrollTargetRef}
|
||||
>
|
||||
<div className="item-hero-buttons-container">
|
||||
<div
|
||||
className="flex flex-row"
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<PlayButton
|
||||
item={item.data}
|
||||
itemType={item.data.Type ?? "Movie"}
|
||||
audio={item.data.Type === "Audio"}
|
||||
currentVideoTrack={selectedVideoTrack}
|
||||
currentAudioTrack={selectedAudioTrack}
|
||||
currentSubTrack={selectedSubtitleTrack}
|
||||
userId={user?.Id}
|
||||
buttonProps={{
|
||||
fullWidth: true,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-row" style={{ gap: "1em" }}>
|
||||
{item.data.RemoteTrailers && (
|
||||
<TrailerButton
|
||||
trailerItem={item.data.RemoteTrailers}
|
||||
disabled={item.data.RemoteTrailers?.length === 0}
|
||||
/>
|
||||
)}
|
||||
<LikeButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
queryKey={["item", id]}
|
||||
isFavorite={item.data.UserData?.IsFavorite}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
<MarkPlayedButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
queryKey={["item", id]}
|
||||
isPlayed={item.data.UserData?.Played}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</ItemHeader>
|
||||
<div className="item-detail">
|
||||
<div style={{ width: "100%" }}>
|
||||
{(item.data.Taglines?.length ?? 0) > 0 && (
|
||||
<Typography variant="h5" mb={2} fontWeight={300}>
|
||||
{item.data.Taglines?.[0]}
|
||||
</Typography>
|
||||
)}
|
||||
<ShowMoreText
|
||||
content={item.data.Overview ?? ""}
|
||||
collapsedLines={4}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
{videoTracks.length > 0 && (
|
||||
<TextField
|
||||
label="Video"
|
||||
select
|
||||
style={{
|
||||
width: "100%",
|
||||
marginBottom: "1em",
|
||||
}}
|
||||
value={selectedVideoTrack}
|
||||
variant="filled"
|
||||
onChange={(e) => setSelectedVideoTrack(Number(e.target.value))}
|
||||
>
|
||||
{videoTracks.map((track) => (
|
||||
<MenuItem key={track.Index} value={track.Index}>
|
||||
{track.DisplayTitle}
|
||||
</MenuItem>
|
||||
))}
|
||||
</TextField>
|
||||
)}
|
||||
{audioTracks.length > 0 && (
|
||||
<TextField
|
||||
label="Audio"
|
||||
select
|
||||
style={{
|
||||
width: "100%",
|
||||
marginBottom: "1em",
|
||||
}}
|
||||
value={selectedAudioTrack}
|
||||
variant="filled"
|
||||
onChange={(e) => setSelectedAudioTrack(Number(e.target.value))}
|
||||
>
|
||||
{audioTracks.map((track) => (
|
||||
<MenuItem key={track.Index} value={track.Index}>
|
||||
{track.DisplayTitle}
|
||||
</MenuItem>
|
||||
))}
|
||||
</TextField>
|
||||
)}
|
||||
{subtitleTracks.length > 0 && (
|
||||
<TextField
|
||||
label="Subtitle"
|
||||
select
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
value={selectedSubtitleTrack}
|
||||
variant="filled"
|
||||
SelectProps={{
|
||||
MenuProps: {
|
||||
disablePortal: true,
|
||||
},
|
||||
}}
|
||||
onChange={(e) =>
|
||||
setSelectedSubtitleTrack(Number(e.target.value))
|
||||
}
|
||||
>
|
||||
<MenuItem key={-1} value={-1}>
|
||||
No Subtitle
|
||||
</MenuItem>
|
||||
{subtitleTracks.map((track) => (
|
||||
<MenuItem key={track.Index} value={track.Index}>
|
||||
{track.DisplayTitle}
|
||||
</MenuItem>
|
||||
))}
|
||||
</TextField>
|
||||
)}
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "0.6em",
|
||||
alignSelf: "end",
|
||||
marginTop: "1em",
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls?.map(
|
||||
(url) =>
|
||||
url.Url &&
|
||||
url.Name && (
|
||||
<IconLink key={url.Name} url={url.Url} name={url.Name} />
|
||||
),
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{(item.data.People?.length ?? 0) > 0 && (
|
||||
<div className="item-detail-cast">
|
||||
<Typography variant="h5" mb={2}>
|
||||
Cast & Crew
|
||||
</Typography>
|
||||
{actors.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Actors</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{actors.map((actor) => (
|
||||
<Link
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to="/person/$id"
|
||||
params={{
|
||||
id: actor.Id ?? "",
|
||||
}}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name ?? ""}
|
||||
src={
|
||||
api &&
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id ?? "",
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)
|
||||
}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{writers.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Writers</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{writers.map((actor) => (
|
||||
<Link
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to="/person/$id"
|
||||
params={{
|
||||
id: actor.Id ?? "",
|
||||
}}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name ?? ""}
|
||||
src={
|
||||
api &&
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id ?? "",
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)
|
||||
}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{directors.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Directors</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{directors.map((actor) => (
|
||||
<Link
|
||||
className="item-detail-cast-card"
|
||||
to="/person/$id"
|
||||
key={actor.Id}
|
||||
params={{
|
||||
id: actor.Id ?? "",
|
||||
}}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name ?? ""}
|
||||
src={
|
||||
api &&
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id ?? "",
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)
|
||||
}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{producers.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Producers</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{producers.map((actor) => (
|
||||
<Link
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to="/person/$id"
|
||||
params={{
|
||||
id: actor.Id ?? "",
|
||||
}}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name ?? ""}
|
||||
src={
|
||||
api &&
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id ?? "",
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)
|
||||
}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{(similarItems.data?.TotalRecordCount ?? 0) > 0 && (
|
||||
<CardScroller
|
||||
title="You might also like"
|
||||
displayCards={7}
|
||||
disableDecoration
|
||||
>
|
||||
{similarItems.data?.Items?.map((similar) => {
|
||||
return (
|
||||
<Card
|
||||
key={similar.Id}
|
||||
item={similar}
|
||||
seriesId={similar.SeriesId}
|
||||
cardTitle={
|
||||
similar.Type === BaseItemKind.Episode
|
||||
? similar.SeriesName
|
||||
: similar.Name
|
||||
}
|
||||
imageType={"Primary"}
|
||||
cardCaption={
|
||||
similar.Type === BaseItemKind.Episode
|
||||
? `S${similar.ParentIndexNumber}:E${similar.IndexNumber} - ${similar.Name}`
|
||||
: similar.Type === BaseItemKind.Series
|
||||
? `${similar.ProductionYear} - ${
|
||||
similar.EndDate
|
||||
? new Date(similar.EndDate).toLocaleString([], {
|
||||
year: "numeric",
|
||||
})
|
||||
: "Present"
|
||||
}`
|
||||
: similar.ProductionYear
|
||||
}
|
||||
cardType={
|
||||
similar.Type === BaseItemKind.MusicAlbum ||
|
||||
similar.Type === BaseItemKind.Audio
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
queryKey={["item", id, "similarItem"]}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
)}
|
||||
</motion.div>
|
||||
);
|
||||
switch (item.Type) {
|
||||
case BaseItemKind.Series:
|
||||
return <SeriesView key={id} item={item} />;
|
||||
case BaseItemKind.BoxSet:
|
||||
return <BoxSetView key={id} item={item} />;
|
||||
case BaseItemKind.Person:
|
||||
return <PersonView key={id} item={item} />;
|
||||
default:
|
||||
return <DefaultView key={id} item={item} />;
|
||||
}
|
||||
}
|
||||
|
||||
export default ItemDetail;
|
||||
@@ -1,103 +0,0 @@
|
||||
$cardWidth: 18%;
|
||||
|
||||
.item-default.item {
|
||||
|
||||
.item-detail {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 35%;
|
||||
justify-items: center;
|
||||
align-items: start;
|
||||
gap: 3em;
|
||||
|
||||
&-cast {
|
||||
&-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
}
|
||||
&-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
gap: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
&-card {
|
||||
display: grid;
|
||||
grid-template-columns: 6em 1fr;
|
||||
gap: 0.5em;
|
||||
align-items: center;
|
||||
color: white !important;
|
||||
text-decoration: none;
|
||||
padding: 0.5em;
|
||||
background: rgb(255 255 255 / 0);
|
||||
transition: background $transition-time-default;
|
||||
border-radius: $border-radius-default;
|
||||
&:hover {
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
}
|
||||
&-image,
|
||||
&-icon {
|
||||
width: 6em;
|
||||
height: 6em;
|
||||
object-fit: cover;
|
||||
border-radius: 100%;
|
||||
box-shadow: $shadow-card-image;
|
||||
}
|
||||
&-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1em;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
.material-symbols-rounded {
|
||||
font-size: 3em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&-link {
|
||||
color: white;
|
||||
text-decoration-color: rgb(255 255 255 / 0.5);
|
||||
&:hover {
|
||||
text-decoration-color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Global item-detail
|
||||
.item-detail-link{
|
||||
margin-top: 0.85em !important;
|
||||
&:hover > img{
|
||||
filter: brightness(1);
|
||||
}
|
||||
& > img {
|
||||
width: 2em;
|
||||
aspect-ratio: 1;
|
||||
filter: brightness(0.5);
|
||||
transition: filter $transition-time-default;
|
||||
}
|
||||
}
|
||||
|
||||
.item {
|
||||
gap: 1.5em;
|
||||
&-hero{
|
||||
// margin-bottom: 1em;
|
||||
&-image{
|
||||
box-sizing: border-box;
|
||||
&-container{
|
||||
box-sizing: content-box;
|
||||
box-shadow: 0px 10px 20px -10px rgb(0 0 0 / 0.5) !important;
|
||||
}
|
||||
}
|
||||
&-mediaInfo{
|
||||
margin-top: 1em;
|
||||
height: 1.1em;
|
||||
opacity: 0.8;
|
||||
&.badge{
|
||||
margin: 0;
|
||||
height: 1.2em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,7 +170,13 @@ function LoginUser() {
|
||||
<Typography variant="body1" sx={{ opacity: 0.7 }}>
|
||||
Login as
|
||||
</Typography>
|
||||
<Typography variant="h5" fontWeight={700} className="gradient-text">
|
||||
<Typography
|
||||
variant="h5"
|
||||
className="gradient-text"
|
||||
sx={{
|
||||
fontWeight: 700,
|
||||
}}
|
||||
>
|
||||
{userName}
|
||||
</Typography>
|
||||
</div>
|
||||
@@ -192,32 +198,34 @@ function LoginUser() {
|
||||
label="Password"
|
||||
variant="outlined"
|
||||
autoFocus
|
||||
InputProps={{
|
||||
startAdornment: (
|
||||
<InputAdornment position="start">
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{ opacity: 0.5 }}
|
||||
>
|
||||
key
|
||||
</span>
|
||||
</InputAdornment>
|
||||
),
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<IconButton onClick={handleShowPassword} edge="end">
|
||||
{password.showpass ? (
|
||||
<span className="material-symbols-rounded">
|
||||
visibility
|
||||
</span>
|
||||
) : (
|
||||
<span className="material-symbols-rounded">
|
||||
visibility_off
|
||||
</span>
|
||||
)}
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
),
|
||||
slotProps={{
|
||||
input: {
|
||||
startAdornment: (
|
||||
<InputAdornment position="start">
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{ opacity: 0.5 }}
|
||||
>
|
||||
key
|
||||
</span>
|
||||
</InputAdornment>
|
||||
),
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<IconButton onClick={handleShowPassword} edge="end">
|
||||
{password.showpass ? (
|
||||
<span className="material-symbols-rounded">
|
||||
visibility
|
||||
</span>
|
||||
) : (
|
||||
<span className="material-symbols-rounded">
|
||||
visibility_off
|
||||
</span>
|
||||
)}
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
),
|
||||
},
|
||||
}}
|
||||
/>
|
||||
|
||||
|
||||
@@ -74,12 +74,15 @@ const UserCard = ({ user }: { user: UserDto }) => {
|
||||
)}
|
||||
</div>
|
||||
<Typography
|
||||
mt={2}
|
||||
align="center"
|
||||
variant="subtitle1"
|
||||
fontWeight="bold"
|
||||
noWrap
|
||||
sx={{ width: "100%", color: "text.primary" }}
|
||||
sx={{
|
||||
mt: 2,
|
||||
fontWeight: "bold",
|
||||
width: "100%",
|
||||
color: "text.primary",
|
||||
}}
|
||||
>
|
||||
{user.Name}
|
||||
</Typography>
|
||||
@@ -127,7 +130,13 @@ function LoginPublicUsersList() {
|
||||
gap: 3,
|
||||
}}
|
||||
>
|
||||
<Typography variant="h4" align="center" fontWeight="bold">
|
||||
<Typography
|
||||
variant="h4"
|
||||
align="center"
|
||||
sx={{
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
Select User
|
||||
</Typography>
|
||||
|
||||
|
||||
@@ -149,7 +149,13 @@ function UserLoginManual() {
|
||||
mb: 3,
|
||||
}}
|
||||
>
|
||||
<Typography variant="h4" fontWeight="bold" align="center">
|
||||
<Typography
|
||||
variant="h4"
|
||||
align="center"
|
||||
sx={{
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
Login
|
||||
</Typography>
|
||||
<form
|
||||
@@ -162,17 +168,19 @@ function UserLoginManual() {
|
||||
label="Username" // Label helps accessibility, theme handles style
|
||||
fullWidth
|
||||
onChange={(e) => setUsername(e.currentTarget.value)}
|
||||
InputProps={{
|
||||
startAdornment: (
|
||||
<InputAdornment position="start">
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{ opacity: 0.5 }}
|
||||
>
|
||||
person
|
||||
</span>
|
||||
</InputAdornment>
|
||||
),
|
||||
slotProps={{
|
||||
input: {
|
||||
startAdornment: (
|
||||
<InputAdornment position="start">
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{ opacity: 0.5 }}
|
||||
>
|
||||
person
|
||||
</span>
|
||||
</InputAdornment>
|
||||
),
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<TextField
|
||||
@@ -181,39 +189,41 @@ function UserLoginManual() {
|
||||
onChange={handlePassword("password")}
|
||||
label="Password"
|
||||
variant="outlined"
|
||||
InputProps={{
|
||||
startAdornment: (
|
||||
<InputAdornment position="start">
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{ opacity: 0.5 }}
|
||||
>
|
||||
key
|
||||
</span>
|
||||
</InputAdornment>
|
||||
),
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<IconButton
|
||||
onClick={handleShowPassword}
|
||||
edge="end"
|
||||
sx={{
|
||||
color: "rgba(255,255,255,0.7)",
|
||||
"&:hover": { color: "#fff" },
|
||||
}}
|
||||
>
|
||||
{password.showpass ? (
|
||||
<span className="material-symbols-rounded">
|
||||
visibility
|
||||
</span>
|
||||
) : (
|
||||
<span className="material-symbols-rounded">
|
||||
visibility_off
|
||||
</span>
|
||||
)}
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
),
|
||||
slotProps={{
|
||||
input: {
|
||||
startAdornment: (
|
||||
<InputAdornment position="start">
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{ opacity: 0.5 }}
|
||||
>
|
||||
key
|
||||
</span>
|
||||
</InputAdornment>
|
||||
),
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<IconButton
|
||||
onClick={handleShowPassword}
|
||||
edge="end"
|
||||
sx={{
|
||||
color: "rgba(255,255,255,0.7)",
|
||||
"&:hover": { color: "#fff" },
|
||||
}}
|
||||
>
|
||||
{password.showpass ? (
|
||||
<span className="material-symbols-rounded">
|
||||
visibility
|
||||
</span>
|
||||
) : (
|
||||
<span className="material-symbols-rounded">
|
||||
visibility_off
|
||||
</span>
|
||||
)}
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
),
|
||||
},
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -289,7 +299,12 @@ function UserLoginManual() {
|
||||
>
|
||||
info
|
||||
</span>
|
||||
<Typography variant="subtitle1" fontWeight="bold">
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
sx={{
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
Notice
|
||||
</Typography>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { BaseItemKind, SortOrder } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import Typography from "@mui/material/Typography";
|
||||
@@ -27,7 +25,7 @@ import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
|
||||
export const Route = createFileRoute("/_api/album/$id")({
|
||||
export const Route = createFileRoute("/_api/music/album/$id")({
|
||||
component: MusicAlbumTitlePage,
|
||||
});
|
||||
|
||||
@@ -41,7 +39,7 @@ function MusicAlbumTitlePage() {
|
||||
queryKey: ["item", id],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getUserLibraryApi(api).getItem({
|
||||
const result = await getLibraryApi(api).getItem({
|
||||
userId: user?.Id,
|
||||
itemId: id,
|
||||
});
|
||||
@@ -74,7 +72,7 @@ function MusicAlbumTitlePage() {
|
||||
queryKey: ["item", "musicTracks", id],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
const result = await getLibraryApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
parentId: item.data?.Id,
|
||||
sortOrder: [SortOrder.Ascending],
|
||||
@@ -146,7 +144,7 @@ function MusicAlbumTitlePage() {
|
||||
<div className="flex flex-align-center item-info-album-info">
|
||||
{/* @ts-ignore - Using Link as component */}
|
||||
<Link
|
||||
to="/artist/$id"
|
||||
to="/music/artist/$id"
|
||||
params={{ id: item.data.AlbumArtists?.[0].Id ?? "" }}
|
||||
>
|
||||
<Chip
|
||||
File renamed without changes.
@@ -3,8 +3,7 @@ import {
|
||||
ItemFields,
|
||||
SortOrder,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import Divider from "@mui/material/Divider";
|
||||
@@ -36,7 +35,6 @@ import { createFileRoute } from "@tanstack/react-router";
|
||||
import IconLink from "@/components/iconLink";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
|
||||
|
||||
type TabPanelProp = {
|
||||
children: ReactNode;
|
||||
index: number;
|
||||
@@ -60,7 +58,7 @@ function TabPanel(props: TabPanelProp) {
|
||||
);
|
||||
}
|
||||
|
||||
export const Route = createFileRoute("/_api/artist/$id")({
|
||||
export const Route = createFileRoute("/_api/music/artist/$id")({
|
||||
component: ArtistTitlePage,
|
||||
});
|
||||
|
||||
@@ -74,7 +72,7 @@ function ArtistTitlePage() {
|
||||
queryKey: ["item", id],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getUserLibraryApi(api).getItem({
|
||||
const result = await getLibraryApi(api).getItem({
|
||||
userId: user?.Id,
|
||||
itemId: id,
|
||||
});
|
||||
@@ -89,7 +87,7 @@ function ArtistTitlePage() {
|
||||
queryKey: ["item", id, "artist", "discography"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
const result = await getLibraryApi(api).getItems({
|
||||
albumArtistIds: [id],
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
sortOrder: [SortOrder.Descending],
|
||||
@@ -107,7 +105,7 @@ function ArtistTitlePage() {
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
|
||||
const result = await getItemsApi(api).getItems({
|
||||
const result = await getLibraryApi(api).getItems({
|
||||
artistIds: [id],
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
sortOrder: [SortOrder.Ascending],
|
||||
@@ -124,7 +122,7 @@ function ArtistTitlePage() {
|
||||
queryKey: ["item", id, "artist", "appearences"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
const result = await getLibraryApi(api).getItems({
|
||||
contributingArtistIds: [id],
|
||||
excludeItemIds: [id],
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
@@ -263,7 +261,12 @@ function ArtistTitlePage() {
|
||||
)}
|
||||
{item.data.EndDate && (
|
||||
<div>
|
||||
<Typography variant="h5" mt={2}>
|
||||
<Typography
|
||||
variant="h5"
|
||||
sx={{
|
||||
mt: 2,
|
||||
}}
|
||||
>
|
||||
Death
|
||||
</Typography>
|
||||
<Typography sx={{ opacity: 0.8 }}>
|
||||
File renamed without changes.
@@ -5,8 +5,7 @@ import CircularProgress from "@mui/material/CircularProgress";
|
||||
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import { getPlaylistsApi } from "@jellyfin/sdk/lib/utils/api/playlists-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import { getPlaylistApi } from "@jellyfin/sdk/lib/utils/api/playlist-api";
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
@@ -28,7 +27,7 @@ import { Typography } from "@mui/material";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { createPortal } from "react-dom";
|
||||
|
||||
export const Route = createFileRoute("/_api/playlist/$id")({
|
||||
export const Route = createFileRoute("/_api/music/playlist/$id")({
|
||||
component: PlaylistTitlePage,
|
||||
});
|
||||
|
||||
@@ -42,7 +41,7 @@ function PlaylistTitlePage() {
|
||||
queryKey: ["item", id],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getUserLibraryApi(api).getItem({
|
||||
const result = await getLibraryApi(api).getItem({
|
||||
userId: user?.Id,
|
||||
itemId: id,
|
||||
});
|
||||
@@ -75,7 +74,7 @@ function PlaylistTitlePage() {
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
if (!item.data?.Id) return null;
|
||||
const result = await getPlaylistsApi(api).getPlaylistItems({
|
||||
const result = await getPlaylistApi(api).getPlaylistItems({
|
||||
userId: user?.Id,
|
||||
playlistId: item.data.Id,
|
||||
});
|
||||
File renamed without changes.
@@ -1,429 +0,0 @@
|
||||
import { BaseItemKind, LocationType } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import Divider from "@mui/material/Divider";
|
||||
import Tab from "@mui/material/Tab";
|
||||
import Tabs from "@mui/material/Tabs";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { AnimatePresence, motion } from "motion/react";
|
||||
import React, {
|
||||
type ReactNode,
|
||||
useLayoutEffect,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import LikeButton from "@/components/buttons/likeButton";
|
||||
import { Card } from "@/components/card/card";
|
||||
import ItemHeader from "@/components/itemHeader";
|
||||
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
|
||||
import ShowMoreText from "@/components/showMoreText";
|
||||
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||
import "./person.scss";
|
||||
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import IconLink from "@/components/iconLink";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
|
||||
type TabPanelProps = {
|
||||
children: ReactNode;
|
||||
index: number;
|
||||
value: number;
|
||||
};
|
||||
|
||||
function TabPanel(props: TabPanelProps) {
|
||||
const { children, value, index, ...other } = props;
|
||||
|
||||
return (
|
||||
<div
|
||||
role="tabpanel"
|
||||
hidden={value !== index}
|
||||
id={`full-width-tabpanel-${index}`}
|
||||
aria-labelledby={`full-width-tab-${index}`}
|
||||
{...other}
|
||||
style={{ marginTop: "1em" }}
|
||||
>
|
||||
{value === index && <div>{children}</div>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export const Route = createFileRoute("/_api/person/$id")({
|
||||
component: PersonTitlePage,
|
||||
});
|
||||
|
||||
function PersonTitlePage() {
|
||||
const { id } = Route.useParams();
|
||||
const api = useApiInContext((s) => s.api);
|
||||
|
||||
const user = useCentralStore((s) => s.currentUser);
|
||||
|
||||
const item = useQuery({
|
||||
queryKey: ["item", id],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getUserLibraryApi(api).getItem({
|
||||
userId: user?.Id,
|
||||
itemId: id,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: !!user?.Id,
|
||||
networkMode: "always",
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const personMovies = useQuery({
|
||||
queryKey: ["item", id, "personMovies"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
personIds: [id],
|
||||
includeItemTypes: [BaseItemKind.Movie],
|
||||
recursive: true,
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
sortOrder: ["Descending"],
|
||||
excludeLocationTypes: [LocationType.Virtual],
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
});
|
||||
const personShows = useQuery({
|
||||
queryKey: ["item", id, "personShows"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
personIds: [id],
|
||||
includeItemTypes: [BaseItemKind.Series],
|
||||
recursive: true,
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
sortOrder: ["Descending"],
|
||||
excludeLocationTypes: [LocationType.Virtual],
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
});
|
||||
const personBooks = useQuery({
|
||||
queryKey: ["item", id, "personBooks"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
personIds: [id],
|
||||
includeItemTypes: [BaseItemKind.Book],
|
||||
recursive: true,
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
sortOrder: ["Descending"],
|
||||
excludeLocationTypes: [LocationType.Virtual],
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
});
|
||||
const personPhotos = useQuery({
|
||||
queryKey: ["item", id, "personPhotos"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
personIds: [id],
|
||||
includeItemTypes: [BaseItemKind.Photo],
|
||||
recursive: true,
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
excludeLocationTypes: [LocationType.Virtual],
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
});
|
||||
const personEpisodes = useQuery({
|
||||
queryKey: ["item", id, "personEpisodes"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getItemsApi(api).getItems({
|
||||
userId: user?.Id,
|
||||
personIds: [id],
|
||||
includeItemTypes: [BaseItemKind.Episode],
|
||||
recursive: true,
|
||||
fields: ["SeasonUserData", "Overview"],
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
excludeLocationTypes: [LocationType.Virtual],
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const [activePersonTab, setActivePersonTab] = useState(0);
|
||||
|
||||
const personTabs = [
|
||||
{
|
||||
title: "Movies",
|
||||
data: personMovies,
|
||||
queryKey: ["item", id, "personMovies"],
|
||||
},
|
||||
{
|
||||
title: "TV Shows",
|
||||
data: personShows,
|
||||
queryKey: ["item", id, "personShows"],
|
||||
},
|
||||
{
|
||||
title: "Books",
|
||||
data: personBooks,
|
||||
queryKey: ["item", id, "personBooks"],
|
||||
},
|
||||
{
|
||||
title: "Photos",
|
||||
data: personPhotos,
|
||||
queryKey: ["item", id, "personPhotos"],
|
||||
},
|
||||
{
|
||||
title: "Episodes",
|
||||
data: personEpisodes,
|
||||
queryKey: ["item", id, "personEpisodes"],
|
||||
},
|
||||
];
|
||||
|
||||
const setBackdrop = useBackdropStore((s) => s.setBackdrop);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (
|
||||
personMovies.isSuccess &&
|
||||
personShows.isSuccess &&
|
||||
personBooks.isSuccess &&
|
||||
personPhotos.isSuccess &&
|
||||
personEpisodes.isSuccess
|
||||
) {
|
||||
if (personMovies.data?.TotalRecordCount !== 0) {
|
||||
setActivePersonTab(0);
|
||||
} else if (personShows.data?.TotalRecordCount !== 0) {
|
||||
setActivePersonTab(1);
|
||||
} else if (personBooks.data?.TotalRecordCount !== 0) {
|
||||
setActivePersonTab(2);
|
||||
} else if (personPhotos.data?.TotalRecordCount !== 0) {
|
||||
setActivePersonTab(3);
|
||||
} else if (personEpisodes.data?.TotalRecordCount !== 0) {
|
||||
setActivePersonTab(4);
|
||||
}
|
||||
}
|
||||
setBackdrop("", "");
|
||||
}, [
|
||||
personMovies.isSuccess,
|
||||
personShows.isSuccess,
|
||||
personBooks.isSuccess,
|
||||
personPhotos.isSuccess,
|
||||
personEpisodes.isSuccess,
|
||||
]);
|
||||
|
||||
const [animationDirection, setAnimationDirection] = useState("forward");
|
||||
|
||||
const pageRef = useRef(null);
|
||||
|
||||
if (item.isPending) {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
width: "100%",
|
||||
height: "100vh",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
if (item.isSuccess && item.data) {
|
||||
return (
|
||||
<motion.div
|
||||
key={id}
|
||||
initial={{
|
||||
opacity: 0,
|
||||
}}
|
||||
animate={{
|
||||
opacity: 1,
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.25,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY padded-top item item-person flex flex-column"
|
||||
ref={pageRef}
|
||||
>
|
||||
<ItemHeader item={item.data} api={api}>
|
||||
<div className="item-hero-buttons-container flex flex-row">
|
||||
<div className="flex flex-row fullWidth" />
|
||||
<div className="flex flex-row" style={{ gap: "1em" }}>
|
||||
<LikeButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
queryKey={["item", id]}
|
||||
isFavorite={item.data.UserData?.IsFavorite}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</ItemHeader>
|
||||
<div className="item-detail">
|
||||
<div style={{ width: "100%" }}>
|
||||
<ShowMoreText
|
||||
content={item.data.Overview ?? ""}
|
||||
collapsedLines={4}
|
||||
/>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "0.6em",
|
||||
alignSelf: "end",
|
||||
marginTop: "1em",
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls?.map(
|
||||
(url) =>
|
||||
url.Name &&
|
||||
url.Url && <IconLink url={url.Url} name={url.Name} />,
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
{item.data.PremiereDate && (
|
||||
<div>
|
||||
<Typography variant="h6">Birth</Typography>
|
||||
<Typography variant="subtitle1" sx={{ opacity: 0.8 }}>
|
||||
{new Date(item.data.PremiereDate).toDateString()}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
{item.data.EndDate && (
|
||||
<div>
|
||||
<Typography variant="h6" mt={2}>
|
||||
Death
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" sx={{ opacity: 0.8 }}>
|
||||
{new Date(item.data.EndDate).toDateString()}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="item-detail-person-container">
|
||||
<div className="item-detail-person-header">
|
||||
<Tabs
|
||||
variant="scrollable"
|
||||
value={activePersonTab}
|
||||
onChange={(_, newVal) => {
|
||||
if (newVal > activePersonTab) {
|
||||
setAnimationDirection("forward");
|
||||
} else if (newVal < activePersonTab) {
|
||||
setAnimationDirection("backwards");
|
||||
}
|
||||
setActivePersonTab(newVal);
|
||||
}}
|
||||
>
|
||||
{personTabs.map((tab) => {
|
||||
return (
|
||||
<Tab
|
||||
key={tab.title}
|
||||
label={tab.title}
|
||||
disabled={tab.data.data?.TotalRecordCount === 0}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</Tabs>
|
||||
<Divider />
|
||||
</div>
|
||||
<AnimatePresence>
|
||||
{personTabs.map((tab, index) => {
|
||||
return (
|
||||
<TabPanel value={activePersonTab} index={index} key={tab.title}>
|
||||
<motion.div
|
||||
className={`item-detail-person-cards ${
|
||||
tab.title === "Movies" ||
|
||||
tab.title === "TV Shows" ||
|
||||
tab.title === "Books"
|
||||
? "col-7"
|
||||
: "col-4"
|
||||
}`}
|
||||
key={tab.queryKey.join("")}
|
||||
initial={{
|
||||
opacity: 0,
|
||||
transform:
|
||||
animationDirection === "forward"
|
||||
? "translate(30px)"
|
||||
: "translate(-30px)",
|
||||
}}
|
||||
animate={{
|
||||
opacity: 1,
|
||||
transform: "translate(0px)",
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.2,
|
||||
ease: "anticipate",
|
||||
}}
|
||||
>
|
||||
{tab.data.isSuccess &&
|
||||
tab.data.data?.Items?.map((tabitem) => {
|
||||
return (
|
||||
<Card
|
||||
key={tabitem.Id}
|
||||
item={tabitem}
|
||||
cardTitle={
|
||||
tabitem.Type === BaseItemKind.Episode
|
||||
? tabitem.SeriesName
|
||||
: tabitem.Name
|
||||
}
|
||||
imageType={"Primary"}
|
||||
cardCaption={
|
||||
tabitem.Type === BaseItemKind.Episode
|
||||
? `S${tabitem.ParentIndexNumber}:E${tabitem.IndexNumber} - ${tabitem.Name}`
|
||||
: tabitem.Type === BaseItemKind.Series
|
||||
? `${tabitem.ProductionYear} - ${
|
||||
tabitem.EndDate
|
||||
? new Date(
|
||||
tabitem.EndDate,
|
||||
).toLocaleString([], {
|
||||
year: "numeric",
|
||||
})
|
||||
: "Present"
|
||||
}`
|
||||
: tabitem.ProductionYear
|
||||
}
|
||||
cardType={
|
||||
tabitem.Type === BaseItemKind.Episode
|
||||
? "thumb"
|
||||
: "portrait"
|
||||
}
|
||||
queryKey={tab.queryKey}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</motion.div>
|
||||
</TabPanel>
|
||||
);
|
||||
})}
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
</motion.div>
|
||||
);
|
||||
}
|
||||
if (item.isError) {
|
||||
return <ErrorNotice />;
|
||||
}
|
||||
}
|
||||
|
||||
export default PersonTitlePage;
|
||||
@@ -1,89 +0,0 @@
|
||||
$cardWidth: 18%;
|
||||
.item-detail-person {
|
||||
&-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
&-header {
|
||||
width: 100%;
|
||||
}
|
||||
&-cards {
|
||||
display: grid;
|
||||
align-items: start;
|
||||
}
|
||||
}
|
||||
|
||||
.col-7 {
|
||||
grid-template-columns: repeat(7, minmax(0, 1fr));
|
||||
}
|
||||
.col-4 {
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.item-person.item {
|
||||
gap: 1em;
|
||||
|
||||
|
||||
.item-detail {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 35%;
|
||||
justify-items: center;
|
||||
align-items: start;
|
||||
gap: 3em;
|
||||
|
||||
&-cast {
|
||||
&-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
}
|
||||
&-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
gap: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
&-card {
|
||||
display: grid;
|
||||
grid-template-columns: 6em 1fr;
|
||||
gap: 0.5em;
|
||||
align-items: center;
|
||||
color: white !important;
|
||||
text-decoration: none;
|
||||
padding: 0.5em;
|
||||
background: rgb(255 255 255 / 0);
|
||||
transition: background $transition-time-default;
|
||||
border-radius: $border-radius-default;
|
||||
&:hover {
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
}
|
||||
&-image,
|
||||
&-icon {
|
||||
width: 6em;
|
||||
height: 6em;
|
||||
object-fit: cover;
|
||||
border-radius: 100%;
|
||||
box-shadow: $shadow-card-image;
|
||||
}
|
||||
&-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1em;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
.material-symbols-rounded {
|
||||
font-size: 3em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&-link {
|
||||
color: white;
|
||||
text-decoration-color: rgb(255 255 255 / 0.5);
|
||||
&:hover {
|
||||
text-decoration-color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,18 +58,22 @@ const AudioInfo = React.memo(
|
||||
<div className="audio-info">
|
||||
<Typography
|
||||
variant="h4"
|
||||
fontWeight={700}
|
||||
noWrap
|
||||
style={{ width: "100%", marginBottom: "0.2em" }}
|
||||
sx={{
|
||||
fontWeight: 700,
|
||||
}}
|
||||
>
|
||||
{item?.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="h6"
|
||||
fontWeight={400}
|
||||
className="opacity-07"
|
||||
noWrap
|
||||
style={{ width: "100%" }}
|
||||
sx={{
|
||||
fontWeight: 400,
|
||||
}}
|
||||
>
|
||||
{item?.Artists?.join(", ")}
|
||||
</Typography>
|
||||
@@ -251,4 +255,3 @@ function AudioPlayerRoute() {
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||
import { getSessionApi } from "@jellyfin/sdk/lib/utils/api/session-api";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import { WebviewWindow as appWindow } from "@tauri-apps/api/webviewWindow";
|
||||
import React, { useCallback, useEffect, useRef } from "react";
|
||||
@@ -12,14 +12,10 @@ import { RepeatMode } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { createFileRoute, useRouter } from "@tanstack/react-router";
|
||||
import JASSUB from "jassub";
|
||||
// @ts-expect-error
|
||||
import wasmUrl from "jassub/dist/wasm/jassub-worker.wasm?url"; // non-SIMD fallback
|
||||
// @ts-expect-error
|
||||
import modernWasmUrl from "jassub/dist/wasm/jassub-worker-modern.wasm?url"; // SIMD
|
||||
// @ts-expect-error
|
||||
import workerUrl from "jassub/dist/worker/worker.js?url"; // Web Worker
|
||||
import { PgsRenderer } from "libpgs";
|
||||
//@ts-expect-error
|
||||
import pgsWorkerUrl from "libpgs/dist/libpgs.worker.js?url";
|
||||
// import type { OnProgressProps } from "react-player";
|
||||
import { useShallow } from "zustand/shallow";
|
||||
@@ -36,7 +32,6 @@ import { useBackdropStore } from "@/utils/store/backdrop";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import useQueue, { clearQueue } from "@/utils/store/queue";
|
||||
import type subtitlePlaybackInfo from "@/utils/types/subtitlePlaybackInfo";
|
||||
//@ts-expect-error
|
||||
import font from "./Noto-Sans-Indosphere.ttf?url";
|
||||
|
||||
/**
|
||||
@@ -254,7 +249,7 @@ export function VideoPlayer() {
|
||||
setPlayerReady(true);
|
||||
|
||||
// Report Jellyfin server: Playback has begin
|
||||
getPlaystateApi(api).reportPlaybackStart({
|
||||
getSessionApi(api).reportPlaybackStart({
|
||||
playbackStartInfo: {
|
||||
AudioStreamIndex: mediaSource.audioTrack,
|
||||
CanSeek: true,
|
||||
@@ -297,7 +292,7 @@ export function VideoPlayer() {
|
||||
lastReportTimeRef.current = now;
|
||||
|
||||
// Report Jellyfin server: Playback progress
|
||||
getPlaystateApi(api).reportPlaybackProgress({
|
||||
getSessionApi(api).reportPlaybackProgress({
|
||||
playbackProgressInfo: {
|
||||
AudioStreamIndex: mediaSource.audioTrack,
|
||||
CanSeek: true,
|
||||
@@ -336,7 +331,7 @@ export function VideoPlayer() {
|
||||
}
|
||||
// Report Jellyfin server: Playback has been paused
|
||||
|
||||
getPlaystateApi(api).reportPlaybackProgress({
|
||||
getSessionApi(api).reportPlaybackProgress({
|
||||
playbackProgressInfo: {
|
||||
AudioStreamIndex: mediaSource.audioTrack,
|
||||
CanSeek: true,
|
||||
@@ -350,10 +345,10 @@ export function VideoPlayer() {
|
||||
PositionTicks: secToTicks(currentTime),
|
||||
RepeatMode: RepeatMode.RepeatNone,
|
||||
VolumeLevel: Math.floor(volume * 100),
|
||||
|
||||
},
|
||||
});
|
||||
}, [setCurrentTime,
|
||||
}, [
|
||||
setCurrentTime,
|
||||
api,
|
||||
mediaSource,
|
||||
isPlayerMuted,
|
||||
@@ -361,8 +356,8 @@ export function VideoPlayer() {
|
||||
itemId,
|
||||
playsessionId,
|
||||
userDataLastPlayedPositionTicks,
|
||||
volume,]);
|
||||
|
||||
volume,
|
||||
]);
|
||||
|
||||
const handleExitPlayer = useCallback(async () => {
|
||||
appWindow.getCurrent().setFullscreen(false);
|
||||
@@ -377,7 +372,7 @@ export function VideoPlayer() {
|
||||
}
|
||||
|
||||
// Report Jellyfin server: Playback has ended/stopped
|
||||
getPlaystateApi(api).reportPlaybackStopped({
|
||||
getSessionApi(api).reportPlaybackStopped({
|
||||
playbackStopInfo: {
|
||||
Failed: false,
|
||||
ItemId: itemId,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getPersonsApi } from "@jellyfin/sdk/lib/utils/api/persons-api";
|
||||
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import { getPersonApi } from "@jellyfin/sdk/lib/utils/api/person-api";
|
||||
import { getSearchApi } from "@jellyfin/sdk/lib/utils/api/search-api";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||
@@ -129,7 +129,13 @@ function SearchPage() {
|
||||
</span>
|
||||
<span className="material-symbols-rounded icon-md">tv</span>
|
||||
</Box>
|
||||
<Typography variant="h4" fontWeight={600} gutterBottom>
|
||||
<Typography
|
||||
variant="h4"
|
||||
gutterBottom
|
||||
sx={{
|
||||
fontWeight: 600,
|
||||
}}
|
||||
>
|
||||
Explore your library
|
||||
</Typography>
|
||||
<Typography variant="body1" sx={{ opacity: 0.6, maxWidth: 400 }}>
|
||||
@@ -319,9 +325,7 @@ function SearchAppBar({
|
||||
);
|
||||
}}
|
||||
MenuProps={{
|
||||
PaperProps: {
|
||||
className: "glass-menu-paper",
|
||||
},
|
||||
slotProps: { paper: { className: "glass-menu-paper" } },
|
||||
disableScrollLock: true,
|
||||
}}
|
||||
size="small"
|
||||
@@ -440,7 +444,7 @@ function CategorySection({ category, query, api, user, onResult }: any) {
|
||||
if (!api || !user?.Id) return { items: [], total: 0 };
|
||||
|
||||
if (category.value === "Person") {
|
||||
const res = await getPersonsApi(api).getPersons({
|
||||
const res = await getPersonApi(api).getPersons({
|
||||
userId: user.Id,
|
||||
searchTerm: query,
|
||||
limit,
|
||||
@@ -461,7 +465,7 @@ function CategorySection({ category, query, api, user, onResult }: any) {
|
||||
};
|
||||
}
|
||||
|
||||
const res = await getItemsApi(api).getItems({
|
||||
const res = await getLibraryApi(api).getItems({
|
||||
userId: user.Id,
|
||||
searchTerm: query,
|
||||
includeItemTypes: [category.kind],
|
||||
|
||||
@@ -1,940 +0,0 @@
|
||||
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import Box from "@mui/material/Box";
|
||||
import Chip from "@mui/material/Chip";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import Divider from "@mui/material/Divider";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import TextField from "@mui/material/TextField";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { motion } from "motion/react";
|
||||
import React, { useEffect, useMemo, useRef, useState } from "react";
|
||||
import { Card } from "@/components/card/card";
|
||||
import CardScroller from "@/components/cardScroller/cardScroller";
|
||||
import ItemHeader from "@/components/itemHeader";
|
||||
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
|
||||
import { getRuntimeCompact, getRuntimeMusic } from "@/utils/date/time";
|
||||
import useDefaultSeason from "@/utils/hooks/useDefaultSeason";
|
||||
import "./series.scss";
|
||||
|
||||
import { createFileRoute, Link, useNavigate } from "@tanstack/react-router";
|
||||
import LikeButton from "@/components/buttons/likeButton";
|
||||
import MarkPlayedButton from "@/components/buttons/markPlayedButton";
|
||||
import PlayButton from "@/components/buttons/playButton";
|
||||
import TrailerButton from "@/components/buttons/trailerButton";
|
||||
import IconLink from "@/components/iconLink";
|
||||
import ShowMoreText from "@/components/showMoreText";
|
||||
import EpisodeSkeleton from "@/components/skeleton/episode";
|
||||
import { SeasonSelectorSkeleton } from "@/components/skeleton/seasonSelector";
|
||||
import { getTypeIcon } from "@/components/utils/iconsCollection";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
|
||||
const getEpisodeDateString = (date: Date) => {
|
||||
const formatter = new Intl.DateTimeFormat(navigator.language ?? "en-US", {
|
||||
dateStyle: "full",
|
||||
});
|
||||
return formatter.format(date).toString();
|
||||
};
|
||||
|
||||
export const Route = createFileRoute("/_api/series/$id")({
|
||||
component: SeriesTitlePage,
|
||||
});
|
||||
|
||||
function SeriesTitlePage() {
|
||||
const { id } = Route.useParams();
|
||||
|
||||
const api = Route.useRouteContext().api;
|
||||
|
||||
const setBackdrop = useBackdropStore((s) => s.setBackdrop);
|
||||
|
||||
const user = useCentralStore((s) => s.currentUser);
|
||||
|
||||
const item = useQuery({
|
||||
queryKey: ["item", id],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getUserLibraryApi(api).getItem({
|
||||
userId: user?.Id,
|
||||
itemId: id,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: !!user?.Id,
|
||||
networkMode: "always",
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const similarItems = useQuery({
|
||||
queryKey: ["item", id, "similarItem"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getLibraryApi(api).getSimilarShows({
|
||||
userId: user?.Id,
|
||||
itemId: id,
|
||||
limit: 16,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
});
|
||||
|
||||
const seasons = useQuery({
|
||||
queryKey: ["item", id, "seasons"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getTvShowsApi(api).getSeasons({
|
||||
userId: user?.Id,
|
||||
seriesId: id,
|
||||
isMissing: false,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
});
|
||||
|
||||
const [backdropImage, setBackdropImage] = useState<SeriesBackdropImage>(
|
||||
() => {
|
||||
const url = sessionStorage.getItem(`backdrop-${item.data?.Id}`);
|
||||
const key = sessionStorage.getItem(`backdrop-${item.data?.Id}-key`);
|
||||
return { url, key };
|
||||
},
|
||||
);
|
||||
const [_backdropImageLoaded, setBackdropImageLoaded] = useState(false);
|
||||
|
||||
const [currentSeason, setCurrentSeason] = useDefaultSeason(
|
||||
seasons,
|
||||
item.data?.Id,
|
||||
);
|
||||
|
||||
const currentSeasonNumber = Number(currentSeason);
|
||||
|
||||
const currentSeasonItem = useQuery({
|
||||
queryKey: ["item", id, "season", currentSeason],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getUserLibraryApi(api).getItem({
|
||||
userId: user?.Id,
|
||||
itemId: seasons.data?.Items?.[Number(currentSeason)].Id ?? "",
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: seasons.isSuccess,
|
||||
networkMode: "always",
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const episodes = useQuery({
|
||||
queryKey: ["item", id, "season", currentSeason, "episodes"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getTvShowsApi(api).getEpisodes({
|
||||
userId: user?.Id,
|
||||
seriesId: item.data?.Id ?? "",
|
||||
seasonId: seasons.data?.Items?.[Number(currentSeason)].Id,
|
||||
fields: [ItemFields.Overview],
|
||||
isMissing: false,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: seasons.isSuccess,
|
||||
networkMode: "always",
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const specialFeatures = useQuery({
|
||||
queryKey: ["item", id, "specialFeatures"],
|
||||
queryFn: async () => {
|
||||
if (!api) return null;
|
||||
const result = await getUserLibraryApi(api).getSpecialFeatures({
|
||||
itemId: item.data?.Id ?? "",
|
||||
userId: user?.Id,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: item.isSuccess,
|
||||
});
|
||||
|
||||
const directors = useMemo(() => {
|
||||
return item.data?.People?.filter((itm) => itm.Type === "Director") ?? [];
|
||||
}, [item.data?.Id]);
|
||||
const writers = useMemo(() => {
|
||||
return item.data?.People?.filter((itm) => itm.Type === "Writer") ?? [];
|
||||
}, [item.data?.Id]);
|
||||
const actors = useMemo(() => {
|
||||
return item.data?.People?.filter((itm) => itm.Type === "Actor") ?? [];
|
||||
}, [item.data?.Id]);
|
||||
const producers = useMemo(() => {
|
||||
return item.data?.People?.filter((itm) => itm.Type === "Producer") ?? [];
|
||||
}, [item.data?.Id]);
|
||||
|
||||
const lastBackdropHashRef = useRef<string | undefined>(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
if (api && currentSeasonItem.isSuccess && item.isSuccess) {
|
||||
if (
|
||||
currentSeasonItem.isSuccess &&
|
||||
(currentSeasonItem.data?.BackdropImageTags?.length ?? 0) > 0
|
||||
) {
|
||||
sessionStorage.setItem(
|
||||
`backdrop-${item.data?.Id}`,
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
currentSeasonItem.data?.Id ?? "",
|
||||
"Backdrop",
|
||||
{
|
||||
tag: currentSeasonItem.data?.BackdropImageTags?.[0],
|
||||
},
|
||||
),
|
||||
);
|
||||
sessionStorage.setItem(
|
||||
`backdrop-${item.data?.Id}-key`,
|
||||
currentSeasonItem.data?.BackdropImageTags?.[0] ?? "",
|
||||
);
|
||||
setBackdropImage({
|
||||
url: getImageUrlsApi(api).getItemImageUrlById(
|
||||
currentSeasonItem.data?.Id ?? "",
|
||||
"Backdrop",
|
||||
{
|
||||
tag: currentSeasonItem.data?.BackdropImageTags?.[0],
|
||||
},
|
||||
),
|
||||
key: currentSeasonItem.data?.BackdropImageTags?.[0],
|
||||
});
|
||||
const seasonBackdropTag =
|
||||
currentSeasonItem.data?.BackdropImageTags?.[0];
|
||||
const seasonBackdropHash =
|
||||
currentSeasonItem.data?.ImageBlurHashes?.Backdrop?.[
|
||||
seasonBackdropTag ?? ""
|
||||
] ?? "";
|
||||
|
||||
if (lastBackdropHashRef.current !== seasonBackdropHash) {
|
||||
setBackdrop(seasonBackdropHash);
|
||||
lastBackdropHashRef.current = seasonBackdropHash;
|
||||
}
|
||||
setBackdropImageLoaded(false);
|
||||
} else if (
|
||||
item.isSuccess &&
|
||||
(item.data?.BackdropImageTags?.length ?? 0) > 0
|
||||
) {
|
||||
sessionStorage.setItem(
|
||||
`backdrop-${item.data?.Id}`,
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data?.Id ?? "",
|
||||
"Backdrop",
|
||||
{
|
||||
tag: item.data?.BackdropImageTags?.[0],
|
||||
},
|
||||
),
|
||||
);
|
||||
sessionStorage.setItem(
|
||||
`backdrop-${item.data?.Id}-key`,
|
||||
item.data?.BackdropImageTags?.[0] ?? "",
|
||||
);
|
||||
if (backdropImage.key !== item.data?.BackdropImageTags?.[0]) {
|
||||
setBackdropImageLoaded(false); // Reset Backdrop image load status if previous image is diff then new image
|
||||
}
|
||||
setBackdropImage({
|
||||
url: getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.data?.Id ?? "",
|
||||
"Backdrop",
|
||||
{
|
||||
tag: item.data?.BackdropImageTags?.[0],
|
||||
},
|
||||
),
|
||||
key: item.data?.BackdropImageTags?.[0],
|
||||
});
|
||||
const seriesBackdropTag = item.data?.BackdropImageTags?.[0];
|
||||
const seriesBackdropHash =
|
||||
item.data?.ImageBlurHashes?.Backdrop?.[seriesBackdropTag ?? ""] ?? "";
|
||||
|
||||
if (lastBackdropHashRef.current !== seriesBackdropHash) {
|
||||
setBackdrop(seriesBackdropHash);
|
||||
lastBackdropHashRef.current = seriesBackdropHash;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [
|
||||
api,
|
||||
currentSeasonItem.data,
|
||||
currentSeasonItem.isSuccess,
|
||||
item.data,
|
||||
item.isSuccess,
|
||||
setBackdrop,
|
||||
backdropImage.key,
|
||||
]);
|
||||
|
||||
const containerRef = useRef<HTMLDivElement | null>(null);
|
||||
// Parallax handled within ItemBackdrop to avoid hydration issues.
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
if (item.isPending || similarItems.isPending) {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
width: "100%",
|
||||
height: "100vh",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
if (item.isSuccess && item.data) {
|
||||
return (
|
||||
<motion.div
|
||||
key={id}
|
||||
initial={{
|
||||
opacity: 0,
|
||||
}}
|
||||
animate={{
|
||||
opacity: 1,
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.25,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY padded-top flex flex-column item item-series"
|
||||
ref={containerRef}
|
||||
>
|
||||
<ItemHeader
|
||||
item={item.data}
|
||||
api={api}
|
||||
scrollTargetRef={containerRef}
|
||||
backdropSrc={backdropImage.url}
|
||||
>
|
||||
<div className="item-hero-buttons-container">
|
||||
<div
|
||||
className="flex flex-row"
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<PlayButton
|
||||
item={item.data}
|
||||
itemType={BaseItemKind.Series}
|
||||
userId={user?.Id}
|
||||
buttonProps={{
|
||||
fullWidth: true,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-row" style={{ gap: "1em" }}>
|
||||
{item.data.RemoteTrailers && (
|
||||
<TrailerButton
|
||||
trailerItem={item.data.RemoteTrailers}
|
||||
disabled={item.data.RemoteTrailers?.length === 0}
|
||||
/>
|
||||
)}
|
||||
<LikeButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
queryKey={["item", id]}
|
||||
isFavorite={item.data.UserData?.IsFavorite}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
<MarkPlayedButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
queryKey={["item", id]}
|
||||
isPlayed={item.data.UserData?.Played}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</ItemHeader>
|
||||
<div className="item-detail">
|
||||
<div style={{ width: "100%" }}>
|
||||
{(item.data.Taglines?.length ?? 0) > 0 && (
|
||||
<Typography variant="h5" mb={2}>
|
||||
{item.data.Taglines?.[0]}
|
||||
</Typography>
|
||||
)}
|
||||
<ShowMoreText
|
||||
content={item.data.Overview ?? ""}
|
||||
collapsedLines={4}
|
||||
/>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "0.6em",
|
||||
alignSelf: "end",
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls?.map(
|
||||
(url) =>
|
||||
url.Url &&
|
||||
url.Name && (
|
||||
<IconLink key={url.Url} url={url.Url} name={url.Name} />
|
||||
),
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<div className="item-detail-cast">
|
||||
{actors?.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6" className="item-detail-cast-title">
|
||||
Actors
|
||||
</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{actors.map((actor) => (
|
||||
<Link
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to="/person/$id"
|
||||
params={{
|
||||
id: actor.Id ?? "",
|
||||
}}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name ?? ""}
|
||||
src={
|
||||
api &&
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id ?? "",
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)
|
||||
}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{writers.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6" className="item-detail-cast-title">
|
||||
Writers
|
||||
</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{writers.map((actor) => (
|
||||
<Link
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to="/person/$id"
|
||||
params={{
|
||||
id: actor.Id ?? "",
|
||||
}}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name ?? ""}
|
||||
src={
|
||||
api &&
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id ?? "",
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)
|
||||
}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{directors.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6" className="item-detail-cast-title">
|
||||
Directors
|
||||
</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{directors.map((actor) => (
|
||||
<Link
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to="/person/$id"
|
||||
params={{
|
||||
id: actor.Id ?? "",
|
||||
}}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name ?? ""}
|
||||
src={
|
||||
api &&
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id ?? "",
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)
|
||||
}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{producers.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6" className="item-detail-cast-title">
|
||||
Producers
|
||||
</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{producers.map((actor) => (
|
||||
<Link
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to="/person/$id"
|
||||
params={{
|
||||
id: actor.Id ?? "",
|
||||
}}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name ?? ""}
|
||||
src={
|
||||
api &&
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
actor.Id ?? "",
|
||||
"Primary",
|
||||
{
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
},
|
||||
)
|
||||
}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
</div>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{actor.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{seasons.isPending ? (
|
||||
<SeasonSelectorSkeleton />
|
||||
) : (
|
||||
<div className="item-series-seasons-container">
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
width: "100%",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
paddingBottom: " 0.5em",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "1em",
|
||||
}}
|
||||
>
|
||||
<Typography variant="h5">
|
||||
{seasons.data?.Items?.[Number(currentSeason)]?.Name}
|
||||
</Typography>
|
||||
<Chip
|
||||
label={
|
||||
episodes.isPending ? (
|
||||
<CircularProgress
|
||||
size={20}
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
episodes.data?.TotalRecordCount
|
||||
)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "0.75em",
|
||||
}}
|
||||
>
|
||||
{currentSeasonItem.isSuccess && (
|
||||
<LikeButton
|
||||
itemId={currentSeasonItem.data?.Id}
|
||||
isFavorite={currentSeasonItem.data?.UserData?.IsFavorite}
|
||||
queryKey={["item", id]}
|
||||
userId={user?.Id}
|
||||
itemName={currentSeasonItem.data?.Name}
|
||||
/>
|
||||
)}
|
||||
{currentSeasonItem.isSuccess && (
|
||||
<MarkPlayedButton
|
||||
itemId={currentSeasonItem.data?.Id}
|
||||
isPlayed={currentSeasonItem.data?.UserData?.Played}
|
||||
queryKey={["item", id]}
|
||||
userId={user?.Id}
|
||||
itemName={currentSeasonItem.data?.Name}
|
||||
/>
|
||||
)}
|
||||
<TextField
|
||||
value={currentSeasonNumber}
|
||||
onChange={(e) => {
|
||||
const seasonIndex = Number(e.target.value);
|
||||
if (
|
||||
!Number.isNaN(seasonIndex) &&
|
||||
Number.isFinite(seasonIndex)
|
||||
) {
|
||||
setCurrentSeason(seasonIndex);
|
||||
sessionStorage.setItem(
|
||||
`season-${item.data?.Id}`,
|
||||
seasonIndex.toString(),
|
||||
);
|
||||
}
|
||||
}}
|
||||
select
|
||||
SelectProps={{
|
||||
MenuProps: {
|
||||
disableScrollLock: true,
|
||||
},
|
||||
}}
|
||||
size="small"
|
||||
>
|
||||
{seasons.data?.Items?.map((season, index) => {
|
||||
return (
|
||||
<MenuItem key={season.Id} value={index}>
|
||||
{season.Name}
|
||||
</MenuItem>
|
||||
);
|
||||
})}
|
||||
</TextField>
|
||||
</div>
|
||||
</div>
|
||||
<Divider />
|
||||
<div className="item-detail-episode-container">
|
||||
{episodes.isPending ? (
|
||||
<EpisodeSkeleton />
|
||||
) : (
|
||||
episodes.data?.Items?.map((episode) => {
|
||||
return (
|
||||
<motion.div
|
||||
key={episode.Id}
|
||||
onClick={() =>
|
||||
navigate({
|
||||
to: "/episode/$id",
|
||||
params: { id: episode.Id ?? "" },
|
||||
})
|
||||
}
|
||||
initial={{
|
||||
transform: "translateY(10px)",
|
||||
opacity: 0,
|
||||
}}
|
||||
whileInView={{
|
||||
opacity: 1,
|
||||
transform: "translateY(0px)",
|
||||
}}
|
||||
viewport={{
|
||||
once: true,
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.2,
|
||||
ease: "backInOut",
|
||||
}}
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
className="item-detail-episode"
|
||||
>
|
||||
<Typography variant="subtitle1" textAlign="center">
|
||||
{episode.IndexNumberEnd
|
||||
? `${episode.IndexNumber} / ${episode.IndexNumberEnd}`
|
||||
: (episode.IndexNumber ?? 0)}
|
||||
</Typography>
|
||||
<div
|
||||
className={
|
||||
episode.UserData?.Played
|
||||
? "item-detail-episode-image-container watched"
|
||||
: "item-detail-episode-image-container"
|
||||
}
|
||||
>
|
||||
<div className="item-detail-episode-image-overlay">
|
||||
<PlayButton
|
||||
item={episode}
|
||||
itemType={BaseItemKind.Episode}
|
||||
userId={user?.Id}
|
||||
size="medium"
|
||||
buttonProps={{
|
||||
//@ts-expect-error
|
||||
color: "white",
|
||||
style: {
|
||||
color: "black ",
|
||||
},
|
||||
}}
|
||||
iconOnly
|
||||
/>
|
||||
</div>
|
||||
<div className="item-detail-episode-image-icon-container">
|
||||
<span className="material-symbols-rounded item-detail-episode-image-icon">
|
||||
tv_gen
|
||||
</span>
|
||||
</div>
|
||||
<img
|
||||
alt={episode.Name ?? ""}
|
||||
src={
|
||||
api &&
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
episode.Id ?? "",
|
||||
"Primary",
|
||||
{
|
||||
tag: episode.ImageTags?.Primary,
|
||||
fillHeight: 300,
|
||||
},
|
||||
)
|
||||
}
|
||||
className="item-detail-episode-image"
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = "1";
|
||||
}}
|
||||
/>
|
||||
{(episode.UserData?.PlaybackPositionTicks ?? 0) > 0 && (
|
||||
<div className="card-progress-container">
|
||||
<div
|
||||
className="card-progress"
|
||||
style={{
|
||||
width: `${episode.UserData?.PlayedPercentage}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="item-detail-episode-info">
|
||||
<Typography variant="subtitle1">
|
||||
{episode.Name}
|
||||
</Typography>
|
||||
<div
|
||||
className="flex flex-row flex-align-center"
|
||||
style={{
|
||||
gap: "0.5em",
|
||||
}}
|
||||
>
|
||||
{episode.PremiereDate && (
|
||||
<Chip
|
||||
variant="filled"
|
||||
label={getEpisodeDateString(
|
||||
new Date(episode.PremiereDate),
|
||||
)}
|
||||
size="small"
|
||||
/>
|
||||
)}
|
||||
<Typography variant="caption">
|
||||
{getRuntimeCompact(episode.RunTimeTicks ?? 0)}
|
||||
</Typography>
|
||||
</div>
|
||||
<Typography
|
||||
variant="caption"
|
||||
style={{
|
||||
display: "-webkit-box",
|
||||
textOverflow: "ellipsis",
|
||||
overflow: "hidden",
|
||||
WebkitLineClamp: 2,
|
||||
WebkitBoxOrient: "vertical",
|
||||
width: "100%",
|
||||
opacity: 0.7,
|
||||
}}
|
||||
>
|
||||
{episode.Overview}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="item-detail-episode-buttons">
|
||||
<LikeButton
|
||||
itemId={episode.Id}
|
||||
itemName={episode.Name}
|
||||
isFavorite={episode.UserData?.IsFavorite}
|
||||
queryKey={["item", id]}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
<MarkPlayedButton
|
||||
itemId={episode.Id}
|
||||
itemName={episode.Name}
|
||||
isPlayed={episode.UserData?.Played}
|
||||
queryKey={["item", id]}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
</div>
|
||||
</motion.div>
|
||||
);
|
||||
})
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{specialFeatures.isSuccess &&
|
||||
(specialFeatures.data?.length ?? 0) > 0 && (
|
||||
<CardScroller
|
||||
title="Special Features"
|
||||
displayCards={7}
|
||||
disableDecoration
|
||||
>
|
||||
{specialFeatures.data?.map((special) => {
|
||||
return (
|
||||
<Card
|
||||
key={special.Id}
|
||||
item={special}
|
||||
seriesId={special.SeriesId}
|
||||
cardTitle={special.Name}
|
||||
imageType="Primary"
|
||||
cardCaption={getRuntimeMusic(special.RunTimeTicks ?? 0)}
|
||||
cardType="portrait"
|
||||
queryKey={["item", id, "similarItem"]}
|
||||
userId={user?.Id}
|
||||
onClick={() => {}}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
)}
|
||||
{(similarItems.data?.TotalRecordCount ?? 0) > 0 && (
|
||||
<CardScroller
|
||||
title="You might also like"
|
||||
displayCards={7}
|
||||
disableDecoration
|
||||
>
|
||||
{similarItems.data?.Items?.map((similar) => {
|
||||
return (
|
||||
<Card
|
||||
key={similar.Id}
|
||||
item={similar}
|
||||
seriesId={similar.SeriesId}
|
||||
cardTitle={
|
||||
similar.Type === BaseItemKind.Episode
|
||||
? similar.SeriesName
|
||||
: similar.Name
|
||||
}
|
||||
imageType={"Primary"}
|
||||
cardCaption={
|
||||
similar.Type === BaseItemKind.Episode
|
||||
? `S${similar.ParentIndexNumber}:E${similar.IndexNumber} - ${similar.Name}`
|
||||
: similar.Type === BaseItemKind.Series
|
||||
? `${similar.ProductionYear} - ${
|
||||
similar.EndDate
|
||||
? new Date(similar.EndDate).toLocaleString([], {
|
||||
year: "numeric",
|
||||
})
|
||||
: "Present"
|
||||
}`
|
||||
: similar.ProductionYear
|
||||
}
|
||||
cardType={
|
||||
similar.Type === BaseItemKind.MusicAlbum ||
|
||||
similar.Type === BaseItemKind.Audio
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
queryKey={["item", id, "similarItem"]}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
)}
|
||||
</motion.div>
|
||||
);
|
||||
}
|
||||
if (item.isError || similarItems.isError) {
|
||||
return <ErrorNotice />;
|
||||
}
|
||||
}
|
||||
|
||||
export default SeriesTitlePage;
|
||||
@@ -1,210 +0,0 @@
|
||||
$cardWidth: 18%;
|
||||
|
||||
.item-series.item {
|
||||
gap: 1em;
|
||||
|
||||
.item-detail {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 35%;
|
||||
justify-items: center;
|
||||
align-items: start;
|
||||
gap: 3em;
|
||||
|
||||
&-nextUp {
|
||||
max-width: 23em;
|
||||
}
|
||||
|
||||
&-cast {
|
||||
max-height: 50vh;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
mask-image: linear-gradient(to top, transparent, black 1.2em);
|
||||
-webkit-mask-image: linear-gradient(to top, transparent, black 1.2em);
|
||||
&-title {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background: black;
|
||||
border:1px solid rgb(255 255 255 / 0.2) ;
|
||||
padding: 0.35em;
|
||||
border-radius: 10px;
|
||||
z-index: 1;
|
||||
}
|
||||
&-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
}
|
||||
&-grid {
|
||||
display: grid;
|
||||
gap: 1em;
|
||||
margin-bottom: 1em;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
&-card {
|
||||
display: grid;
|
||||
grid-template-columns: 6em 1fr;
|
||||
gap: 0.5em;
|
||||
align-items: center;
|
||||
color: white !important;
|
||||
text-decoration: none;
|
||||
padding: 0.5em;
|
||||
background: rgb(255 255 255 / 0);
|
||||
transition: background $transition-time-default;
|
||||
border-radius: $border-radius-default;
|
||||
&:hover {
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
}
|
||||
&-image,
|
||||
&-icon {
|
||||
width: 6em;
|
||||
height: 6em;
|
||||
object-fit: cover;
|
||||
border-radius: 100%;
|
||||
box-shadow: $shadow-card-image;
|
||||
}
|
||||
&-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1em;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
.material-symbols-rounded {
|
||||
font-size: 3em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&-link {
|
||||
color: white;
|
||||
text-decoration-color: rgb(255 255 255 / 0.5);
|
||||
&:hover {
|
||||
text-decoration-color: white;
|
||||
}
|
||||
}
|
||||
&-episode{
|
||||
display:grid;
|
||||
grid-template-columns: 3.2em 12em 1fr 6em;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
gap:1.8em;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
padding: 1em 0;
|
||||
|
||||
&-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: nowrap;
|
||||
gap: 0.5em;
|
||||
margin-top: 0.5em;
|
||||
width: 100%;
|
||||
}
|
||||
&-image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
opacity: 0;
|
||||
transition: opacity $transition-time-default;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 0;
|
||||
&-container{
|
||||
width: 100%;
|
||||
aspect-ratio: 1.66666;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-radius: $border-radius-default;
|
||||
flex-shrink: 0;
|
||||
&::after{
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
border: 0.65em solid #00c853;
|
||||
border-bottom-color: transparent;
|
||||
border-left-color: transparent;
|
||||
opacity: 0;
|
||||
transition: opacity $transition-time-default;
|
||||
}
|
||||
&.watched::after {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
&-overlay{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
opacity: 0;
|
||||
transition: opacity $transition-time-default;
|
||||
z-index: 2;
|
||||
}
|
||||
&-icon {
|
||||
font-size: 3em;
|
||||
&-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
&-info{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
gap: 0.4em;
|
||||
width: 100%;
|
||||
padding-right: 2em;
|
||||
}
|
||||
&-buttons{
|
||||
display: flex;
|
||||
gap: 1em;
|
||||
}
|
||||
|
||||
&:hover .item-detail-episode-image-overlay, &:focus-within .item-detail-episode-image-overlay{
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1320px) {
|
||||
.item-series .item-detail {
|
||||
&-cast {
|
||||
&-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
&-episodes-container {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 830px) {
|
||||
.item-series .item-detail {
|
||||
&-episodes-container {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 564px) {
|
||||
.item-series .item-detail {
|
||||
&-episodes-container {
|
||||
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,12 @@ function SettingsRoute() {
|
||||
alt="user"
|
||||
/>
|
||||
<div className="flex flex-column">
|
||||
<Typography variant="h6" fontWeight="bold">
|
||||
<Typography
|
||||
variant="h6"
|
||||
sx={{
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
{user?.Name}
|
||||
</Typography>
|
||||
<Typography variant="body2" sx={{ opacity: 0.5 }}>
|
||||
|
||||
@@ -217,19 +217,22 @@ function ChangeServerRoute() {
|
||||
<Typography
|
||||
variant="h5"
|
||||
component="div"
|
||||
fontWeight="bold"
|
||||
noWrap
|
||||
title={server.systemInfo?.ServerName || "Unknown Server"}
|
||||
sx={{ mb: 0.5, letterSpacing: "-0.02em" }}
|
||||
sx={{
|
||||
fontWeight: "bold",
|
||||
mb: 0.5,
|
||||
letterSpacing: "-0.02em",
|
||||
}}
|
||||
>
|
||||
{server.systemInfo?.ServerName || "Unknown Server"}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="body2"
|
||||
color="text.secondary"
|
||||
noWrap
|
||||
title={server.address}
|
||||
sx={{
|
||||
color: "text.secondary",
|
||||
opacity: 0.6,
|
||||
fontFamily: "monospace",
|
||||
fontSize: "0.85rem",
|
||||
@@ -358,10 +361,21 @@ function ChangeServerRoute() {
|
||||
add
|
||||
</span>
|
||||
</div>
|
||||
<Typography variant="h6" fontWeight="bold">
|
||||
<Typography
|
||||
variant="h6"
|
||||
sx={{
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
Add Server
|
||||
</Typography>
|
||||
<Typography variant="body2" color="text.secondary" sx={{ mt: 1 }}>
|
||||
<Typography
|
||||
variant="body2"
|
||||
sx={{
|
||||
color: "text.secondary",
|
||||
mt: 1,
|
||||
}}
|
||||
>
|
||||
Connect to a new Jellyfin server
|
||||
</Typography>
|
||||
</Card>
|
||||
|
||||
@@ -11,8 +11,8 @@ import React from "react";
|
||||
|
||||
import "../settings.scss";
|
||||
import { getLocalizationApi } from "@jellyfin/sdk/lib/utils/api/localization-api";
|
||||
// import { getDisplayPreferencesApi } from "@jellyfin/sdk/lib/utils/api/display-preferences-api";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
// import { getDisplayPreferenceApi } from "@jellyfin/sdk/lib/utils/api/display-preference-api";
|
||||
import { useForm } from "@tanstack/react-form";
|
||||
import { useSuspenseQuery } from "@tanstack/react-query";
|
||||
import { useSnackbar } from "notistack";
|
||||
@@ -61,7 +61,7 @@ function RouteComponent() {
|
||||
RememberSubtitleSelections: values.value.rememberSubtitleSelections,
|
||||
},
|
||||
});
|
||||
// await getDisplayPreferencesApi(api).updateDisplayPreferences({
|
||||
// await getDisplayPreferenceApi(api).updateDisplayPreferences({
|
||||
// userId: user?.Id,
|
||||
// displayPreferencesId: api.deviceInfo.id,
|
||||
// client: "blink",
|
||||
@@ -127,7 +127,12 @@ function RouteComponent() {
|
||||
}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="subtitle1" fontWeight={400}>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
sx={{
|
||||
fontWeight: 400,
|
||||
}}
|
||||
>
|
||||
Preferred Audio Language
|
||||
</Typography>
|
||||
<Typography
|
||||
@@ -160,7 +165,12 @@ function RouteComponent() {
|
||||
}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="subtitle1" fontWeight={400}>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
sx={{
|
||||
fontWeight: 400,
|
||||
}}
|
||||
>
|
||||
Play default audio track regardless of language
|
||||
</Typography>
|
||||
<Typography
|
||||
@@ -212,7 +222,12 @@ function RouteComponent() {
|
||||
}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="subtitle1" fontWeight={400}>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
sx={{
|
||||
fontWeight: 400,
|
||||
}}
|
||||
>
|
||||
Preferred Subtitle Language
|
||||
</Typography>
|
||||
<Typography
|
||||
@@ -245,7 +260,12 @@ function RouteComponent() {
|
||||
}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="subtitle1" fontWeight={400}>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
sx={{
|
||||
fontWeight: 400,
|
||||
}}
|
||||
>
|
||||
Set subtitle track based on previous item
|
||||
</Typography>
|
||||
<Typography
|
||||
|
||||
@@ -22,7 +22,12 @@ function ErrorRoute() {
|
||||
>
|
||||
report
|
||||
</span>
|
||||
<Typography variant="h5" fontWeight={500}>
|
||||
<Typography
|
||||
variant="h5"
|
||||
sx={{
|
||||
fontWeight: 500,
|
||||
}}
|
||||
>
|
||||
Error connecting server.
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" style={{ opacity: 0.6 }}>
|
||||
@@ -49,4 +54,4 @@ function ErrorRoute() {
|
||||
default:
|
||||
return <div>Error</div>;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,13 @@ function ServerSetup() {
|
||||
overflow: "hidden",
|
||||
}}
|
||||
>
|
||||
<Stack spacing={2} width="30em" alignItems="center">
|
||||
<Stack
|
||||
spacing={2}
|
||||
sx={{
|
||||
width: "30em",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<img
|
||||
src={logo}
|
||||
alt="Blink"
|
||||
@@ -94,10 +100,12 @@ function ServerSetup() {
|
||||
|
||||
<Typography
|
||||
variant="body1"
|
||||
color="text.secondary"
|
||||
textAlign="center"
|
||||
maxWidth="80%"
|
||||
sx={{ lineHeight: 1.5 }}
|
||||
sx={{
|
||||
color: "text.secondary",
|
||||
textAlign: "center",
|
||||
maxWidth: "80%",
|
||||
lineHeight: 1.5,
|
||||
}}
|
||||
>
|
||||
Enter your Jellyfin server address to get started
|
||||
</Typography>
|
||||
@@ -116,15 +124,17 @@ function ServerSetup() {
|
||||
onChange={(event) => {
|
||||
setServerIp(event.target.value);
|
||||
}}
|
||||
InputProps={{
|
||||
startAdornment: (
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{ opacity: 0.5, marginRight: "12px" }}
|
||||
>
|
||||
dns
|
||||
</span>
|
||||
),
|
||||
slotProps={{
|
||||
input: {
|
||||
startAdornment: (
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{ opacity: 0.5, marginRight: "12px" }}
|
||||
>
|
||||
dns
|
||||
</span>
|
||||
),
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<LoadingButton
|
||||
@@ -142,8 +152,11 @@ function ServerSetup() {
|
||||
<Stack
|
||||
direction="row"
|
||||
spacing={1}
|
||||
alignItems="center"
|
||||
sx={{ mt: 3, opacity: 0.6 }}
|
||||
sx={{
|
||||
alignItems: "center",
|
||||
mt: 3,
|
||||
opacity: 0.6,
|
||||
}}
|
||||
>
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
|
||||
@@ -131,7 +131,12 @@ function ServerList() {
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Typography variant="h4" fontWeight="bold">
|
||||
<Typography
|
||||
variant="h4"
|
||||
sx={{
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
Servers
|
||||
</Typography>
|
||||
<IconButton
|
||||
@@ -170,8 +175,8 @@ function ServerList() {
|
||||
<div style={{ flex: 1 }}>
|
||||
<Typography
|
||||
variant="h6"
|
||||
fontWeight={600}
|
||||
sx={{
|
||||
fontWeight: 600,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
gap: 1,
|
||||
|
||||
Reference in new issue
Block a user