feat: add new episode layout
This commit is contained in:
10 files changed
+318
-288
No files matched your search
@@ -5,7 +5,6 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Jellyplayer</title>
|
<title>Jellyplayer</title>
|
||||||
<script src="http://localhost:8097"></script>
|
|
||||||
<style>
|
<style>
|
||||||
.app-loading {
|
.app-loading {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|||||||
@@ -142,7 +142,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&-progress{
|
&-progress{
|
||||||
width: attr('data-progress');
|
// width: attr('data-progress');
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: white;
|
background: white;
|
||||||
transition: width $transition-time-default ease-in-out;
|
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 { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
import LinearProgress from "@mui/material/LinearProgress";
|
import LinearProgress from "@mui/material/LinearProgress";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
|
|
||||||
import { getTypeIcon } from "../utils/iconsCollection";
|
import {
|
||||||
import "./card.module.scss";
|
type BaseItemDto,
|
||||||
|
BaseItemKind,
|
||||||
import { BaseItemDto, BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
} from "@jellyfin/sdk/lib/generated-client";
|
||||||
import { useApi } from "../../utils/store/api";
|
import { useApi } from "../../utils/store/api";
|
||||||
import LikeButton from "../buttons/likeButton";
|
import LikeButton from "../buttons/likeButton";
|
||||||
import MarkPlayedButton from "../buttons/markPlayedButton";
|
import MarkPlayedButton from "../buttons/markPlayedButton";
|
||||||
import PlayButton from "../buttons/playButton";
|
import PlayButton from "../buttons/playButton";
|
||||||
import ErrorBoundary from "../errorBoundary";
|
import ErrorBoundary from "../errorBoundary";
|
||||||
|
import { getTypeIcon } from "../utils/iconsCollection";
|
||||||
|
import "./card.module.scss";
|
||||||
|
|
||||||
const cardImageAspectRatios = {
|
const cardImageAspectRatios = {
|
||||||
thumb: 1.777,
|
thumb: 1.777,
|
||||||
@@ -54,7 +59,7 @@ export const Card = ({
|
|||||||
hideText: boolean;
|
hideText: boolean;
|
||||||
onClick: Function | null;
|
onClick: Function | null;
|
||||||
disableOverlay: boolean;
|
disableOverlay: boolean;
|
||||||
overrideIcon: React.Component | null;
|
overrideIcon: any;
|
||||||
}) => {
|
}) => {
|
||||||
const [api] = useApi((state) => [state.api]);
|
const [api] = useApi((state) => [state.api]);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -84,12 +89,16 @@ export const Card = ({
|
|||||||
opacity: item.UserData?.Played ? 1 : 0,
|
opacity: item.UserData?.Played ? 1 : 0,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="material-symbols-rounded">done</div>
|
<div className="material-symbols-rounded">
|
||||||
|
done
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className={"card-indicator text"}
|
className={"card-indicator text"}
|
||||||
style={{
|
style={{
|
||||||
opacity: item.UserData?.UnplayedItemCount ? 1 : 0,
|
opacity: item.UserData?.UnplayedItemCount
|
||||||
|
? 1
|
||||||
|
: 0,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography
|
<Typography
|
||||||
@@ -112,7 +121,9 @@ export const Card = ({
|
|||||||
/>
|
/>
|
||||||
)} */}
|
)} */}
|
||||||
<div className="card-image-icon-container">
|
<div className="card-image-icon-container">
|
||||||
{overrideIcon ? getTypeIcon(overrideIcon) : getTypeIcon(item.Type)}
|
{overrideIcon
|
||||||
|
? getTypeIcon(overrideIcon)
|
||||||
|
: getTypeIcon(item.Type)}
|
||||||
</div>
|
</div>
|
||||||
<img
|
<img
|
||||||
alt={item.Name}
|
alt={item.Name}
|
||||||
@@ -120,14 +131,13 @@ export const Card = ({
|
|||||||
overrideIcon === "User"
|
overrideIcon === "User"
|
||||||
? `${api.basePath}/Users/${item.Id}/Images/Primary`
|
? `${api.basePath}/Users/${item.Id}/Images/Primary`
|
||||||
: api.getItemImageUrl(
|
: api.getItemImageUrl(
|
||||||
seriesId ? item.SeriesId : item.AlbumId ?? item.Id,
|
seriesId
|
||||||
|
? item.SeriesId
|
||||||
|
: item.AlbumId ?? item.Id,
|
||||||
imageType,
|
imageType,
|
||||||
{
|
{
|
||||||
quality: 90,
|
quality: 90,
|
||||||
fillHeight: 226,
|
fillWidth: 400,
|
||||||
fillWidth: Math.floor(
|
|
||||||
226 / cardImageAspectRatios[cardType],
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -159,12 +169,16 @@ export const Card = ({
|
|||||||
}}
|
}}
|
||||||
iconOnly
|
iconOnly
|
||||||
audio={
|
audio={
|
||||||
item.Type === BaseItemKind.MusicAlbum ||
|
item.Type ===
|
||||||
|
BaseItemKind.MusicAlbum ||
|
||||||
item.Type === BaseItemKind.Audio ||
|
item.Type === BaseItemKind.Audio ||
|
||||||
item.Type === BaseItemKind.AudioBook ||
|
item.Type ===
|
||||||
|
BaseItemKind.AudioBook ||
|
||||||
|
item.Type === BaseItemKind.Playlist
|
||||||
|
}
|
||||||
|
playlistItem={
|
||||||
item.Type === BaseItemKind.Playlist
|
item.Type === BaseItemKind.Playlist
|
||||||
}
|
}
|
||||||
playlistItem={item.Type === BaseItemKind.Playlist}
|
|
||||||
playlistItemId={item.Id}
|
playlistItemId={item.Id}
|
||||||
/>
|
/>
|
||||||
<LikeButton
|
<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 Divider from "@mui/material/Divider";
|
||||||
import Skeleton from "@mui/material/Skeleton";
|
import Skeleton from "@mui/material/Skeleton";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import Grid from "@mui/material/Unstable_Grid2";
|
import Grid from "@mui/material/Unstable_Grid2";
|
||||||
|
import EpisodeSkeleton from "./episode";
|
||||||
|
|
||||||
import { borderRadiusDefault } from "../../palette.module.scss";
|
import { borderRadiusDefault } from "../../palette.module.scss";
|
||||||
|
|
||||||
@@ -47,80 +45,7 @@ export const SeasonSelectorSkeleton = () => {
|
|||||||
paddingBottom: " 0.5em",
|
paddingBottom: " 0.5em",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{Array.from(new Array(4)).map((a, index) => {
|
<EpisodeSkeleton/>
|
||||||
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>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</Grid>
|
</Grid>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -19,7 +19,7 @@ import { green, red, yellow } from "@mui/material/colors";
|
|||||||
import { AnimatePresence, motion, useScroll } from "framer-motion";
|
import { AnimatePresence, motion, useScroll } from "framer-motion";
|
||||||
import useParallax from "../../utils/hooks/useParallax";
|
import useParallax from "../../utils/hooks/useParallax";
|
||||||
|
|
||||||
import { useParams } from "react-router-dom";
|
import { useNavigate, useParams } from "react-router-dom";
|
||||||
|
|
||||||
import { Blurhash } from "react-blurhash";
|
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 { 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 { Card } from "../../components/card/card";
|
||||||
import { EpisodeCard } from "../../components/card/episodeCard";
|
import { EpisodeCard } from "../../components/card/episodeCard";
|
||||||
@@ -59,6 +59,7 @@ import { useApi } from "../../utils/store/api";
|
|||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
|
|
||||||
import IconLink from "../../components/iconLink";
|
import IconLink from "../../components/iconLink";
|
||||||
|
import EpisodeSkeleton from "../../components/skeleton/episode";
|
||||||
|
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
@@ -83,6 +84,13 @@ TabPanel.propTypes = {
|
|||||||
value: PropTypes.number.isRequired,
|
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 SeriesTitlePage = () => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
|
||||||
@@ -164,7 +172,7 @@ const SeriesTitlePage = () => {
|
|||||||
const result = sessionStorage.getItem(`backdrop-${item.data?.Id}`);
|
const result = sessionStorage.getItem(`backdrop-${item.data?.Id}`);
|
||||||
return result ?? "0";
|
return result ?? "0";
|
||||||
});
|
});
|
||||||
const [backdropImageLoaded , setBackdropImageLoaded] = useState(false);
|
const [backdropImageLoaded, setBackdropImageLoaded] = useState(false);
|
||||||
|
|
||||||
const [currentSeason, setCurrentSeason] = useState(() => {
|
const [currentSeason, setCurrentSeason] = useState(() => {
|
||||||
const result = sessionStorage.getItem(`season-${item.data?.Id}`);
|
const result = sessionStorage.getItem(`season-${item.data?.Id}`);
|
||||||
@@ -286,7 +294,7 @@ const SeriesTitlePage = () => {
|
|||||||
currentSeasonItem.data.Id,
|
currentSeasonItem.data.Id,
|
||||||
);
|
);
|
||||||
setBackdropImageLoaded(false)
|
setBackdropImageLoaded(false)
|
||||||
} else if (item.isSuccess && item.data?.BackdropImageTags?.length > 0 ){
|
} else if (item.isSuccess && item.data?.BackdropImageTags?.length > 0) {
|
||||||
sessionStorage.setItem(
|
sessionStorage.setItem(
|
||||||
`backdrop-${item.data?.Id}`,
|
`backdrop-${item.data?.Id}`,
|
||||||
api.getItemImageUrl(item.data.Id, "Backdrop", {
|
api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||||
@@ -309,8 +317,6 @@ const SeriesTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [currentSeasonItem.dataUpdatedAt]);
|
}, [currentSeasonItem.dataUpdatedAt]);
|
||||||
|
|
||||||
console.log(backdropImage);
|
|
||||||
|
|
||||||
const pageRef = useRef(null);
|
const pageRef = useRef(null);
|
||||||
const { scrollYProgress } = useScroll({
|
const { scrollYProgress } = useScroll({
|
||||||
target: pageRef,
|
target: pageRef,
|
||||||
@@ -318,6 +324,8 @@ const SeriesTitlePage = () => {
|
|||||||
});
|
});
|
||||||
const parallax = useParallax(scrollYProgress, 50);
|
const parallax = useParallax(scrollYProgress, 50);
|
||||||
|
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
if (item.isPending || similarItems.isPending) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -355,34 +363,34 @@ const SeriesTitlePage = () => {
|
|||||||
<div className="item-hero-backdrop-container">
|
<div className="item-hero-backdrop-container">
|
||||||
<AnimatePresence mode="wait">
|
<AnimatePresence mode="wait">
|
||||||
|
|
||||||
{item.data.BackdropImageTags ? (
|
{item.data.BackdropImageTags ? (
|
||||||
<motion.img
|
<motion.img
|
||||||
key={currentSeasonItem.dataUpdatedAt}
|
key={currentSeasonItem.dataUpdatedAt}
|
||||||
alt={item.data.Name}
|
alt={item.data.Name}
|
||||||
src={backdropImage}
|
src={backdropImage}
|
||||||
className="item-hero-backdrop"
|
className="item-hero-backdrop"
|
||||||
initial={{
|
initial={{
|
||||||
opacity: 0
|
opacity: 0
|
||||||
}}
|
}}
|
||||||
onLoad={() => {
|
onLoad={() => {
|
||||||
setBackdropImageLoaded(true)
|
setBackdropImageLoaded(true)
|
||||||
}}
|
}}
|
||||||
animate={{
|
animate={{
|
||||||
opacity: backdropImageLoaded ? 1 : 0
|
opacity: backdropImageLoaded ? 1 : 0
|
||||||
}}
|
}}
|
||||||
exit={{
|
exit={{
|
||||||
opacity:0
|
opacity: 0
|
||||||
}}
|
}}
|
||||||
transition={{
|
transition={{
|
||||||
duration: 0.2
|
duration: 0.2
|
||||||
}}
|
}}
|
||||||
style={{
|
style={{
|
||||||
y: parallax,
|
y: parallax,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
)}
|
)}
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -396,7 +404,7 @@ const SeriesTitlePage = () => {
|
|||||||
<Blurhash
|
<Blurhash
|
||||||
hash={
|
hash={
|
||||||
item.data.ImageBlurHashes.Primary[
|
item.data.ImageBlurHashes.Primary[
|
||||||
item.data.ImageTags.Primary
|
item.data.ImageTags.Primary
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
className="item-hero-image-blurhash"
|
className="item-hero-image-blurhash"
|
||||||
@@ -445,7 +453,7 @@ const SeriesTitlePage = () => {
|
|||||||
{item.data.Status === "Continuing"
|
{item.data.Status === "Continuing"
|
||||||
? " - Present"
|
? " - Present"
|
||||||
: item.data.EndDate &&
|
: item.data.EndDate &&
|
||||||
` - ${new Date(item.data.EndDate).getFullYear()}`}
|
` - ${new Date(item.data.EndDate).getFullYear()}`}
|
||||||
</Typography>
|
</Typography>
|
||||||
{item.data.OfficialRating && (
|
{item.data.OfficialRating && (
|
||||||
<Chip variant="filled" label={item.data.OfficialRating} />
|
<Chip variant="filled" label={item.data.OfficialRating} />
|
||||||
@@ -529,7 +537,7 @@ const SeriesTitlePage = () => {
|
|||||||
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
|
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
|
||||||
{endsAt(
|
{endsAt(
|
||||||
item.data.RunTimeTicks -
|
item.data.RunTimeTicks -
|
||||||
item.data.UserData.PlaybackPositionTicks,
|
item.data.UserData.PlaybackPositionTicks,
|
||||||
)}
|
)}
|
||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
@@ -586,7 +594,7 @@ const SeriesTitlePage = () => {
|
|||||||
<Typography>
|
<Typography>
|
||||||
{getRuntime(
|
{getRuntime(
|
||||||
item.data.RunTimeTicks -
|
item.data.RunTimeTicks -
|
||||||
item.data.UserData.PlaybackPositionTicks,
|
item.data.UserData.PlaybackPositionTicks,
|
||||||
)}{" "}
|
)}{" "}
|
||||||
left
|
left
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -892,7 +900,7 @@ const SeriesTitlePage = () => {
|
|||||||
cardCaption={episode.Overview}
|
cardCaption={episode.Overview}
|
||||||
imageBlurhash={
|
imageBlurhash={
|
||||||
episode.ImageBlurHashes?.Primary[
|
episode.ImageBlurHashes?.Primary[
|
||||||
Object.keys(episode.ImageBlurHashes.Primary)[0]
|
Object.keys(episode.ImageBlurHashes.Primary)[0]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
queryKey={[
|
queryKey={[
|
||||||
@@ -1001,91 +1009,15 @@ const SeriesTitlePage = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Divider />
|
<Divider />
|
||||||
<div className="item-detail-episodes-container">
|
<div className="item-detail-episode-container">
|
||||||
{episodes.isPending
|
{episodes.isPending
|
||||||
? Array.from(new Array(4)).map((a, index) => {
|
? <EpisodeSkeleton />
|
||||||
return (
|
: episodes.data.Items.map((episode, index) => {
|
||||||
<MuiCard
|
return (
|
||||||
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 (
|
|
||||||
<motion.div
|
<motion.div
|
||||||
key={episode.Id}
|
key={episode.Id}
|
||||||
|
onClick={() => navigate(`/episode/${episode.Id}`)}
|
||||||
initial={{
|
initial={{
|
||||||
transform: "translateY(10px)",
|
transform: "translateY(10px)",
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
@@ -1104,34 +1036,76 @@ const SeriesTitlePage = () => {
|
|||||||
style={{
|
style={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
}}
|
}}
|
||||||
|
className="item-detail-episode"
|
||||||
>
|
>
|
||||||
<EpisodeCard
|
<Typography variant="h6">{episode.IndexNumber ?? 0}</Typography>
|
||||||
item={episode}
|
<div className="item-detail-episode-image-container">
|
||||||
cardTitle={
|
<div className="item-detail-episode-image-overlay">
|
||||||
episode.ParentIndexNumber === 0
|
<PlayButton item={episode} itemId={episode.Id} itemType="Episode" itemUserData={episode.UserData} userId={user.data.Id} currentAudioTrack={0} currentVideoTrack={0} currentSubTrack={0} size="medium" buttonProps={{
|
||||||
? `${episode.SeasonName} - ${episode.Name}`
|
color: "white",
|
||||||
: episode.IndexNumberEnd
|
style: {
|
||||||
? `${episode.IndexNumber}-${episode.IndexNumberEnd}. ${episode.Name}`
|
color: "black ",
|
||||||
: `${episode.IndexNumber}. ${episode.Name}`
|
},
|
||||||
|
}} 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}
|
</div>
|
||||||
imageBlurhash={
|
<div className="item-detail-episode-info">
|
||||||
!!episode.ImageBlurHashes?.Primary &&
|
<Typography variant="h6">{episode.Name}</Typography>
|
||||||
episode.ImageBlurHashes?.Primary[
|
<div className="flex flex-row flex-align-center" style={{
|
||||||
Object.keys(episode.ImageBlurHashes.Primary)[0]
|
gap: "0.5em",
|
||||||
]
|
}}>
|
||||||
}
|
<Chip variant="filled" label={getEpisodeDateString(new Date(episode.PremiereDate))} size="small" />
|
||||||
queryKey={[
|
<Typography variant="subtitle1" >{getRuntimeCompact(episode.RunTimeTicks)}</Typography>
|
||||||
"item",
|
</div>
|
||||||
id,
|
<Typography style={{
|
||||||
`season ${currentSeason + 1}`,
|
display: "-webkit-box",
|
||||||
"episodes",
|
textOverflow: "ellipsis",
|
||||||
]}
|
overflow: "hidden",
|
||||||
userId={user.data.Id}
|
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>
|
</motion.div>
|
||||||
);
|
{index + 1 !== episodes.data?.Items?.length && <Divider orientation="horizontal" flexItem />}
|
||||||
})}
|
</>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -1155,42 +1129,16 @@ const SeriesTitlePage = () => {
|
|||||||
imageBlurhash={
|
imageBlurhash={
|
||||||
!!special.ImageBlurHashes?.Primary &&
|
!!special.ImageBlurHashes?.Primary &&
|
||||||
special.ImageBlurHashes.Primary[
|
special.ImageBlurHashes.Primary[
|
||||||
Object.keys(special.ImageBlurHashes.Primary)[0]
|
Object.keys(special.ImageBlurHashes.Primary)[0]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
userId={user.data.Id}
|
userId={user.data.Id}
|
||||||
onClick={() => {}}
|
onClick={() => { }}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</CardScroller>
|
</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 && (
|
{similarItems.data.TotalRecordCount > 0 && (
|
||||||
<CardScroller
|
<CardScroller
|
||||||
title="You might also like"
|
title="You might also like"
|
||||||
@@ -1213,18 +1161,17 @@ const SeriesTitlePage = () => {
|
|||||||
similar.Type === BaseItemKind.Episode
|
similar.Type === BaseItemKind.Episode
|
||||||
? `S${similar.ParentIndexNumber}:E${similar.IndexNumber} - ${similar.Name}`
|
? `S${similar.ParentIndexNumber}:E${similar.IndexNumber} - ${similar.Name}`
|
||||||
: similar.Type === BaseItemKind.Series
|
: similar.Type === BaseItemKind.Series
|
||||||
? `${similar.ProductionYear} - ${
|
? `${similar.ProductionYear} - ${similar.EndDate
|
||||||
similar.EndDate
|
? new Date(similar.EndDate).toLocaleString([], {
|
||||||
? new Date(similar.EndDate).toLocaleString([], {
|
year: "numeric",
|
||||||
year: "numeric",
|
})
|
||||||
})
|
: "Present"
|
||||||
: "Present"
|
}`
|
||||||
}`
|
: similar.ProductionYear
|
||||||
: similar.ProductionYear
|
|
||||||
}
|
}
|
||||||
cardType={
|
cardType={
|
||||||
similar.Type === BaseItemKind.MusicAlbum ||
|
similar.Type === BaseItemKind.MusicAlbum ||
|
||||||
similar.Type === BaseItemKind.Audio
|
similar.Type === BaseItemKind.Audio
|
||||||
? "square"
|
? "square"
|
||||||
: "portrait"
|
: "portrait"
|
||||||
}
|
}
|
||||||
@@ -1233,7 +1180,7 @@ const SeriesTitlePage = () => {
|
|||||||
imageBlurhash={
|
imageBlurhash={
|
||||||
!!similar.ImageBlurHashes?.Primary &&
|
!!similar.ImageBlurHashes?.Primary &&
|
||||||
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;
|
text-decoration-color: white;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-episodes-container {
|
&-episode{
|
||||||
display: grid;
|
display:grid;
|
||||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
grid-template-columns: 1.4em 16em 1fr;
|
||||||
gap: 0.25em;
|
flex-direction: row;
|
||||||
margin-top: 0.5em;
|
width: 100%;
|
||||||
align-items: start;
|
gap:1em;
|
||||||
justify-items: center;
|
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;
|
color: transparent;
|
||||||
-webkit-background-clip: text;
|
-webkit-background-clip: text;
|
||||||
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
|
* @format
|
||||||
* @param {number} ticks - C# ticks of a particular item
|
* @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) => {
|
export const getRuntimeCompact = (ticks) => {
|
||||||
const time = ticksToMs(ticks);
|
const time = ticksToMs(ticks);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
"dom.iterable",
|
"dom.iterable",
|
||||||
"esnext"
|
"esnext"
|
||||||
],
|
],
|
||||||
|
"checkJs": true,
|
||||||
"allowJs": true, // Allow JavaScript files to be compiled
|
"allowJs": true, // Allow JavaScript files to be compiled
|
||||||
"skipLibCheck": true, // Skip type checking of all declaration files
|
"skipLibCheck": true, // Skip type checking of all declaration files
|
||||||
"esModuleInterop": true, // Disables namespace imports (import * as fs from "fs") and enables CJS/AMD/UMD style imports (import fs from "fs")
|
"esModuleInterop": true, // Disables namespace imports (import * as fs from "fs") and enables CJS/AMD/UMD style imports (import fs from "fs")
|
||||||
|
|||||||
Reference in new issue
Block a user