Complete EpisodeTitlePage #160
This commit is contained in:
17 files changed
+493
-138
No files matched your search
+11
-5
@@ -72,13 +72,17 @@ import { delUser, getUser } from "./utils/storage/user.js";
|
|||||||
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { useBackdropStore } from "./utils/store/backdrop.js";
|
import { useBackdropStore } from "./utils/store/backdrop.js";
|
||||||
import { usePlaybackDataLoadStore } from "./utils/store/playback.js";
|
import {
|
||||||
|
usePlaybackDataLoadStore,
|
||||||
|
usePlaybackStore,
|
||||||
|
} from "./utils/store/playback.js";
|
||||||
import BoxSetTitlePage from "./routes/boxset/index.jsx";
|
import BoxSetTitlePage from "./routes/boxset/index.jsx";
|
||||||
import PersonTitlePage from "./routes/person/index.jsx";
|
import PersonTitlePage from "./routes/person/index.jsx";
|
||||||
import MusicAlbumTitlePage from "./routes/album/index.jsx";
|
import MusicAlbumTitlePage from "./routes/album/index.jsx";
|
||||||
import AudioPlayer from "./components/playback/audioPlayer/index.jsx";
|
import AudioPlayer from "./components/playback/audioPlayer/index.jsx";
|
||||||
import { useAudioPlayback } from "./utils/store/audioPlayback.js";
|
import { useAudioPlayback } from "./utils/store/audioPlayback.js";
|
||||||
import ArtistTitlePage from "./routes/artist/index.jsx";
|
import ArtistTitlePage from "./routes/artist/index.jsx";
|
||||||
|
import EpisodeTitlePage from "./routes/episode/index.jsx";
|
||||||
|
|
||||||
const jellyfin = new Jellyfin({
|
const jellyfin = new Jellyfin({
|
||||||
clientInfo: {
|
clientInfo: {
|
||||||
@@ -268,9 +272,6 @@ function App() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
useEffect(() => {
|
|
||||||
window.scrollTo(0, 0);
|
|
||||||
}, [location.pathname]);
|
|
||||||
|
|
||||||
if (!window.api) {
|
if (!window.api) {
|
||||||
serverAvailable().then((available) => {
|
serverAvailable().then((available) => {
|
||||||
@@ -489,6 +490,11 @@ function App() {
|
|||||||
path="/boxset/:id"
|
path="/boxset/:id"
|
||||||
element={<BoxSetTitlePage />}
|
element={<BoxSetTitlePage />}
|
||||||
/>
|
/>
|
||||||
|
<Route
|
||||||
|
exact
|
||||||
|
path="/episode/:id"
|
||||||
|
element={<EpisodeTitlePage />}
|
||||||
|
/>
|
||||||
<Route
|
<Route
|
||||||
exact
|
exact
|
||||||
path="/person/:id"
|
path="/person/:id"
|
||||||
@@ -519,7 +525,7 @@ function App() {
|
|||||||
</Route>
|
</Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
</div>
|
</div>
|
||||||
{/* <ReactQueryDevtools /> */}
|
<ReactQueryDevtools />
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</SnackbarProvider>
|
</SnackbarProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ const availableSpecialRoutes = [
|
|||||||
BaseItemKind.Series,
|
BaseItemKind.Series,
|
||||||
BaseItemKind.BoxSet,
|
BaseItemKind.BoxSet,
|
||||||
BaseItemKind.MusicAlbum,
|
BaseItemKind.MusicAlbum,
|
||||||
|
BaseItemKind.Episode,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
|||||||
import { MdiTelevisionClassic } from "../icons/mdiTelevisionClassic";
|
import { MdiTelevisionClassic } from "../icons/mdiTelevisionClassic";
|
||||||
import { getRuntimeCompact } from "../../utils/date/time";
|
import { getRuntimeCompact } from "../../utils/date/time";
|
||||||
|
|
||||||
const availableSpecialRoutes = [BaseItemKind.Series];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Props
|
* @typedef {Object} Props
|
||||||
* @property {import("@jellyfin/sdk/lib/generated-client/models").BaseItemDto} item
|
* @property {import("@jellyfin/sdk/lib/generated-client/models").BaseItemDto} item
|
||||||
@@ -48,11 +46,7 @@ export const EpisodeCard = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const defaultOnClick = () => {
|
const defaultOnClick = () => {
|
||||||
if (availableSpecialRoutes.includes(item.Type)) {
|
navigate(`/episode/${item.Id}`);
|
||||||
navigate(`/${item.Type.toLocaleLowerCase()}/${item.Id}`);
|
|
||||||
} else {
|
|
||||||
navigate(`/item/${item.Id}`);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<CardActionArea
|
<CardActionArea
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ export const CardScroller = ({
|
|||||||
arrows={false}
|
arrows={false}
|
||||||
ref={(el) => setCarouselRef(el)}
|
ref={(el) => setCarouselRef(el)}
|
||||||
className="card-scroller"
|
className="card-scroller"
|
||||||
|
customTransition="all .6s"
|
||||||
|
transitionDuration={600}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</Carousel>
|
</Carousel>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import React, { useEffect, useState, useRef } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import TextField from "@mui/material/TextField";
|
import TextField from "@mui/material/TextField";
|
||||||
import MenuItem from "@mui/material/MenuItem";
|
import MenuItem from "@mui/material/MenuItem";
|
||||||
import Chip from "@mui/material/Chip";
|
import Chip from "@mui/material/Chip";
|
||||||
@@ -24,7 +24,6 @@ import PlayButton from "../../buttons/playButton";
|
|||||||
|
|
||||||
import "./hero.module.scss";
|
import "./hero.module.scss";
|
||||||
import { Blurhash } from "react-blurhash";
|
import { Blurhash } from "react-blurhash";
|
||||||
import { MediaTypeIconCollection } from "../../utils/iconsCollection";
|
|
||||||
import TextLink from "../../textLink";
|
import TextLink from "../../textLink";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,6 +41,7 @@ import TextLink from "../../textLink";
|
|||||||
* @property {bool} disableMarkAsPlayedButton
|
* @property {bool} disableMarkAsPlayedButton
|
||||||
* @property {string} albumBy
|
* @property {string} albumBy
|
||||||
* @property {bool} audioPlayButton
|
* @property {bool} audioPlayButton
|
||||||
|
* @property {bool} favourParentImg
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,9 +63,9 @@ const Hero = ({
|
|||||||
disableMarkAsPlayedButton,
|
disableMarkAsPlayedButton,
|
||||||
albumBy,
|
albumBy,
|
||||||
audioPlayButton = false,
|
audioPlayButton = false,
|
||||||
|
favourParentImg = true,
|
||||||
|
isEpisode = false,
|
||||||
}) => {
|
}) => {
|
||||||
const backgroundRef = useRef(null);
|
|
||||||
|
|
||||||
const filterMediaStreamVideo = (source) => {
|
const filterMediaStreamVideo = (source) => {
|
||||||
if (source.Type == MediaStreamType.Video) {
|
if (source.Type == MediaStreamType.Video) {
|
||||||
return true;
|
return true;
|
||||||
@@ -105,12 +105,12 @@ const Hero = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="item-detail-hero"
|
className="item-detail-hero hero"
|
||||||
style={{
|
style={{
|
||||||
marginBottom: "2em",
|
marginBottom: "2em",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="hero-backdrop" ref={backgroundRef}>
|
<div className="hero-backdrop">
|
||||||
{!!item.ImageBlurHashes.Backdrop && (
|
{!!item.ImageBlurHashes.Backdrop && (
|
||||||
<>
|
<>
|
||||||
{Object.keys(item.ImageBlurHashes.Backdrop)
|
{Object.keys(item.ImageBlurHashes.Backdrop)
|
||||||
@@ -124,7 +124,6 @@ const Hero = ({
|
|||||||
)[0]
|
)[0]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
// hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
|
|
||||||
width="1080"
|
width="1080"
|
||||||
height="720"
|
height="720"
|
||||||
resolutionX={64}
|
resolutionX={64}
|
||||||
@@ -150,65 +149,65 @@ const Hero = ({
|
|||||||
)}
|
)}
|
||||||
<div className="hero-backdrop-icon-container"></div>
|
<div className="hero-backdrop-icon-container"></div>
|
||||||
</div>
|
</div>
|
||||||
<div className="item-detail-primaryImage">
|
|
||||||
<Card
|
|
||||||
item={item}
|
|
||||||
seriesId={item.SeriesId}
|
|
||||||
imageType={"Primary"}
|
|
||||||
cardType={
|
|
||||||
item.Type == BaseItemKind.MusicAlbum ||
|
|
||||||
item.Type == BaseItemKind.Audio
|
|
||||||
? "square"
|
|
||||||
: "portrait"
|
|
||||||
}
|
|
||||||
queryKey={queryKey}
|
|
||||||
userId={userId}
|
|
||||||
imageBlurhash={
|
|
||||||
!!item.ImageBlurHashes?.Primary &&
|
|
||||||
item.ImageBlurHashes?.Primary[
|
|
||||||
Object.keys(item.ImageBlurHashes.Primary)[0]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
hideText
|
|
||||||
disablePadding
|
|
||||||
disableOverlay
|
|
||||||
onClick={() => {}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div
|
<div
|
||||||
className="item-detail-hero-info-container"
|
className="item-detail-hero-info-container"
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
|
width: "100%",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div className="item-name">
|
||||||
className="item-name"
|
{isEpisode ? (
|
||||||
style={{
|
<>
|
||||||
marginTop: "4em",
|
<TextLink
|
||||||
}}
|
variant="h2"
|
||||||
>
|
location={`/series/${item.SeriesId}`}
|
||||||
<Typography variant="h2" fontWeight={300}>
|
otherProps={{
|
||||||
{!!item.ImageTags.Logo ? (
|
fontWeight: 300,
|
||||||
<img
|
|
||||||
src={
|
|
||||||
!!item.SeriesId
|
|
||||||
? `${window.api.basePath}/Items/${item.SeriesId}/Images/Logo`
|
|
||||||
: `${window.api.basePath}/Items/${item.Id}/Images/Logo`
|
|
||||||
}
|
|
||||||
className="hero-name-logo"
|
|
||||||
onLoad={(e) => {
|
|
||||||
e.target.style.opacity = 1;
|
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
) : (
|
{!!item.ParentLogoImageTag ? (
|
||||||
item.Name
|
<img
|
||||||
)}
|
src={`${window.api.basePath}/Items/${item.SeriesId}/Images/Logo`}
|
||||||
</Typography>
|
className="hero-name-logo"
|
||||||
|
onLoad={(e) => {
|
||||||
|
e.target.style.opacity = 1;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
item.SeriesName
|
||||||
|
)}
|
||||||
|
</TextLink>
|
||||||
|
<Typography
|
||||||
|
variant="h3"
|
||||||
|
fontWeight={300}
|
||||||
|
>
|
||||||
|
{`S${item.ParentIndexNumber}:E${item.IndexNumber} ${item.Name}`}
|
||||||
|
</Typography>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<Typography variant="h2" fontWeight={300}>
|
||||||
|
{!!item.ImageTags.Logo ? (
|
||||||
|
<img
|
||||||
|
src={
|
||||||
|
!!item.SeriesId
|
||||||
|
? `${window.api.basePath}/Items/${item.SeriesId}/Images/Logo`
|
||||||
|
: `${window.api.basePath}/Items/${item.Id}/Images/Logo`
|
||||||
|
}
|
||||||
|
className="hero-name-logo"
|
||||||
|
onLoad={(e) => {
|
||||||
|
e.target.style.opacity = 1;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
item.Name
|
||||||
|
)}
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
{!!albumBy && (
|
{!!albumBy && (
|
||||||
<TextLink
|
<TextLink
|
||||||
text={`By ${albumBy.Name}`}
|
|
||||||
variant="h6"
|
variant="h6"
|
||||||
location={`/artist/${albumBy.Id}`}
|
location={`/artist/${albumBy.Id}`}
|
||||||
otherProps={{
|
otherProps={{
|
||||||
@@ -218,7 +217,7 @@ const Hero = ({
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
By {albumBy}
|
By {albumBy.Name}
|
||||||
</TextLink>
|
</TextLink>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -556,10 +555,12 @@ const Hero = ({
|
|||||||
{writers.map((writer, index) => (
|
{writers.map((writer, index) => (
|
||||||
<>
|
<>
|
||||||
<TextLink
|
<TextLink
|
||||||
text={writer.Name}
|
key={index}
|
||||||
variant={"subtitle1"}
|
variant={"subtitle1"}
|
||||||
location={`/person/${writer.Id}`}
|
location={`/person/${writer.Id}`}
|
||||||
/>
|
>
|
||||||
|
{writer.Name}
|
||||||
|
</TextLink>
|
||||||
{index !=
|
{index !=
|
||||||
writers.length - 1 && (
|
writers.length - 1 && (
|
||||||
<span
|
<span
|
||||||
@@ -596,10 +597,12 @@ const Hero = ({
|
|||||||
{directors.map((director, index) => (
|
{directors.map((director, index) => (
|
||||||
<>
|
<>
|
||||||
<TextLink
|
<TextLink
|
||||||
text={director.Name}
|
key={index}
|
||||||
variant={"subtitle1"}
|
variant={"subtitle1"}
|
||||||
location={`/person/${director.Id}`}
|
location={`/person/${director.Id}`}
|
||||||
/>
|
>
|
||||||
|
{director.Name}
|
||||||
|
</TextLink>
|
||||||
{index !=
|
{index !=
|
||||||
directors.length - 1 && (
|
directors.length - 1 && (
|
||||||
<span
|
<span
|
||||||
@@ -636,10 +639,12 @@ const Hero = ({
|
|||||||
{artists.map((artist, index) => (
|
{artists.map((artist, index) => (
|
||||||
<>
|
<>
|
||||||
<TextLink
|
<TextLink
|
||||||
text={artist.Name}
|
key={index}
|
||||||
variant={"subtitle1"}
|
variant={"subtitle1"}
|
||||||
location={`/artist/${artist.Id}`}
|
location={`/artist/${artist.Id}`}
|
||||||
/>
|
>
|
||||||
|
{artist.Name}
|
||||||
|
</TextLink>
|
||||||
{index !=
|
{index !=
|
||||||
artists.length - 1 && (
|
artists.length - 1 && (
|
||||||
<span
|
<span
|
||||||
@@ -681,6 +686,33 @@ const Hero = ({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="item-detail-primaryImage">
|
||||||
|
<Card
|
||||||
|
item={item}
|
||||||
|
seriesId={favourParentImg && item.SeriesId}
|
||||||
|
imageType={"Primary"}
|
||||||
|
cardType={
|
||||||
|
item.Type == BaseItemKind.MusicAlbum ||
|
||||||
|
item.Type == BaseItemKind.Audio
|
||||||
|
? "square"
|
||||||
|
: item.Type == BaseItemKind.Episode
|
||||||
|
? "thumb"
|
||||||
|
: "portrait"
|
||||||
|
}
|
||||||
|
queryKey={queryKey}
|
||||||
|
userId={userId}
|
||||||
|
imageBlurhash={
|
||||||
|
!!item.ImageBlurHashes?.Primary &&
|
||||||
|
item.ImageBlurHashes?.Primary[
|
||||||
|
Object.keys(item.ImageBlurHashes.Primary)[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
hideText
|
||||||
|
disablePadding
|
||||||
|
disableOverlay
|
||||||
|
onClick={() => {}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,9 +1,18 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
$maskPercentage: 40%;
|
$maskPercentage: 40%;
|
||||||
.hero {
|
.hero {
|
||||||
position: relative;
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
gap: 2em;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-right: 1em;
|
||||||
|
.item-detail-primaryImage {
|
||||||
|
width: 26%;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
&-backdrop {
|
&-backdrop {
|
||||||
position: absolute;
|
position: fixed;
|
||||||
|
background-attachment: fixed;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -55,8 +64,8 @@ $maskPercentage: 40%;
|
|||||||
}
|
}
|
||||||
|
|
||||||
&-name-logo {
|
&-name-logo {
|
||||||
width: 8.3em;
|
width: 10.4em;
|
||||||
height: 2.3em;
|
height: 2.6em;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
object-position: left;
|
object-position: left;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export const SideMenu = ({}) => {
|
|||||||
sx: {
|
sx: {
|
||||||
backgroundColor: "inherit",
|
backgroundColor: "inherit",
|
||||||
border: "none",
|
border: "none",
|
||||||
width: `calc(${theme.spacing(7)} + 10px)`,
|
width: `4em`,
|
||||||
height: "100vh",
|
height: "100vh",
|
||||||
zIndex: "1",
|
zIndex: "1",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { useNavigate } from "react-router-dom";
|
|||||||
|
|
||||||
import "./textLink.module.scss";
|
import "./textLink.module.scss";
|
||||||
|
|
||||||
const TextLink = ({ text, location, variant, otherProps }) => {
|
const TextLink = ({ children, location, variant, otherProps }) => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -15,7 +15,7 @@ const TextLink = ({ text, location, variant, otherProps }) => {
|
|||||||
onClick={() => navigate(location)}
|
onClick={() => navigate(location)}
|
||||||
{...otherProps}
|
{...otherProps}
|
||||||
>
|
>
|
||||||
{text}
|
{children}
|
||||||
</Typography>
|
</Typography>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
text-decoration-color: rgb(255 255 255 / 0.5);
|
text-decoration-color: rgb(255 255 255 / 0.5);
|
||||||
white-space: pre-line;
|
white-space: pre-line;
|
||||||
|
width: fit-content;
|
||||||
&:hover {
|
&:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-decoration-color: rgb(255 255 255 / 1);
|
text-decoration-color: rgb(255 255 255 / 1);
|
||||||
|
|||||||
@@ -261,6 +261,7 @@ const ArtistTitlePage = () => {
|
|||||||
queryKey={["item", id]}
|
queryKey={["item", id]}
|
||||||
disableMarkAsPlayedButton
|
disableMarkAsPlayedButton
|
||||||
audioPlayButton
|
audioPlayButton
|
||||||
|
disableInfoStrip
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="item-detail-artist-container">
|
<div className="item-detail-artist-container">
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
.episode .item-detail-primaryImage {
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
@@ -0,0 +1,328 @@
|
|||||||
|
/** @format */
|
||||||
|
import { useState, useEffect, useRef } from "react";
|
||||||
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
|
import Box from "@mui/material/Box";
|
||||||
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
|
import Typography from "@mui/material/Typography";
|
||||||
|
import Stack from "@mui/material/Stack";
|
||||||
|
import Chip from "@mui/material/Chip";
|
||||||
|
import Divider from "@mui/material/Divider";
|
||||||
|
import LinearProgress from "@mui/material/LinearProgress";
|
||||||
|
import Tabs from "@mui/material/Tabs";
|
||||||
|
import Tab from "@mui/material/Tab";
|
||||||
|
import Grid2 from "@mui/material/Unstable_Grid2";
|
||||||
|
import Button from "@mui/material/Button";
|
||||||
|
import IconButton from "@mui/material/IconButton";
|
||||||
|
import Paper from "@mui/material/Paper";
|
||||||
|
import TableContainer from "@mui/material/TableContainer";
|
||||||
|
import Table from "@mui/material/Table";
|
||||||
|
import TableHead from "@mui/material/TableHead";
|
||||||
|
import TableRow from "@mui/material/TableRow";
|
||||||
|
import TableBody from "@mui/material/TableBody";
|
||||||
|
import TableCell from "@mui/material/TableCell";
|
||||||
|
import TextField from "@mui/material/TextField";
|
||||||
|
import MenuItem from "@mui/material/MenuItem";
|
||||||
|
import Link from "@mui/material/Link";
|
||||||
|
import { green, pink, yellow } from "@mui/material/colors";
|
||||||
|
|
||||||
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
|
|
||||||
|
import { Blurhash } from "react-blurhash";
|
||||||
|
import { useParams, useNavigate, Link as RouterLink } from "react-router-dom";
|
||||||
|
|
||||||
|
import {
|
||||||
|
BaseItemKind,
|
||||||
|
ItemFields,
|
||||||
|
LocationType,
|
||||||
|
MediaStreamType,
|
||||||
|
SortOrder,
|
||||||
|
} from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
|
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||||
|
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||||
|
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||||
|
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||||
|
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||||
|
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
|
import { MdiPlayOutline } from "../../components/icons/mdiPlayOutline";
|
||||||
|
import { MdiStar } from "../../components/icons/mdiStar";
|
||||||
|
import { MdiCheck } from "../../components/icons/mdiCheck";
|
||||||
|
import { MdiHeartOutline } from "../../components/icons/mdiHeartOutline";
|
||||||
|
import { MdiHeart } from "../../components/icons/mdiHeart";
|
||||||
|
import { MdiClockOutline } from "../../components/icons/mdiClockOutline";
|
||||||
|
|
||||||
|
import { getRuntimeMusic, getRuntimeFull, endsAt } from "../../utils/date/time";
|
||||||
|
import { TypeIconCollectionCard } from "../../components/utils/iconsCollection";
|
||||||
|
|
||||||
|
import Hero from "../../components/layouts/item/hero";
|
||||||
|
import { Card } from "../../components/card/card";
|
||||||
|
import { EpisodeCard } from "../../components/card/episodeCard";
|
||||||
|
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
||||||
|
|
||||||
|
import "./episode.module.scss";
|
||||||
|
import { EpisodeCardsSkeleton } from "../../components/skeleton/episodeCards";
|
||||||
|
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||||
|
import { ArtistAlbum } from "../../components/layouts/artist/artistAlbum";
|
||||||
|
import { MdiMusic } from "../../components/icons/mdiMusic";
|
||||||
|
import { usePlaybackStore } from "../../utils/store/playback";
|
||||||
|
import { Tooltip } from "@mui/material";
|
||||||
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
|
import { ActorCard } from "../../components/card/actorCards";
|
||||||
|
function TabPanel(props) {
|
||||||
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
role="tabpanel"
|
||||||
|
hidden={value !== index}
|
||||||
|
id={`full-width-tabpanel-${index}`}
|
||||||
|
aria-labelledby={`full-width-tab-${index}`}
|
||||||
|
{...other}
|
||||||
|
style={{ marginTop: "1em" }}
|
||||||
|
>
|
||||||
|
{value === index && <Box>{children}</Box>}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
TabPanel.propTypes = {
|
||||||
|
children: PropTypes.node,
|
||||||
|
index: PropTypes.number.isRequired,
|
||||||
|
value: PropTypes.number.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
function a11yProps(index) {
|
||||||
|
return {
|
||||||
|
id: `full-width-tab-${index}`,
|
||||||
|
"aria-controls": `full-width-tabpanel-${index}`,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const EpisodeTitlePage = () => {
|
||||||
|
const { id } = useParams();
|
||||||
|
|
||||||
|
const user = useQuery({
|
||||||
|
queryKey: ["user"],
|
||||||
|
queryFn: async () => {
|
||||||
|
let usr = await getUserApi(window.api).getCurrentUser();
|
||||||
|
return usr.data;
|
||||||
|
},
|
||||||
|
networkMode: "always",
|
||||||
|
});
|
||||||
|
|
||||||
|
const item = useQuery({
|
||||||
|
queryKey: ["item", id],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getUserLibraryApi(window.api).getItem({
|
||||||
|
userId: user.data.Id,
|
||||||
|
itemId: id,
|
||||||
|
fields: [ItemFields.Crew],
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
enabled: !!user.data,
|
||||||
|
networkMode: "always",
|
||||||
|
refetchOnWindowFocus: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
const [videoTracks, setVideoTracks] = useState([]);
|
||||||
|
const [audioTracks, setAudioTracks] = useState([]);
|
||||||
|
const [subtitleTracks, setSubtitleTracks] = useState([]);
|
||||||
|
|
||||||
|
const filterMediaStreamVideo = (source) => {
|
||||||
|
if (source.Type == MediaStreamType.Video) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
const filterMediaStreamAudio = (source) => {
|
||||||
|
if (source.Type == MediaStreamType.Audio) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
const filterMediaStreamSubtitle = (source) => {
|
||||||
|
if (source.Type == MediaStreamType.Subtitle) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (item.isSuccess && !!item.data.MediaStreams) {
|
||||||
|
let videos = item.data.MediaStreams.filter(
|
||||||
|
filterMediaStreamVideo,
|
||||||
|
);
|
||||||
|
let audios = item.data.MediaStreams.filter(
|
||||||
|
filterMediaStreamAudio,
|
||||||
|
);
|
||||||
|
let subs = item.data.MediaStreams.filter(
|
||||||
|
filterMediaStreamSubtitle,
|
||||||
|
);
|
||||||
|
|
||||||
|
setVideoTracks(videos);
|
||||||
|
setAudioTracks(audios);
|
||||||
|
setSubtitleTracks(subs);
|
||||||
|
}
|
||||||
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
|
const upcomingEpisodes = useQuery({
|
||||||
|
queryKey: ["item", id, "episode", "upcomingEpisodes"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getItemsApi(window.api).getItems({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: item.data.ParentId,
|
||||||
|
startIndex: item.data.IndexNumber,
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
enabled: item.isSuccess && item.data.Type == BaseItemKind.Episode,
|
||||||
|
networkMode: "always",
|
||||||
|
});
|
||||||
|
|
||||||
|
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
|
||||||
|
? `${window.api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
||||||
|
: `${window.api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||||
|
item.data.Id,
|
||||||
|
);
|
||||||
|
let direTp = item.data.People.filter(
|
||||||
|
(itm) => itm.Type == "Director",
|
||||||
|
);
|
||||||
|
setDirectors(direTp);
|
||||||
|
let writeTp = item.data.People.filter(
|
||||||
|
(itm) => itm.Type == "Writer",
|
||||||
|
);
|
||||||
|
setWriters(writeTp);
|
||||||
|
}
|
||||||
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
|
if (item.isLoading) {
|
||||||
|
return (
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
width: "100%",
|
||||||
|
height: "100vh",
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<CircularProgress />
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (item.isSuccess) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className="scrollY episode"
|
||||||
|
style={{
|
||||||
|
padding: "5em 2em 2em 1em",
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
gap: "0.5em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Hero
|
||||||
|
item={item.data}
|
||||||
|
userId={user.data.Id}
|
||||||
|
queryKey={["item", id]}
|
||||||
|
writers={writers}
|
||||||
|
directors={directors}
|
||||||
|
videoTracks={videoTracks}
|
||||||
|
audioTracks={audioTracks}
|
||||||
|
subtitleTracks={subtitleTracks}
|
||||||
|
favourParentImg={false}
|
||||||
|
isEpisode
|
||||||
|
/>
|
||||||
|
{item.data.People.length > 0 && (
|
||||||
|
<CardScroller
|
||||||
|
title="Cast & Crew"
|
||||||
|
displayCards={8}
|
||||||
|
disableDecoration
|
||||||
|
>
|
||||||
|
{item.data.People.map((person, index) => {
|
||||||
|
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>
|
||||||
|
)}
|
||||||
|
{upcomingEpisodes.isSuccess &&
|
||||||
|
upcomingEpisodes.data.Items.length > 0 && (
|
||||||
|
<CardScroller
|
||||||
|
title="Upcoming Episodes"
|
||||||
|
displayCards={4}
|
||||||
|
disableDecoration
|
||||||
|
>
|
||||||
|
{upcomingEpisodes.data.Items.map(
|
||||||
|
(episode, index) => {
|
||||||
|
return (
|
||||||
|
<Card
|
||||||
|
key={episode.Id}
|
||||||
|
item={episode}
|
||||||
|
cardTitle={
|
||||||
|
episode.SeriesName
|
||||||
|
}
|
||||||
|
imageType="Primary"
|
||||||
|
cardCaption={`S${episode.ParentIndexNumber}:E${episode.IndexNumber} - ${episode.Name}`}
|
||||||
|
cardType="thumb"
|
||||||
|
queryKey={[
|
||||||
|
"item",
|
||||||
|
id,
|
||||||
|
"episode",
|
||||||
|
"upcomingEpisodes",
|
||||||
|
]}
|
||||||
|
userId={user.data.Id}
|
||||||
|
imageBlurhash={
|
||||||
|
!!episode
|
||||||
|
.ImageBlurHashes
|
||||||
|
?.Primary &&
|
||||||
|
episode
|
||||||
|
.ImageBlurHashes
|
||||||
|
?.Primary[
|
||||||
|
Object.keys(
|
||||||
|
episode
|
||||||
|
.ImageBlurHashes
|
||||||
|
.Primary,
|
||||||
|
)[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
></Card>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)}
|
||||||
|
</CardScroller>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (item.isError) {
|
||||||
|
return <ErrorNotice />;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default EpisodeTitlePage;
|
||||||
@@ -1,13 +1 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
.item-detail {
|
|
||||||
&-hero {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
gap: 2em;
|
|
||||||
}
|
|
||||||
&-primaryImage {
|
|
||||||
width: 26%;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
&-osd {
|
&-osd {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity 0.1s linear;
|
transition: opacity 0.1s linear;
|
||||||
|
width: 100vw;
|
||||||
}
|
}
|
||||||
&-osd-visible &-osd {
|
&-osd-visible &-osd {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
@@ -12,8 +13,11 @@
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100vw;
|
||||||
height: 100%;
|
height: 100vh;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,33 +102,11 @@ const SeriesTitlePage = () => {
|
|||||||
const similarItems = useQuery({
|
const similarItems = useQuery({
|
||||||
queryKey: ["item", id, "similarItem"],
|
queryKey: ["item", id, "similarItem"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let result;
|
const result = await getLibraryApi(window.api).getSimilarShows({
|
||||||
if (item.data.Type == "Movie") {
|
userId: user.data.Id,
|
||||||
result = await getLibraryApi(window.api).getSimilarMovies({
|
itemId: item.data.Id,
|
||||||
userId: user.data.Id,
|
limit: 16,
|
||||||
itemId: item.data.Id,
|
});
|
||||||
});
|
|
||||||
} else if (item.data.Type == "Series") {
|
|
||||||
result = await getLibraryApi(window.api).getSimilarShows({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.data.Id,
|
|
||||||
});
|
|
||||||
} else if (item.data.Type == "MusicAlbum") {
|
|
||||||
result = await getLibraryApi(window.api).getSimilarAlbums({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.data.Id,
|
|
||||||
});
|
|
||||||
} else if (item.data.Type == "MusicArtist") {
|
|
||||||
result = await getLibraryApi(window.api).getSimilarArtists({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.data.Id,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
result = await getLibraryApi(window.api).getSimilarItems({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.data.Id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
enabled: item.isSuccess,
|
enabled: item.isSuccess,
|
||||||
|
|||||||
@@ -1,15 +1,6 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
.item-detail {
|
.item-detail {
|
||||||
&-hero {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
gap: 2em;
|
|
||||||
}
|
|
||||||
&-primaryImage {
|
|
||||||
width: 26%;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
&-episodes-container {
|
&-episodes-container {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
|
||||||
|
|||||||
+22
-7
@@ -60,13 +60,16 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#root,
|
#root {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.root-page {
|
.root-page {
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
width: 100%;
|
width: calc(100% - 5em);
|
||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow-y: hidden;
|
overflow: visible;
|
||||||
overflow-x: hidden;
|
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,10 +119,9 @@ h1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.scrollY {
|
.scrollY {
|
||||||
overflow-x: hidden;
|
overflow: visible;
|
||||||
overflow-y: visible;
|
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
width: inherit;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
padding-left: 1em;
|
padding-left: 1em;
|
||||||
@@ -134,3 +136,16 @@ h1 {
|
|||||||
.empty {
|
.empty {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.react-multi-carousel {
|
||||||
|
&-list {
|
||||||
|
overflow: visible !important;
|
||||||
|
}
|
||||||
|
&-item {
|
||||||
|
opacity: 0.4;
|
||||||
|
transition: opacity 550ms;
|
||||||
|
&--active {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user