feat: add new episode layout
This commit is contained in:
10 files changed
+318
-288
No files matched your search
@@ -142,7 +142,7 @@
|
||||
}
|
||||
|
||||
&-progress{
|
||||
width: attr('data-progress');
|
||||
// width: attr('data-progress');
|
||||
height: 100%;
|
||||
background: white;
|
||||
transition: width $transition-time-default ease-in-out;
|
||||
|
||||
@@ -1,19 +1,24 @@
|
||||
import React, { useState } from "react";
|
||||
/** @format */
|
||||
|
||||
import React from "react";
|
||||
import { Component, useState } from "react";
|
||||
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import { getTypeIcon } from "../utils/iconsCollection";
|
||||
import "./card.module.scss";
|
||||
|
||||
import { BaseItemDto, BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import {
|
||||
type BaseItemDto,
|
||||
BaseItemKind,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import LikeButton from "../buttons/likeButton";
|
||||
import MarkPlayedButton from "../buttons/markPlayedButton";
|
||||
import PlayButton from "../buttons/playButton";
|
||||
import ErrorBoundary from "../errorBoundary";
|
||||
import { getTypeIcon } from "../utils/iconsCollection";
|
||||
import "./card.module.scss";
|
||||
|
||||
const cardImageAspectRatios = {
|
||||
thumb: 1.777,
|
||||
@@ -54,7 +59,7 @@ export const Card = ({
|
||||
hideText: boolean;
|
||||
onClick: Function | null;
|
||||
disableOverlay: boolean;
|
||||
overrideIcon: React.Component | null;
|
||||
overrideIcon: any;
|
||||
}) => {
|
||||
const [api] = useApi((state) => [state.api]);
|
||||
const navigate = useNavigate();
|
||||
@@ -84,12 +89,16 @@ export const Card = ({
|
||||
opacity: item.UserData?.Played ? 1 : 0,
|
||||
}}
|
||||
>
|
||||
<div className="material-symbols-rounded">done</div>
|
||||
<div className="material-symbols-rounded">
|
||||
done
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className={"card-indicator text"}
|
||||
style={{
|
||||
opacity: item.UserData?.UnplayedItemCount ? 1 : 0,
|
||||
opacity: item.UserData?.UnplayedItemCount
|
||||
? 1
|
||||
: 0,
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
@@ -112,7 +121,9 @@ export const Card = ({
|
||||
/>
|
||||
)} */}
|
||||
<div className="card-image-icon-container">
|
||||
{overrideIcon ? getTypeIcon(overrideIcon) : getTypeIcon(item.Type)}
|
||||
{overrideIcon
|
||||
? getTypeIcon(overrideIcon)
|
||||
: getTypeIcon(item.Type)}
|
||||
</div>
|
||||
<img
|
||||
alt={item.Name}
|
||||
@@ -120,14 +131,13 @@ export const Card = ({
|
||||
overrideIcon === "User"
|
||||
? `${api.basePath}/Users/${item.Id}/Images/Primary`
|
||||
: api.getItemImageUrl(
|
||||
seriesId ? item.SeriesId : item.AlbumId ?? item.Id,
|
||||
seriesId
|
||||
? item.SeriesId
|
||||
: item.AlbumId ?? item.Id,
|
||||
imageType,
|
||||
{
|
||||
quality: 90,
|
||||
fillHeight: 226,
|
||||
fillWidth: Math.floor(
|
||||
226 / cardImageAspectRatios[cardType],
|
||||
),
|
||||
fillWidth: 400,
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -159,12 +169,16 @@ export const Card = ({
|
||||
}}
|
||||
iconOnly
|
||||
audio={
|
||||
item.Type === BaseItemKind.MusicAlbum ||
|
||||
item.Type ===
|
||||
BaseItemKind.MusicAlbum ||
|
||||
item.Type === BaseItemKind.Audio ||
|
||||
item.Type === BaseItemKind.AudioBook ||
|
||||
item.Type ===
|
||||
BaseItemKind.AudioBook ||
|
||||
item.Type === BaseItemKind.Playlist
|
||||
}
|
||||
playlistItem={
|
||||
item.Type === BaseItemKind.Playlist
|
||||
}
|
||||
playlistItem={item.Type === BaseItemKind.Playlist}
|
||||
playlistItemId={item.Id}
|
||||
/>
|
||||
<LikeButton
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
import { Divider, Skeleton, Typography } from "@mui/material";
|
||||
import React from "react";
|
||||
|
||||
const EpisodeSkeleton = () => {
|
||||
return Array.from(new Array(8)).map((a, index) => {
|
||||
return <>
|
||||
<div
|
||||
key={index}
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
className="item-detail-episode"
|
||||
>
|
||||
<Typography variant="h6"><Skeleton variant="circular" sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}} /></Typography>
|
||||
<div className="item-detail-episode-image-container">
|
||||
<Skeleton className="item-detail-episode-image" variant="rectangular" sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}} />
|
||||
</div>
|
||||
<div className="item-detail-episode-info">
|
||||
<Typography variant="h4">
|
||||
<Skeleton variant="text" width="10em" sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}} />
|
||||
</Typography>
|
||||
<Skeleton variant="rounded" width="5em" style={{ borderRadius: "100px" }} sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}} />
|
||||
<Typography style={{
|
||||
width: "100%"
|
||||
}}>
|
||||
<Skeleton width="100%" sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}} />
|
||||
<Skeleton width="100%" sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}} />
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
{index !== 7 && <Divider orientation="horizontal" flexItem />}
|
||||
|
||||
</>
|
||||
})
|
||||
}
|
||||
|
||||
export default EpisodeSkeleton
|
||||
@@ -1,10 +1,8 @@
|
||||
import Card from "@mui/material/Card";
|
||||
import CardContent from "@mui/material/CardContent";
|
||||
import CardMedia from "@mui/material/CardMedia";
|
||||
import Divider from "@mui/material/Divider";
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Grid from "@mui/material/Unstable_Grid2";
|
||||
import EpisodeSkeleton from "./episode";
|
||||
|
||||
import { borderRadiusDefault } from "../../palette.module.scss";
|
||||
|
||||
@@ -47,80 +45,7 @@ export const SeasonSelectorSkeleton = () => {
|
||||
paddingBottom: " 0.5em",
|
||||
}}
|
||||
/>
|
||||
{Array.from(new Array(4)).map((a, index) => {
|
||||
return (
|
||||
<Grid xs={1} sm={1} md={1} key={a}>
|
||||
<Card sx={{ background: "transparent" }} elevation={0}>
|
||||
<CardMedia>
|
||||
<Skeleton
|
||||
// animation="wave"
|
||||
variant="rectangular"
|
||||
sx={{
|
||||
aspectRatio: "1.777",
|
||||
height: "auto",
|
||||
m: 1,
|
||||
borderRadius: "10px",
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}}
|
||||
/>
|
||||
</CardMedia>
|
||||
<CardContent
|
||||
sx={{
|
||||
padding: "0 0.5em",
|
||||
alignItems: "flex-start",
|
||||
backgroundColor: "transparent",
|
||||
}}
|
||||
>
|
||||
<Typography variant="h6">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}}
|
||||
/>
|
||||
</Typography>
|
||||
|
||||
<Typography variant="body2">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}}
|
||||
/>
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}}
|
||||
/>
|
||||
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}}
|
||||
/>
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Grid>
|
||||
);
|
||||
})}
|
||||
<EpisodeSkeleton/>
|
||||
</Grid>
|
||||
);
|
||||
};
|
||||
@@ -19,7 +19,7 @@ import { green, red, yellow } from "@mui/material/colors";
|
||||
import { AnimatePresence, motion, useScroll } from "framer-motion";
|
||||
import useParallax from "../../utils/hooks/useParallax";
|
||||
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
|
||||
import { Blurhash } from "react-blurhash";
|
||||
|
||||
@@ -35,7 +35,7 @@ import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api"
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { endsAt, getRuntime, getRuntimeMusic } from "../../utils/date/time";
|
||||
import { endsAt, getRuntime, getRuntimeCompact, getRuntimeMusic } from "../../utils/date/time";
|
||||
|
||||
import { Card } from "../../components/card/card";
|
||||
import { EpisodeCard } from "../../components/card/episodeCard";
|
||||
@@ -59,6 +59,7 @@ import { useApi } from "../../utils/store/api";
|
||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||
|
||||
import IconLink from "../../components/iconLink";
|
||||
import EpisodeSkeleton from "../../components/skeleton/episode";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
@@ -83,6 +84,13 @@ TabPanel.propTypes = {
|
||||
value: PropTypes.number.isRequired,
|
||||
};
|
||||
|
||||
const getEpisodeDateString = (date: Date) => {
|
||||
const formatter = new Intl.DateTimeFormat(navigator.language ?? "en-US", {
|
||||
dateStyle: "full",
|
||||
})
|
||||
return formatter.format(date).toString();
|
||||
}
|
||||
|
||||
const SeriesTitlePage = () => {
|
||||
const { id } = useParams();
|
||||
|
||||
@@ -164,7 +172,7 @@ const SeriesTitlePage = () => {
|
||||
const result = sessionStorage.getItem(`backdrop-${item.data?.Id}`);
|
||||
return result ?? "0";
|
||||
});
|
||||
const [backdropImageLoaded , setBackdropImageLoaded] = useState(false);
|
||||
const [backdropImageLoaded, setBackdropImageLoaded] = useState(false);
|
||||
|
||||
const [currentSeason, setCurrentSeason] = useState(() => {
|
||||
const result = sessionStorage.getItem(`season-${item.data?.Id}`);
|
||||
@@ -286,7 +294,7 @@ const SeriesTitlePage = () => {
|
||||
currentSeasonItem.data.Id,
|
||||
);
|
||||
setBackdropImageLoaded(false)
|
||||
} else if (item.isSuccess && item.data?.BackdropImageTags?.length > 0 ){
|
||||
} else if (item.isSuccess && item.data?.BackdropImageTags?.length > 0) {
|
||||
sessionStorage.setItem(
|
||||
`backdrop-${item.data?.Id}`,
|
||||
api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
@@ -309,8 +317,6 @@ const SeriesTitlePage = () => {
|
||||
}
|
||||
}, [currentSeasonItem.dataUpdatedAt]);
|
||||
|
||||
console.log(backdropImage);
|
||||
|
||||
const pageRef = useRef(null);
|
||||
const { scrollYProgress } = useScroll({
|
||||
target: pageRef,
|
||||
@@ -318,6 +324,8 @@ const SeriesTitlePage = () => {
|
||||
});
|
||||
const parallax = useParallax(scrollYProgress, 50);
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
if (item.isPending || similarItems.isPending) {
|
||||
return (
|
||||
<Box
|
||||
@@ -355,34 +363,34 @@ const SeriesTitlePage = () => {
|
||||
<div className="item-hero-backdrop-container">
|
||||
<AnimatePresence mode="wait">
|
||||
|
||||
{item.data.BackdropImageTags ? (
|
||||
<motion.img
|
||||
key={currentSeasonItem.dataUpdatedAt}
|
||||
alt={item.data.Name}
|
||||
src={backdropImage}
|
||||
className="item-hero-backdrop"
|
||||
initial={{
|
||||
opacity: 0
|
||||
}}
|
||||
onLoad={() => {
|
||||
setBackdropImageLoaded(true)
|
||||
}}
|
||||
animate={{
|
||||
opacity: backdropImageLoaded ? 1 : 0
|
||||
}}
|
||||
exit={{
|
||||
opacity:0
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.2
|
||||
}}
|
||||
style={{
|
||||
y: parallax,
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
{item.data.BackdropImageTags ? (
|
||||
<motion.img
|
||||
key={currentSeasonItem.dataUpdatedAt}
|
||||
alt={item.data.Name}
|
||||
src={backdropImage}
|
||||
className="item-hero-backdrop"
|
||||
initial={{
|
||||
opacity: 0
|
||||
}}
|
||||
onLoad={() => {
|
||||
setBackdropImageLoaded(true)
|
||||
}}
|
||||
animate={{
|
||||
opacity: backdropImageLoaded ? 1 : 0
|
||||
}}
|
||||
exit={{
|
||||
opacity: 0
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.2
|
||||
}}
|
||||
style={{
|
||||
y: parallax,
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
<div
|
||||
@@ -396,7 +404,7 @@ const SeriesTitlePage = () => {
|
||||
<Blurhash
|
||||
hash={
|
||||
item.data.ImageBlurHashes.Primary[
|
||||
item.data.ImageTags.Primary
|
||||
item.data.ImageTags.Primary
|
||||
]
|
||||
}
|
||||
className="item-hero-image-blurhash"
|
||||
@@ -445,7 +453,7 @@ const SeriesTitlePage = () => {
|
||||
{item.data.Status === "Continuing"
|
||||
? " - Present"
|
||||
: item.data.EndDate &&
|
||||
` - ${new Date(item.data.EndDate).getFullYear()}`}
|
||||
` - ${new Date(item.data.EndDate).getFullYear()}`}
|
||||
</Typography>
|
||||
{item.data.OfficialRating && (
|
||||
<Chip variant="filled" label={item.data.OfficialRating} />
|
||||
@@ -529,7 +537,7 @@ const SeriesTitlePage = () => {
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
|
||||
{endsAt(
|
||||
item.data.RunTimeTicks -
|
||||
item.data.UserData.PlaybackPositionTicks,
|
||||
item.data.UserData.PlaybackPositionTicks,
|
||||
)}
|
||||
</Typography>
|
||||
)}
|
||||
@@ -586,7 +594,7 @@ const SeriesTitlePage = () => {
|
||||
<Typography>
|
||||
{getRuntime(
|
||||
item.data.RunTimeTicks -
|
||||
item.data.UserData.PlaybackPositionTicks,
|
||||
item.data.UserData.PlaybackPositionTicks,
|
||||
)}{" "}
|
||||
left
|
||||
</Typography>
|
||||
@@ -892,7 +900,7 @@ const SeriesTitlePage = () => {
|
||||
cardCaption={episode.Overview}
|
||||
imageBlurhash={
|
||||
episode.ImageBlurHashes?.Primary[
|
||||
Object.keys(episode.ImageBlurHashes.Primary)[0]
|
||||
Object.keys(episode.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
}
|
||||
queryKey={[
|
||||
@@ -1001,91 +1009,15 @@ const SeriesTitlePage = () => {
|
||||
</div>
|
||||
</div>
|
||||
<Divider />
|
||||
<div className="item-detail-episodes-container">
|
||||
<div className="item-detail-episode-container">
|
||||
{episodes.isPending
|
||||
? Array.from(new Array(4)).map((a, index) => {
|
||||
return (
|
||||
<MuiCard
|
||||
key={a}
|
||||
sx={{
|
||||
background: "transparent",
|
||||
width: "100%",
|
||||
}}
|
||||
elevation={0}
|
||||
>
|
||||
<CardMedia>
|
||||
<Skeleton
|
||||
// animation="wave"
|
||||
variant="rectangular"
|
||||
sx={{
|
||||
aspectRatio: "1.777",
|
||||
height: "auto",
|
||||
m: 1,
|
||||
borderRadius: "10px",
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}}
|
||||
/>
|
||||
</CardMedia>
|
||||
<CardContent
|
||||
sx={{
|
||||
padding: "0 0.5em",
|
||||
alignItems: "flex-start",
|
||||
backgroundColor: "transparent",
|
||||
}}
|
||||
>
|
||||
<Typography variant="h6">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}}
|
||||
/>
|
||||
</Typography>
|
||||
|
||||
<Typography variant="body2">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}}
|
||||
/>
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}}
|
||||
/>
|
||||
|
||||
<Skeleton
|
||||
variant="text"
|
||||
sx={{
|
||||
animationDelay: `${index * 0.2}s`,
|
||||
animationDuration: "1.4s",
|
||||
animationName: "pulse",
|
||||
opacity: 0.1,
|
||||
}}
|
||||
/>
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</MuiCard>
|
||||
);
|
||||
})
|
||||
: episodes.data.Items.map((episode) => {
|
||||
return (
|
||||
? <EpisodeSkeleton />
|
||||
: episodes.data.Items.map((episode, index) => {
|
||||
return (
|
||||
<>
|
||||
<motion.div
|
||||
key={episode.Id}
|
||||
onClick={() => navigate(`/episode/${episode.Id}`)}
|
||||
initial={{
|
||||
transform: "translateY(10px)",
|
||||
opacity: 0,
|
||||
@@ -1104,34 +1036,76 @@ const SeriesTitlePage = () => {
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
className="item-detail-episode"
|
||||
>
|
||||
<EpisodeCard
|
||||
item={episode}
|
||||
cardTitle={
|
||||
episode.ParentIndexNumber === 0
|
||||
? `${episode.SeasonName} - ${episode.Name}`
|
||||
: episode.IndexNumberEnd
|
||||
? `${episode.IndexNumber}-${episode.IndexNumberEnd}. ${episode.Name}`
|
||||
: `${episode.IndexNumber}. ${episode.Name}`
|
||||
<Typography variant="h6">{episode.IndexNumber ?? 0}</Typography>
|
||||
<div className="item-detail-episode-image-container">
|
||||
<div className="item-detail-episode-image-overlay">
|
||||
<PlayButton item={episode} itemId={episode.Id} itemType="Episode" itemUserData={episode.UserData} userId={user.data.Id} currentAudioTrack={0} currentVideoTrack={0} currentSubTrack={0} size="medium" buttonProps={{
|
||||
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.getItemImageUrl(episode.Id, "Primary", {
|
||||
tag: episode.ImageTags.Primary
|
||||
})} className="item-detail-episode-image" onLoad={(e) => {
|
||||
e.target.style.opacity = 1;
|
||||
}} />
|
||||
{episode.UserData?.PlaybackPositionTicks > 0 &&
|
||||
<div className="card-progress-container">
|
||||
<div
|
||||
className="card-progress"
|
||||
style={{
|
||||
width: `${episode.UserData?.PlayedPercentage}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
cardCaption={episode.Overview}
|
||||
imageBlurhash={
|
||||
!!episode.ImageBlurHashes?.Primary &&
|
||||
episode.ImageBlurHashes?.Primary[
|
||||
Object.keys(episode.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
}
|
||||
queryKey={[
|
||||
"item",
|
||||
id,
|
||||
`season ${currentSeason + 1}`,
|
||||
"episodes",
|
||||
]}
|
||||
userId={user.data.Id}
|
||||
/>
|
||||
</div>
|
||||
<div className="item-detail-episode-info">
|
||||
<Typography variant="h6">{episode.Name}</Typography>
|
||||
<div className="flex flex-row flex-align-center" style={{
|
||||
gap: "0.5em",
|
||||
}}>
|
||||
<Chip variant="filled" label={getEpisodeDateString(new Date(episode.PremiereDate))} size="small" />
|
||||
<Typography variant="subtitle1" >{getRuntimeCompact(episode.RunTimeTicks)}</Typography>
|
||||
</div>
|
||||
<Typography style={{
|
||||
display: "-webkit-box",
|
||||
textOverflow: "ellipsis",
|
||||
overflow: "hidden",
|
||||
WebkitLineClamp: 2,
|
||||
WebkitBoxOrient: "vertical",
|
||||
width: "100%",
|
||||
opacity: 0.7
|
||||
}}>{episode.Overview}</Typography>
|
||||
<div className="item-detail-episode-info-buttons">
|
||||
<LikeButton
|
||||
itemId={episode.Id}
|
||||
itemName={episode.Name}
|
||||
isFavorite={episode.UserData?.IsFavorite}
|
||||
queryKey={["item", id, `season ${currentSeason + 1}`, "episodes"]}
|
||||
userId={user.data.Id}
|
||||
/>
|
||||
<MarkPlayedButton
|
||||
itemId={episode.Id}
|
||||
itemName={episode.Name}
|
||||
isPlayed={episode.UserData?.Played}
|
||||
queryKey={["item", id, `season ${currentSeason + 1}`, "episodes"]}
|
||||
userId={user.data.Id}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
);
|
||||
})}
|
||||
{index + 1 !== episodes.data?.Items?.length && <Divider orientation="horizontal" flexItem />}
|
||||
</>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
@@ -1155,42 +1129,16 @@ const SeriesTitlePage = () => {
|
||||
imageBlurhash={
|
||||
!!special.ImageBlurHashes?.Primary &&
|
||||
special.ImageBlurHashes.Primary[
|
||||
Object.keys(special.ImageBlurHashes.Primary)[0]
|
||||
Object.keys(special.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
}
|
||||
userId={user.data.Id}
|
||||
onClick={() => {}}
|
||||
onClick={() => { }}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
)}
|
||||
{/* {item.data.People.length > 0 && (
|
||||
<CardScroller
|
||||
title="Cast & Crew"
|
||||
displayCards={8}
|
||||
disableDecoration
|
||||
>
|
||||
{item.data.People.map((person) => {
|
||||
return (
|
||||
<ActorCard
|
||||
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
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
)} */}
|
||||
{similarItems.data.TotalRecordCount > 0 && (
|
||||
<CardScroller
|
||||
title="You might also like"
|
||||
@@ -1213,18 +1161,17 @@ const SeriesTitlePage = () => {
|
||||
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
|
||||
? `${similar.ProductionYear} - ${similar.EndDate
|
||||
? new Date(similar.EndDate).toLocaleString([], {
|
||||
year: "numeric",
|
||||
})
|
||||
: "Present"
|
||||
}`
|
||||
: similar.ProductionYear
|
||||
}
|
||||
cardType={
|
||||
similar.Type === BaseItemKind.MusicAlbum ||
|
||||
similar.Type === BaseItemKind.Audio
|
||||
similar.Type === BaseItemKind.Audio
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
@@ -1233,7 +1180,7 @@ const SeriesTitlePage = () => {
|
||||
imageBlurhash={
|
||||
!!similar.ImageBlurHashes?.Primary &&
|
||||
similar.ImageBlurHashes?.Primary[
|
||||
Object.keys(similar.ImageBlurHashes.Primary)[0]
|
||||
Object.keys(similar.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
}
|
||||
/>
|
||||
@@ -151,13 +151,82 @@
|
||||
text-decoration-color: white;
|
||||
}
|
||||
}
|
||||
&-episodes-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 0.25em;
|
||||
margin-top: 0.5em;
|
||||
align-items: start;
|
||||
justify-items: center;
|
||||
&-episode{
|
||||
display:grid;
|
||||
grid-template-columns: 1.4em 16em 1fr;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
gap:1em;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
|
||||
&-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: 16em;
|
||||
aspect-ratio: 1.66666;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-radius: $border-radius-default;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
&-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;
|
||||
}
|
||||
|
||||
&:hover .item-detail-episode-image-overlay{
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,4 +264,12 @@ h1 {
|
||||
color: transparent;
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.divider-circle{
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
aspect-ratio: 1;
|
||||
border-radius: 10px;
|
||||
background: white;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ export const getRuntimeFull = (ticks) => {
|
||||
/**
|
||||
* @format
|
||||
* @param {number} ticks - C# ticks of a particular item
|
||||
* @return {number} Converted ticks to Hhr Mmin formate
|
||||
* @return {number} Converted ticks to Hh Mm formate
|
||||
*/
|
||||
export const getRuntimeCompact = (ticks) => {
|
||||
const time = ticksToMs(ticks);
|
||||
|
||||
Reference in new issue
Block a user