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