Add 'disable subtitle' option and fix cast and crew in item Page #243
This commit is contained in:
3 files changed
+170
-94
No files matched your search
@@ -636,9 +636,15 @@ const ItemDetail = () => {
|
||||
itemId={item.data.Id}
|
||||
itemType={item.data.Type}
|
||||
itemUserData={item.data.UserData}
|
||||
currentAudioTrack={0}
|
||||
currentVideoTrack={0}
|
||||
currentSubTrack={0}
|
||||
currentVideoTrack={
|
||||
selectedVideoTrack
|
||||
}
|
||||
currentAudioTrack={
|
||||
selectedAudioTrack
|
||||
}
|
||||
currentSubTrack={
|
||||
selectedSubtitleTrack
|
||||
}
|
||||
userId={user.data.Id}
|
||||
/>
|
||||
</div>
|
||||
@@ -863,6 +869,9 @@ const ItemDetail = () => {
|
||||
)
|
||||
}
|
||||
>
|
||||
<MenuItem key={-1} value={-1}>
|
||||
No Subtitle
|
||||
</MenuItem>
|
||||
{subtitleTracks.map((track) => (
|
||||
<MenuItem
|
||||
key={track.Index}
|
||||
|
||||
+137
-78
@@ -11,6 +11,10 @@ import TextField from "@mui/material/TextField";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
import CardMedia from "@mui/material/CardMedia";
|
||||
import CardContent from "@mui/material/CardContent";
|
||||
import MuiCard from "@mui/material/Card";
|
||||
import { red, yellow, green } from "@mui/material/colors";
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
@@ -33,17 +37,14 @@ import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { endsAt, getRuntime, getRuntimeMusic } from "../../utils/date/time";
|
||||
|
||||
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 "./series.module.scss";
|
||||
import { EpisodeCardsSkeleton } from "../../components/skeleton/episodeCards";
|
||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||
|
||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||
import { ActorCard } from "../../components/card/actorCards";
|
||||
import { SeasonSelectorSkeleton } from "../../components/skeleton/seasonSelector";
|
||||
import LikeButton from "../../components/buttons/likeButton";
|
||||
import MarkPlayedButton from "../../components/buttons/markPlayedButton";
|
||||
@@ -260,7 +261,7 @@ const SeriesTitlePage = () => {
|
||||
duration: 0.25,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY padded-top flex flex-column item"
|
||||
className="scrollY padded-top flex flex-column item item-series"
|
||||
>
|
||||
<div className="item-hero flex flex-row">
|
||||
<div className="item-hero-backdrop-container">
|
||||
@@ -444,8 +445,9 @@ const SeriesTitlePage = () => {
|
||||
style={{ opacity: "0.8" }}
|
||||
variant="subtitle1"
|
||||
>
|
||||
{seasons.data.TotalRecordCount}{" "}
|
||||
Seasons
|
||||
{seasons.data.TotalRecordCount > 1
|
||||
? `${seasons.data.TotalRecordCount} Seasons`
|
||||
: `${seasons.data.TotalRecordCount} Season`}
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
@@ -1071,78 +1073,135 @@ const SeriesTitlePage = () => {
|
||||
</div>
|
||||
<Divider />
|
||||
<div className="item-detail-episodes-container">
|
||||
{episodes.isPending ? (
|
||||
<EpisodeCardsSkeleton />
|
||||
) : (
|
||||
episodes.data.Items.map((episode) => {
|
||||
return (
|
||||
<motion.div
|
||||
key={episode.Id}
|
||||
initial={{
|
||||
transform:
|
||||
"translateY(10px)",
|
||||
opacity: 0,
|
||||
}}
|
||||
whileInView={{
|
||||
opacity: 1,
|
||||
transform:
|
||||
"translateY(0px)",
|
||||
}}
|
||||
viewport={{
|
||||
once: true,
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.2,
|
||||
ease: "backInOut",
|
||||
}}
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<EpisodeCard
|
||||
item={episode}
|
||||
cardTitle={
|
||||
episode.ParentIndexNumber ==
|
||||
0
|
||||
? `${episode.SeasonName} - ${episode.Name}`
|
||||
: episode.IndexNumberEnd
|
||||
? `${episode.IndexNumber}-${episode.IndexNumberEnd}. ${episode.Name}`
|
||||
: `${episode.IndexNumber}. ${episode.Name}`
|
||||
}
|
||||
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
|
||||
}
|
||||
/>
|
||||
</motion.div>
|
||||
);
|
||||
})
|
||||
)}
|
||||
{episodes.isPending
|
||||
? Array.from(new Array(4)).map((a) => {
|
||||
return (
|
||||
<MuiCard
|
||||
key={a}
|
||||
sx={{
|
||||
background:
|
||||
"transparent",
|
||||
}}
|
||||
elevation={0}
|
||||
>
|
||||
<CardMedia>
|
||||
<Skeleton
|
||||
animation="wave"
|
||||
variant="rectangular"
|
||||
sx={{
|
||||
aspectRatio:
|
||||
"1.777",
|
||||
height: "auto",
|
||||
m: 1,
|
||||
borderRadius:
|
||||
"10px",
|
||||
}}
|
||||
/>
|
||||
</CardMedia>
|
||||
<CardContent
|
||||
sx={{
|
||||
padding: "0 0.5em",
|
||||
alignItems:
|
||||
"flex-start",
|
||||
backgroundColor:
|
||||
"transparent",
|
||||
}}
|
||||
>
|
||||
<Typography variant="h6">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
animation="wave"
|
||||
/>
|
||||
</Typography>
|
||||
|
||||
<Typography variant="body2">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
animation="wave"
|
||||
/>
|
||||
<Skeleton
|
||||
variant="text"
|
||||
animation="wave"
|
||||
/>
|
||||
|
||||
<Skeleton
|
||||
variant="text"
|
||||
animation="wave"
|
||||
/>
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</MuiCard>
|
||||
);
|
||||
})
|
||||
: episodes.data.Items.map((episode) => {
|
||||
return (
|
||||
<motion.div
|
||||
key={episode.Id}
|
||||
initial={{
|
||||
transform:
|
||||
"translateY(10px)",
|
||||
opacity: 0,
|
||||
}}
|
||||
whileInView={{
|
||||
opacity: 1,
|
||||
transform:
|
||||
"translateY(0px)",
|
||||
}}
|
||||
viewport={{
|
||||
once: true,
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.2,
|
||||
ease: "backInOut",
|
||||
}}
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<EpisodeCard
|
||||
item={episode}
|
||||
cardTitle={
|
||||
episode.ParentIndexNumber ==
|
||||
0
|
||||
? `${episode.SeasonName} - ${episode.Name}`
|
||||
: episode.IndexNumberEnd
|
||||
? `${episode.IndexNumber}-${episode.IndexNumberEnd}. ${episode.Name}`
|
||||
: `${episode.IndexNumber}. ${episode.Name}`
|
||||
}
|
||||
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
|
||||
}
|
||||
/>
|
||||
</motion.div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -82,19 +82,15 @@
|
||||
align-items: start;
|
||||
gap: 1em;
|
||||
|
||||
&-nextUp {
|
||||
max-width: 23em;
|
||||
}
|
||||
|
||||
&-cast {
|
||||
max-height: 50vh;
|
||||
overflow-y: auto;
|
||||
mask-image: linear-gradient(to top, transparent, black 1.2em);
|
||||
-webkit-mask-image: linear-gradient(
|
||||
to top,
|
||||
transparent,
|
||||
black 1.2em
|
||||
);
|
||||
&-title {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background: $clr-background-default;
|
||||
background: $clr-background-dark;
|
||||
padding: 0.35em;
|
||||
border-radius: 10px;
|
||||
z-index: 1;
|
||||
@@ -106,7 +102,7 @@
|
||||
}
|
||||
&-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
gap: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
@@ -162,8 +158,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
.item-series {
|
||||
.item-detail-cast {
|
||||
max-height: 50vh;
|
||||
overflow-y: auto;
|
||||
mask-image: linear-gradient(to top, transparent, black 1.2em);
|
||||
-webkit-mask-image: linear-gradient(to top, transparent, black 1.2em);
|
||||
&-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1320px) {
|
||||
.item-detail {
|
||||
.item-series .item-detail {
|
||||
&-cast {
|
||||
&-grid {
|
||||
grid-template-columns: 1fr;
|
||||
@@ -176,7 +184,7 @@
|
||||
}
|
||||
|
||||
@media (max-width: 830px) {
|
||||
.item-detail {
|
||||
.item-series .item-detail {
|
||||
&-episodes-container {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
@@ -184,7 +192,7 @@
|
||||
}
|
||||
|
||||
@media (max-width: 564px) {
|
||||
.item-detail {
|
||||
.item-series .item-detail {
|
||||
&-episodes-container {
|
||||
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user