Update itemDetail pages and improve some stylings #243
This commit is contained in:
13 files changed
+877
-456
No files matched your search
@@ -1,15 +1,20 @@
|
||||
import PropTypes from "prop-types";
|
||||
import React from "react";
|
||||
|
||||
import Button from "@mui/material/Button";
|
||||
import Button, {
|
||||
ButtonProps,
|
||||
ButtonPropsSizeOverrides,
|
||||
} from "@mui/material/Button";
|
||||
import Fab from "@mui/material/Fab";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import {
|
||||
BaseItemDto,
|
||||
BaseItemKind,
|
||||
ItemFields,
|
||||
SortOrder,
|
||||
UserItemDataDto,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getPlaylistsApi } from "@jellyfin/sdk/lib/utils/api/playlists-api";
|
||||
@@ -25,7 +30,10 @@ import {
|
||||
usePlaybackStore,
|
||||
} from "../../utils/store/playback";
|
||||
|
||||
import { SxProps } from "@mui/material";
|
||||
|
||||
const PlayButton = ({
|
||||
item,
|
||||
itemId,
|
||||
itemUserData,
|
||||
userId,
|
||||
@@ -42,6 +50,24 @@ const PlayButton = ({
|
||||
playlistItem,
|
||||
playlistItemId = "",
|
||||
trackIndex,
|
||||
}: {
|
||||
item: BaseItemDto;
|
||||
itemId: string;
|
||||
itemUserData: UserItemDataDto;
|
||||
userId: string;
|
||||
itemType: BaseItemKind;
|
||||
currentAudioTrack: number;
|
||||
currentVideoTrack: number;
|
||||
currentSubTrack: number;
|
||||
className: string;
|
||||
sx: SxProps;
|
||||
buttonProps: ButtonProps;
|
||||
iconOnly: boolean;
|
||||
audio: boolean;
|
||||
size: ButtonPropsSizeOverrides;
|
||||
playlistItem: BaseItemDto;
|
||||
playlistItemId: string;
|
||||
trackIndex: number;
|
||||
}) => {
|
||||
const [api] = useApi((state) => [state.api]);
|
||||
|
||||
@@ -96,11 +122,11 @@ const PlayButton = ({
|
||||
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const item = useMutation({
|
||||
const itemQuery = useMutation({
|
||||
mutationKey: ["playButton", itemId, userId],
|
||||
mutationFn: async () => {
|
||||
setPlaybackDataLoading(true);
|
||||
let result;
|
||||
let result: any;
|
||||
if (playlistItem) {
|
||||
result = await getPlaylistsApi(api).getPlaylistItems({
|
||||
userId: userId,
|
||||
@@ -112,9 +138,9 @@ const PlayButton = ({
|
||||
result = await getTvShowsApi(api).getEpisodes({
|
||||
seriesId: itemId,
|
||||
limit: 1,
|
||||
startIndex: 0,
|
||||
fields: [ItemFields.MediaSources, ItemFields.MediaStreams],
|
||||
enableUserData: true,
|
||||
userId: userId,
|
||||
});
|
||||
break;
|
||||
case BaseItemKind.Playlist:
|
||||
@@ -129,7 +155,7 @@ const PlayButton = ({
|
||||
userId: userId,
|
||||
fields: [ItemFields.MediaSources, ItemFields.MediaStreams],
|
||||
sortOrder: SortOrder.Ascending,
|
||||
sortBy: "IndexNumber",
|
||||
sortBy: ["IndexNumber"],
|
||||
});
|
||||
break;
|
||||
case BaseItemKind.MusicArtist:
|
||||
@@ -143,6 +169,15 @@ const PlayButton = ({
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
});
|
||||
break;
|
||||
case BaseItemKind.BoxSet:
|
||||
result = await getItemsApi(api).getItems({
|
||||
parentId: itemId,
|
||||
userId,
|
||||
fields: [ItemFields.MediaSources, ItemFields.MediaStreams],
|
||||
sortOrder: SortOrder.Ascending,
|
||||
sortBy: "IndexNumber",
|
||||
});
|
||||
break;
|
||||
default:
|
||||
result = await getItemsApi(api).getItems({
|
||||
ids: [itemId],
|
||||
@@ -156,51 +191,51 @@ const PlayButton = ({
|
||||
}
|
||||
return result.data;
|
||||
},
|
||||
onSuccess: (item) => {
|
||||
console.log(item.Items[0].MediaSources);
|
||||
onSuccess: (result) => {
|
||||
console.log(result.Items[0].MediaSources);
|
||||
if (trackIndex) {
|
||||
setPlaylistItemId(playlistItemId);
|
||||
setCurrentTrack(trackIndex);
|
||||
setAudioTracks(item.Items);
|
||||
setAudioTracks(result.Items);
|
||||
setAudioUrl(
|
||||
`${api.basePath}/Audio/${item.Items[trackIndex].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${userId}&api_key=${api.accessToken}`,
|
||||
`${api.basePath}/Audio/${result.Items[trackIndex].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${userId}&api_key=${api.accessToken}`,
|
||||
);
|
||||
setAudioItem(item.Items[trackIndex]);
|
||||
setAudioItem(result.Items[trackIndex]);
|
||||
setAudioDisplay(true);
|
||||
} else if (audio) {
|
||||
setAudioItem(item.Items[0]);
|
||||
setAudioTracks(item.Items);
|
||||
setAudioItem(result.Items[0]);
|
||||
setAudioTracks(result.Items);
|
||||
setAudioUrl(
|
||||
`${api.basePath}/Audio/${item.Items[0].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${userId}&api_key=${api.accessToken}`,
|
||||
`${api.basePath}/Audio/${result.Items[0].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${userId}&api_key=${api.accessToken}`,
|
||||
);
|
||||
setAudioDisplay(true);
|
||||
} else {
|
||||
setUserId(userId);
|
||||
setItemId(item.Items[0].Id);
|
||||
setDuration(item.Items[0].RunTimeTicks);
|
||||
setItemId(result.Items[0].Id);
|
||||
setDuration(result.Items[0].RunTimeTicks);
|
||||
|
||||
if (item.Items[0].Type === BaseItemKind.Episode) {
|
||||
setSeriesId(item.Items[0].SeriesId);
|
||||
// setEpisodeIndex(item.Ite)
|
||||
if (result.Items[0].Type === BaseItemKind.Episode) {
|
||||
setSeriesId(result.Items[0].SeriesId);
|
||||
// setEpisodeIndex(result.Ite)
|
||||
}
|
||||
|
||||
setMediaContainer(item.Items[0].MediaSources[0].Container);
|
||||
setMediaContainer(result.Items[0].MediaSources[0].Container);
|
||||
// Set all required stream index
|
||||
setAudioStreamIndex(currentAudioTrack);
|
||||
setVideoStreamIndex(currentVideoTrack);
|
||||
setSubtitleStreamIndex(currentSubTrack);
|
||||
|
||||
setMediaSourceId(item.Items[0].Id);
|
||||
setItem(item.Items[0]);
|
||||
setMediaSourceId(result.Items[0].Id);
|
||||
setItem(result.Items[0]);
|
||||
|
||||
switch (item.Items[0].Type) {
|
||||
switch (result.Items[0].Type) {
|
||||
case BaseItemKind.Movie:
|
||||
if (item.Items[0].ImageBlurHashes.Logo) {
|
||||
if (result.Items[0].ImageBlurHashes.Logo) {
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<img
|
||||
alt={item.Items[0].Name}
|
||||
src={`${api.basePath}/Items/${item.Items[0].Id}/Images/Logo`}
|
||||
alt={result.Items[0].Name}
|
||||
src={`${api.basePath}/Items/${result.Items[0].Id}/Images/Logo`}
|
||||
className="video-osd-name-logo"
|
||||
onLoad={(e) => {
|
||||
e.target.style.opacity = 1;
|
||||
@@ -211,27 +246,27 @@ const PlayButton = ({
|
||||
} else {
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<Typography variant="h6">{item.Items[0].Name}</Typography>
|
||||
<Typography variant="h6">{result.Items[0].Name}</Typography>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
break;
|
||||
case BaseItemKind.Episode:
|
||||
if (item.Items[0].ImageBlurHashes.Logo) {
|
||||
if (result.Items[0].ImageBlurHashes.Logo) {
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<img
|
||||
alt={item.Items[0].SeriesName}
|
||||
src={`${api.basePath}/Items/${item.Items[0].SeriesId}/Images/Logo`}
|
||||
alt={result.Items[0].SeriesName}
|
||||
src={`${api.basePath}/Items/${result.Items[0].SeriesId}/Images/Logo`}
|
||||
className="video-osd-name-logo"
|
||||
onLoad={(e) => {
|
||||
e.target.style.opacity = 1;
|
||||
}}
|
||||
/>
|
||||
<Typography variant="subtitle1">
|
||||
S{item.Items[0].ParentIndexNumber}
|
||||
S{result.Items[0].ParentIndexNumber}
|
||||
:E
|
||||
{item.Items[0].IndexNumber} {item.Items[0].Name}
|
||||
{result.Items[0].IndexNumber} {result.Items[0].Name}
|
||||
</Typography>
|
||||
</div>,
|
||||
);
|
||||
@@ -239,12 +274,12 @@ const PlayButton = ({
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<Typography variant="h6">
|
||||
{item.Items[0].SeriesName}
|
||||
{result.Items[0].SeriesName}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1">
|
||||
S{item.Items[0].ParentIndexNumber}
|
||||
S{result.Items[0].ParentIndexNumber}
|
||||
:E
|
||||
{item.Items[0].IndexNumber} {item.Items[0].Name}
|
||||
{result.Items[0].IndexNumber} {result.Items[0].Name}
|
||||
</Typography>
|
||||
</div>,
|
||||
);
|
||||
@@ -254,17 +289,17 @@ const PlayButton = ({
|
||||
default:
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<Typography variant="h6">{item.Items[0].Name}</Typography>
|
||||
<Typography variant="h6">{result.Items[0].Name}</Typography>
|
||||
</div>,
|
||||
);
|
||||
break;
|
||||
}
|
||||
setPosition(item.Items[0].UserData?.PlaybackPositionTicks);
|
||||
setPosition(result.Items[0].UserData?.PlaybackPositionTicks);
|
||||
|
||||
setUrl(
|
||||
`${api.basePath}/Videos/${item.Items[0].Id}/stream.
|
||||
${item.Items[0].MediaSources[0].Container}
|
||||
?Static=true&mediaSourceId=${item.Items[0].Id}&deviceId=${api.deviceInfo.id}&api_key=${api.accessToken}&Tag=${item.Items[0].MediaSources[0].ETag}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`,
|
||||
`${api.basePath}/Videos/${result.Items[0].Id}/stream.
|
||||
${result.Items[0].MediaSources[0].Container}
|
||||
?Static=true&mediaSourceId=${result.Items[0].Id}&deviceId=${api.deviceInfo.id}&api_key=${api.accessToken}&Tag=${result.Items[0].MediaSources[0].ETag}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`,
|
||||
);
|
||||
|
||||
navigate("/player");
|
||||
@@ -281,7 +316,7 @@ const PlayButton = ({
|
||||
});
|
||||
const handleClick = (e) => {
|
||||
e.stopPropagation();
|
||||
item.mutate();
|
||||
itemQuery.mutate();
|
||||
};
|
||||
if (iconOnly) {
|
||||
return (
|
||||
@@ -30,9 +30,9 @@
|
||||
&-container {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
bottom: -1em;
|
||||
left: 1em;
|
||||
right: 1em;
|
||||
bottom: -1.5em;
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
gap: 1em;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@@ -73,7 +73,7 @@ const CarouselSlide = ({ item }) => {
|
||||
background: "transparent",
|
||||
px: 3,
|
||||
}}
|
||||
elevation={6}
|
||||
elevation={10}
|
||||
>
|
||||
<div className="hero-carousel-background-container">
|
||||
{!!item.ImageBlurHashes.Backdrop && (
|
||||
|
||||
@@ -255,9 +255,30 @@ const MusicAlbumTitlePage = () => {
|
||||
)}
|
||||
</div>
|
||||
<div className="item-hero-detail flex flex-column">
|
||||
<Typography variant="h3">{item.data.Name}</Typography>
|
||||
<Typography variant="h2">{item.data.Name}</Typography>
|
||||
|
||||
<Chip label={`By ${item.data.AlbumArtist}`} />
|
||||
<Chip
|
||||
label={item.data.AlbumArtist}
|
||||
icon={
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{
|
||||
padding: "0.2em",
|
||||
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
}}
|
||||
>
|
||||
artist
|
||||
</span>
|
||||
}
|
||||
size="large"
|
||||
sx={{
|
||||
"& .MuiChip-label": {
|
||||
marginLeft: 0.5,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<Stack
|
||||
direction="row"
|
||||
gap={2}
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
.item-boxset.item {
|
||||
gap: 1em;
|
||||
.item-hero {
|
||||
height: 50vh;
|
||||
gap: 2em;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
&-image {
|
||||
opacity: 0;
|
||||
width: 100%;
|
||||
object-fit: contain;
|
||||
transition: opacity $transition-time-default;
|
||||
&-container {
|
||||
height: fit-content;
|
||||
max-height: 100%;
|
||||
overflow: hidden;
|
||||
border-radius: $border-radius-default;
|
||||
box-shadow: $shadow-card;
|
||||
flex-grow: 1;
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
width: 18% !important;
|
||||
}
|
||||
&-blurhash {
|
||||
position: absolute !important;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
&-logo {
|
||||
max-width: 42rem;
|
||||
max-height: 10rem;
|
||||
opacity: 0;
|
||||
transition: opacity $transition-time-default;
|
||||
object-position: bottom;
|
||||
}
|
||||
&-detail {
|
||||
width: 100%;
|
||||
align-items: flex-start;
|
||||
gap: 1em;
|
||||
justify-content: end;
|
||||
}
|
||||
&-buttons {
|
||||
&-container {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
&-backdrop {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
object-position: top;
|
||||
opacity: 0;
|
||||
transition: opacity $transition-time-default;
|
||||
&-container {
|
||||
filter: brightness(0.8);
|
||||
position: absolute;
|
||||
top: -4.4em;
|
||||
left: -1.6em;
|
||||
width: 100vw;
|
||||
height: calc(50vh + 4.4em);
|
||||
z-index: -1;
|
||||
mask-image: linear-gradient(to top, transparent, black);
|
||||
-webkit-mask-image: linear-gradient(
|
||||
to top,
|
||||
transparent,
|
||||
black
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item-detail {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 5px 35%;
|
||||
justify-items: center;
|
||||
align-items: start;
|
||||
gap: 1em;
|
||||
|
||||
&-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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+270
-53
@@ -1,9 +1,13 @@
|
||||
import PropTypes from "prop-types";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import React, { useState, useEffect, useLayoutEffect } from "react";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import Chip from "@mui/material/Chip";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
import Divider from "@mui/material/Divider";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { Link, useNavigate, useParams } from "react-router-dom";
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
|
||||
@@ -22,9 +26,18 @@ import { Card } from "../../components/card/card";
|
||||
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
||||
import Hero from "../../components/layouts/item/hero";
|
||||
|
||||
import { Blurhash } from "react-blurhash";
|
||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||
import ShowMoreText from "../../components/showMoreText";
|
||||
import { endsAt, getRuntime } from "../../utils/date/time";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||
import { setBackdrop, useBackdropStore } from "../../utils/store/backdrop";
|
||||
|
||||
import LikeButton from "../../components/buttons/likeButton";
|
||||
import MarkPlayedButton from "../../components/buttons/markPlayedButton";
|
||||
import PlayButton from "../../components/buttons/playButton";
|
||||
|
||||
import meshBg from "../../assets/heroBg.png";
|
||||
import "./boxset.module.scss";
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
@@ -109,26 +122,11 @@ const BoxSetTitlePage = () => {
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||
|
||||
const [directors, setDirectors] = useState([]);
|
||||
const [writers, setWriters] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (item.isSuccess) {
|
||||
setAppBackdrop(
|
||||
item.data.Type === BaseItemKind.MusicAlbum ||
|
||||
item.data.Type === BaseItemKind.Episode
|
||||
? `${api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
||||
: `${api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||
item.data.Id,
|
||||
);
|
||||
const direTp = item.data.People.filter((itm) => itm.Type === "Director");
|
||||
setDirectors(direTp);
|
||||
const writeTp = item.data.People.filter((itm) => itm.Type === "Writer");
|
||||
setWriters(writeTp);
|
||||
setBackdrop("", "");
|
||||
}
|
||||
});
|
||||
}, [item.isSuccess]);
|
||||
|
||||
if (item.isPending || similarItems.isPending) {
|
||||
return (
|
||||
@@ -159,41 +157,260 @@ const BoxSetTitlePage = () => {
|
||||
duration: 0.25,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY"
|
||||
style={{
|
||||
padding: "5em 2em 2em 1em",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
gap: "0.5em",
|
||||
}}
|
||||
className="scrollY item item-boxset padded-top"
|
||||
>
|
||||
<Hero
|
||||
item={item.data}
|
||||
userId={user.data.Id}
|
||||
queryKey={["item", id]}
|
||||
writers={writers}
|
||||
directors={directors}
|
||||
studios={item.data.Studios}
|
||||
/>
|
||||
{item.data.People.length > 0 && (
|
||||
<CardScroller title="Cast & Crew" displayCards={8} disableDecoration>
|
||||
{item.data.People.map((person, index) => {
|
||||
return (
|
||||
<Card
|
||||
key={person.Id}
|
||||
item={person}
|
||||
cardTitle={person.Name}
|
||||
cardCaption={person.Role}
|
||||
cardType="square"
|
||||
userId={user.data.Id}
|
||||
imageBlurhash={person.ImageBlurHashes?.Primary[0]}
|
||||
overrideIcon="Person"
|
||||
disableOverlay
|
||||
<div className="item-hero flex flex-row">
|
||||
<div className="item-hero-backdrop-container">
|
||||
{item.data.BackdropImageTags ? (
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={meshBg}
|
||||
className="item-hero-backdrop"
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</div>
|
||||
<div
|
||||
className="item-hero-image-container"
|
||||
style={{
|
||||
aspectRatio: item.data.PrimaryImageAspectRatio ?? 1,
|
||||
}}
|
||||
>
|
||||
{Object.keys(item.data.ImageTags).includes("Primary") ? (
|
||||
<>
|
||||
<Blurhash
|
||||
hash={
|
||||
item.data.ImageBlurHashes.Primary[
|
||||
item.data.ImageTags.Primary
|
||||
]
|
||||
}
|
||||
className="item-hero-image-blurhash"
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
)}
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Primary", {
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
})}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
className="item-hero-image"
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</div>
|
||||
<div className="item-hero-detail flex flex-column">
|
||||
{Object.keys(item.data.ImageTags).includes("Logo") ? (
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Logo", {
|
||||
quality: 90,
|
||||
fillWidth: 592,
|
||||
fillHeight: 592,
|
||||
})}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
className="item-hero-logo"
|
||||
/>
|
||||
) : (
|
||||
<Typography variant="h2">{item.data.Name}</Typography>
|
||||
)}
|
||||
|
||||
<Stack
|
||||
direction="row"
|
||||
gap={2}
|
||||
justifyItems="flex-start"
|
||||
alignItems="center"
|
||||
>
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
|
||||
{item.data.ProductionYear ?? ""}
|
||||
</Typography>
|
||||
{item.data.OfficialRating && (
|
||||
<Chip variant="filled" label={item.data.OfficialRating} />
|
||||
)}
|
||||
|
||||
{item.data.CommunityRating && (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "0.25em",
|
||||
alignItems: "center",
|
||||
}}
|
||||
className="hero-carousel-info-rating"
|
||||
>
|
||||
<div
|
||||
className="material-symbols-rounded "
|
||||
style={{
|
||||
// fontSize: "2.2em",
|
||||
color: yellow[400],
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
}}
|
||||
>
|
||||
star
|
||||
</div>
|
||||
<Typography
|
||||
style={{
|
||||
opacity: "0.8",
|
||||
}}
|
||||
variant="subtitle1"
|
||||
>
|
||||
{Math.round(item.data.CommunityRating * 10) / 10}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
{item.data.CriticRating && (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "0.25em",
|
||||
alignItems: "center",
|
||||
}}
|
||||
className="hero-carousel-info-rating"
|
||||
>
|
||||
<div
|
||||
className="material-symbols-rounded "
|
||||
style={{
|
||||
color:
|
||||
item.data.CriticRating > 50 ? green[400] : red[400],
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
}}
|
||||
>
|
||||
{item.data.CriticRating > 50 ? "thumb_up" : "thumb_down"}
|
||||
</div>
|
||||
<Typography
|
||||
style={{
|
||||
opacity: "0.8",
|
||||
}}
|
||||
variant="subtitle1"
|
||||
>
|
||||
{item.data.CriticRating}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{item.data.RunTimeTicks && (
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
|
||||
{getRuntime(item.data.RunTimeTicks)}
|
||||
</Typography>
|
||||
)}
|
||||
{item.data.RunTimeTicks && (
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
|
||||
{endsAt(
|
||||
item.data.RunTimeTicks -
|
||||
item.data.UserData.PlaybackPositionTicks,
|
||||
)}
|
||||
</Typography>
|
||||
)}
|
||||
</Stack>
|
||||
<Typography variant="subtitle1" style={{ opacity: 0.8 }}>
|
||||
{item.data.Genres.join(", ")}
|
||||
</Typography>
|
||||
|
||||
<div className="item-hero-buttons-container flex flex-row">
|
||||
<div className="flex flex-row">
|
||||
<PlayButton
|
||||
itemId={item.data.Id}
|
||||
itemType={item.data.Type}
|
||||
itemUserData={item.data.UserData}
|
||||
currentVideoTrack={0}
|
||||
currentAudioTrack={0}
|
||||
currentSubTrack={0}
|
||||
userId={user.data.Id}
|
||||
sx={{
|
||||
background: "hsl(195.56deg 29.03% 18.24%) !important",
|
||||
}}
|
||||
/>
|
||||
</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.data.Id}
|
||||
/>
|
||||
<MarkPlayedButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
queryKey={["item", id]}
|
||||
isPlayed={item.data.UserData.Played}
|
||||
userId={user.data.Id}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="item-detail">
|
||||
<div style={{ width: "100%" }}>
|
||||
{item.data.UserData.PlaybackPositionTicks > 0 && (
|
||||
<div
|
||||
style={{
|
||||
width: "40%",
|
||||
marginBottom: "1em",
|
||||
}}
|
||||
>
|
||||
<Typography>
|
||||
{getRuntime(
|
||||
item.data.RunTimeTicks -
|
||||
item.data.UserData.PlaybackPositionTicks,
|
||||
)}{" "}
|
||||
left
|
||||
</Typography>
|
||||
<LinearProgress
|
||||
color="white"
|
||||
variant="determinate"
|
||||
value={item.data.UserData.PlayedPercentage}
|
||||
style={{
|
||||
borderRadius: "10px",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<Typography variant="h5" fontStyle="italic" mb={1}>
|
||||
{item.data.Taglines[0] ?? ""}
|
||||
</Typography>
|
||||
<ShowMoreText
|
||||
content={item.data.Overview ?? ""}
|
||||
collapsedLines={4}
|
||||
/>
|
||||
</div>
|
||||
<Divider flexItem orientation="vertical" />
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "0.6em",
|
||||
alignSelf: "end",
|
||||
marginTop: "1em",
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls.map((url) => (
|
||||
<Link
|
||||
key={url.Url}
|
||||
target="_blank"
|
||||
to={url.Url}
|
||||
className="item-detail-link"
|
||||
>
|
||||
<Typography>{url.Name}</Typography>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{collectionItems.data.TotalRecordCount > 0 && (
|
||||
<CardScroller title="Items" displayCards={8} disableDecoration>
|
||||
{collectionItems.data.Items.map((similar, index) => {
|
||||
|
||||
+175
-162
@@ -312,7 +312,7 @@ const EpisodeTitlePage = () => {
|
||||
)}
|
||||
</div>
|
||||
<div className="item-hero-detail flex flex-column">
|
||||
<TextLink variant={"h3"} location={`/series/${item.data.SeriesId}`}>
|
||||
<TextLink variant={"h2"} location={`/series/${item.data.SeriesId}`}>
|
||||
{item.data.ParentLogoItemId.length > 0 ? (
|
||||
<img
|
||||
alt={item.data.SeriesName}
|
||||
@@ -662,6 +662,7 @@ const EpisodeTitlePage = () => {
|
||||
marginBottom: "1em",
|
||||
}}
|
||||
value={selectedVideoTrack}
|
||||
variant="filled"
|
||||
onChange={(e) => setSelectedVideoTrack(e.target.value)}
|
||||
>
|
||||
{videoTracks.map((track) => (
|
||||
@@ -680,6 +681,7 @@ const EpisodeTitlePage = () => {
|
||||
marginBottom: "1em",
|
||||
}}
|
||||
value={selectedAudioTrack}
|
||||
variant="filled"
|
||||
onChange={(e) => setSelectedAudioTrack(e.target.value)}
|
||||
>
|
||||
{audioTracks.map((track) => (
|
||||
@@ -697,6 +699,7 @@ const EpisodeTitlePage = () => {
|
||||
width: "100%",
|
||||
}}
|
||||
value={selectedSubtitleTrack}
|
||||
variant="filled"
|
||||
onChange={(e) => setSelectedSubtitleTrack(e.target.value)}
|
||||
>
|
||||
<MenuItem key={-1} value={-1}>
|
||||
@@ -760,175 +763,185 @@ const EpisodeTitlePage = () => {
|
||||
})}
|
||||
</CardScroller>
|
||||
)}
|
||||
<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) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
{item.data.People?.length > 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) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(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>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">{actor.Name}</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</NavLink>
|
||||
))}
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
</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) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
)}
|
||||
{writers.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Writers</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{writers.map((actor) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(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>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">{actor.Name}</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</NavLink>
|
||||
))}
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
</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) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
to={`/person/${actor.Id}`}
|
||||
key={actor.Id}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
)}
|
||||
{directors.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Directors</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{directors.map((actor) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
to={`/person/${actor.Id}`}
|
||||
key={actor.Id}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(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>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">{actor.Name}</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</NavLink>
|
||||
))}
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
</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) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
)}
|
||||
{producers.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Producers</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{producers.map((actor) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(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>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">{actor.Name}</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</NavLink>
|
||||
))}
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</motion.div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
border-radius: 10px !important;
|
||||
overflow: hidden;
|
||||
margin: 0 auto;
|
||||
// box-shadow: 0 0 40px red;
|
||||
border: 1.2px solid rgb(255 255 255 / 0.15);
|
||||
// box-shadow: 0 0 30px black !important;
|
||||
}
|
||||
&-background {
|
||||
&-blurhash {
|
||||
@@ -93,17 +94,6 @@
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
}
|
||||
&-indicator {
|
||||
&-container {
|
||||
// width: calc(100% - 2em) !important;
|
||||
margin-top: -1em !important;
|
||||
margin-left: 1em !important;
|
||||
margin-right: 1em !important;
|
||||
}
|
||||
width: 100%;
|
||||
height: 5px;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.backdropContainer {
|
||||
|
||||
+183
-162
@@ -348,7 +348,7 @@ const ItemDetail = () => {
|
||||
className="item-hero-logo"
|
||||
/>
|
||||
) : (
|
||||
<Typography variant="h3">{item.data.Name}</Typography>
|
||||
<Typography variant="h2">{item.data.Name}</Typography>
|
||||
)}
|
||||
<Stack direction="row" gap={1}>
|
||||
{!!qualityLabel() && (
|
||||
@@ -537,6 +537,9 @@ const ItemDetail = () => {
|
||||
currentAudioTrack={selectedAudioTrack}
|
||||
currentSubTrack={selectedSubtitleTrack}
|
||||
userId={user.data.Id}
|
||||
sx={{
|
||||
background: "hsl(195.56deg 29.03% 18.24%) !important",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-row" style={{ gap: "1em" }}>
|
||||
@@ -677,6 +680,7 @@ const ItemDetail = () => {
|
||||
marginBottom: "1em",
|
||||
}}
|
||||
value={selectedVideoTrack}
|
||||
variant="filled"
|
||||
onChange={(e) => setSelectedVideoTrack(e.target.value)}
|
||||
>
|
||||
{videoTracks.map((track) => (
|
||||
@@ -695,6 +699,7 @@ const ItemDetail = () => {
|
||||
marginBottom: "1em",
|
||||
}}
|
||||
value={selectedAudioTrack}
|
||||
variant="filled"
|
||||
onChange={(e) => setSelectedAudioTrack(e.target.value)}
|
||||
>
|
||||
{audioTracks.map((track) => (
|
||||
@@ -712,6 +717,12 @@ const ItemDetail = () => {
|
||||
width: "100%",
|
||||
}}
|
||||
value={selectedSubtitleTrack}
|
||||
variant="filled"
|
||||
SelectProps={{
|
||||
MenuProps: {
|
||||
disablePortal: true,
|
||||
},
|
||||
}}
|
||||
onChange={(e) => setSelectedSubtitleTrack(e.target.value)}
|
||||
>
|
||||
<MenuItem key={-1} value={-1}>
|
||||
@@ -745,175 +756,185 @@ const ItemDetail = () => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
{item.data.People.length > 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) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(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>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">{actor.Name}</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</NavLink>
|
||||
))}
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
</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) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
)}
|
||||
{writers.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Writers</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{writers.map((actor) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(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>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">{actor.Name}</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</NavLink>
|
||||
))}
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
</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) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
to={`/person/${actor.Id}`}
|
||||
key={actor.Id}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
)}
|
||||
{directors.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Directors</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{directors.map((actor) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
to={`/person/${actor.Id}`}
|
||||
key={actor.Id}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(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>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">{actor.Name}</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</NavLink>
|
||||
))}
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
</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) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(actor.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
)}
|
||||
{producers.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6">Producers</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{producers.map((actor) => (
|
||||
<NavLink
|
||||
className="item-detail-cast-card"
|
||||
key={actor.Id}
|
||||
to={`/person/${actor.Id}`}
|
||||
>
|
||||
{actor.PrimaryImageTag ? (
|
||||
<img
|
||||
alt={actor.Name}
|
||||
src={api.getItemImageUrl(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>
|
||||
)}
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">{actor.Name}</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{actor.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</NavLink>
|
||||
))}
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{/* {item.data.People.length > 0 && (
|
||||
<CardScroller
|
||||
title="Cast & Crew"
|
||||
|
||||
@@ -32,6 +32,7 @@ import { useApi } from "../../utils/store/api";
|
||||
import { setBackdrop } from "../../utils/store/backdrop";
|
||||
|
||||
import meshBg from "../../assets/herobg.png";
|
||||
import ShowMoreText from "../../components/showMoreText";
|
||||
import "./person.module.scss";
|
||||
|
||||
function TabPanel(props) {
|
||||
@@ -271,7 +272,7 @@ const PersonTitlePage = () => {
|
||||
duration: 0.25,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY padded-top item item-person"
|
||||
className="scrollY padded-top item item-person flex flex-column"
|
||||
>
|
||||
<div className="item-hero flex flex-row">
|
||||
<div className="item-hero-backdrop-container">
|
||||
@@ -317,22 +318,7 @@ const PersonTitlePage = () => {
|
||||
)}
|
||||
</div>
|
||||
<div className="item-hero-detail flex flex-column">
|
||||
{Object.keys(item.data.ImageTags).includes("Logo") ? (
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Logo", {
|
||||
quality: 90,
|
||||
fillWidth: 592,
|
||||
fillHeight: 592,
|
||||
})}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
className="item-hero-logo"
|
||||
/>
|
||||
) : (
|
||||
<Typography variant="h3">{item.data.Name}</Typography>
|
||||
)}
|
||||
<Typography variant="h2">{item.data.Name}</Typography>
|
||||
|
||||
<LikeButton
|
||||
itemName={item.data.Name}
|
||||
|
||||
@@ -336,7 +336,7 @@ const SeriesTitlePage = () => {
|
||||
className="item-hero-logo"
|
||||
/>
|
||||
) : (
|
||||
<Typography variant="h3">{item.data.Name}</Typography>
|
||||
<Typography variant="h2">{item.data.Name}</Typography>
|
||||
)}
|
||||
<Stack
|
||||
direction="row"
|
||||
@@ -446,6 +446,7 @@ const SeriesTitlePage = () => {
|
||||
<div className="flex flex-row">
|
||||
<PlayButton
|
||||
itemId={item.data.Id}
|
||||
item={item.data}
|
||||
itemType={item.data.Type}
|
||||
itemUserData={item.data.UserData}
|
||||
currentAudioTrack={0}
|
||||
|
||||
@@ -6,7 +6,7 @@ export interface PlaybackState {
|
||||
startPosition: number;
|
||||
duration: number;
|
||||
itemId: string;
|
||||
itemName: string;
|
||||
itemName: string | Element;
|
||||
subtitleTracks: unknown[];
|
||||
selectedSubtitleTrack: number;
|
||||
mediaSourceId: string;
|
||||
@@ -23,7 +23,7 @@ export interface PlaybackState {
|
||||
setPosition: (apos: number) => void;
|
||||
setDuration: (adur: number) => void;
|
||||
setItemId: (aid: string) => void;
|
||||
setItemName: (anm: string) => void;
|
||||
setItemName: (anm: string | Element) => void;
|
||||
setUserId: (anm: string) => void;
|
||||
setSeriesId: (anm: string) => void;
|
||||
setMediaContainer: (anm: string) => void;
|
||||
@@ -64,7 +64,7 @@ export const usePlaybackStore = create<PlaybackState>((set) => ({
|
||||
set((state: PlaybackState) => ({ ...state, duration: adur })),
|
||||
setItemId: (aid: string) =>
|
||||
set((state: PlaybackState) => ({ ...state, itemId: aid })),
|
||||
setItemName: (anm: string) =>
|
||||
setItemName: (anm: string | Element) =>
|
||||
set((state: PlaybackState) => ({ ...state, itemName: anm })),
|
||||
setUserId: (anm: string) =>
|
||||
set((state: PlaybackState) => ({ ...state, userId: anm })),
|
||||
|
||||
Reference in new issue
Block a user