style: update everything to biome conventions

This commit is contained in:
DanCodes committed 2024-01-09 13:50:20 +00:00
1 parent 96350fa793
commit c0b9d93880
88 files changed
+491 -708

No files matched your search

+2 -2
View File
@@ -40,7 +40,7 @@ const About = () => {
useEffect(() => {
setBackdrop("", "");
}, []);
});
if (systemInfo.isPending) {
return (
<div
@@ -69,7 +69,7 @@ const About = () => {
target="_blank"
rel="noreferrer"
>
<img width="100%" height="100%" src={logo} />
<img alt="JellyPlayer" width="100%" height="100%" src={logo} />
</a>
<div
style={{
+1 -1
View File
@@ -162,7 +162,7 @@ const MusicAlbumTitlePage = () => {
item.data.Id,
);
}
}, [item.isSuccess]);
});
if (item.isPending || similarItems.isPending) {
return (
+5 -9
View File
@@ -158,11 +158,7 @@ const ArtistTitlePage = () => {
setActiveArtistTab(2);
}
}
}, [
artistDiscography.isPending,
artistSongs.isPending,
artistAppearances.isPending,
]);
});
const [animationDirection, setAnimationDirection] = useState("forward");
@@ -178,7 +174,7 @@ const ArtistTitlePage = () => {
item.data.Id,
);
}
}, [item.isSuccess]);
});
if (item.isPending) {
return (
@@ -243,7 +239,7 @@ const ArtistTitlePage = () => {
{artistTabs.map((tab, index) => {
return (
<Tab
key={index}
key={tab.title}
label={tab.title}
disabled={tab.data.data?.TotalRecordCount === 0}
/>
@@ -273,10 +269,10 @@ const ArtistTitlePage = () => {
}}
>
{artistDiscography.isSuccess &&
artistDiscography.data.Items.map((tabitem, aindex) => {
artistDiscography.data.Items.map((tabitem) => {
return (
<ArtistAlbum
key={aindex}
key={tabitem.Id}
user={user.data}
album={tabitem}
/>
+2 -1
View File
@@ -113,6 +113,7 @@ const BoxSetTitlePage = () => {
const [directors, setDirectors] = useState([]);
const [writers, setWriters] = useState([]);
useEffect(() => {
if (item.isSuccess) {
setAppBackdrop(
@@ -127,7 +128,7 @@ const BoxSetTitlePage = () => {
const writeTp = item.data.People.filter((itm) => itm.Type === "Writer");
setWriters(writeTp);
}
}, [item.isSuccess]);
});
if (item.isPending || similarItems.isPending) {
return (
+158 -323
View File
@@ -1,21 +1,20 @@
import PropTypes from "prop-types";
import React, { useState, useLayoutEffect } from "react";
import PropTypes from "prop-types";
import Box from "@mui/material/Box";
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import CircularProgress from "@mui/material/CircularProgress";
import Chip from "@mui/material/Chip";
import TextField from "@mui/material/TextField";
import MenuItem from "@mui/material/MenuItem";
import CircularProgress from "@mui/material/CircularProgress";
import Divider from "@mui/material/Divider";
import LinearProgress from "@mui/material/LinearProgress";
import { red, green, yellow } from "@mui/material/colors";
import MenuItem from "@mui/material/MenuItem";
import Stack from "@mui/material/Stack";
import TextField from "@mui/material/TextField";
import Typography from "@mui/material/Typography";
import { green, red, yellow } from "@mui/material/colors";
import { Blurhash } from "react-blurhash";
import { useParams, Link, NavLink } from "react-router-dom";
import { Link, NavLink, useParams } from "react-router-dom";
import { motion } from "framer-motion";
@@ -34,16 +33,16 @@ import { Card } from "../../components/card/card";
import { CardScroller } from "../../components/cardScroller/cardScroller";
import Hero from "../../components/layouts/item/hero";
import "./episode.module.scss";
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
import { useBackdropStore } from "../../utils/store/backdrop";
import { useApi } from "../../utils/store/api";
import { endsAt, getRuntime } from "../../utils/date/time";
import PlayButton from "../../components/buttons/playButton";
import LikeButton from "../../components/buttons/likeButton";
import MarkPlayedButton from "../../components/buttons/markPlayedButton";
import PlayButton from "../../components/buttons/playButton";
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
import TextLink from "../../components/textLink";
import { getTypeIcon } from "../../components/utils/iconsCollection";
import { endsAt, getRuntime } from "../../utils/date/time";
import { useApi } from "../../utils/store/api";
import { useBackdropStore } from "../../utils/store/backdrop";
import "./episode.module.scss";
function TabPanel(props) {
const { children, value, index, ...other } = props;
@@ -107,7 +106,7 @@ const EpisodeTitlePage = () => {
});
return result.data;
},
enabled: item.isSuccess && item.data.Type == BaseItemKind.Episode,
enabled: item.isSuccess && item.data.Type === BaseItemKind.Episode,
networkMode: "always",
});
@@ -154,12 +153,13 @@ const EpisodeTitlePage = () => {
setAudioTracks(audios);
setSubtitleTracks(subs);
}
}, [item.isSuccess]);
});
const [directors, setDirectors] = useState([]);
const [writers, setWriters] = useState([]);
const [actors, setActors] = useState([]);
const [producers, setProducers] = useState([]);
useLayoutEffect(() => {
if (item.isSuccess) {
setAppBackdrop(
@@ -173,72 +173,57 @@ const EpisodeTitlePage = () => {
setDirectors(direTp);
const writeTp = item.data.People.filter((itm) => itm.Type === "Writer");
setWriters(writeTp);
let producerTp = item.data.People.filter(
(itm) => itm.Type == "Producer",
const producerTp = item.data.People.filter(
(itm) => itm.Type === "Producer",
);
setProducers(producerTp);
let actorTp = item.data.People.filter(
(itm) => itm.Type == "Actor",
);
const actorTp = item.data.People.filter((itm) => itm.Type === "Actor");
setActors(actorTp);
}
}, [item.isSuccess]);
});
const qualityLabel = () => {
if (
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
"2160p",
) ||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("2160p") ||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("4k")
) {
return <span className="material-symbols-rounded">4k</span>;
} else if (
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
"1080p",
) ||
}
if (
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("1080p") ||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("hd")
) {
return <span className="material-symbols-rounded">full_hd</span>;
} else {
return <span className="material-symbols-rounded">hd</span>;
}
return <span className="material-symbols-rounded">hd</span>;
};
const atmosLabel = () => {
if (
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
"atmos",
) &&
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
"truehd",
)
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("atmos") &&
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("truehd")
) {
return `TrueHD | Atmos`;
} else if (
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
"atmos",
)
) {
return "Atmos";
} else if (
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
"truehd",
)
) {
return "TrueHD";
} else {
return "";
return "TrueHD | Atmos";
}
if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("atmos")) {
return "Atmos";
}
if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("truehd")) {
return "TrueHD";
}
return "";
};
const surroundSoundLabel = () => {
if (audioTracks[0]?.DisplayTitle.includes("7.1")) {
return "7.1";
} else if (audioTracks[0]?.DisplayTitle.includes("5.1")) {
return "5.1";
} else {
return "2.0";
}
if (audioTracks[0]?.DisplayTitle.includes("5.1")) {
return "5.1";
}
return "2.0";
};
if (item.isPending) {
@@ -276,18 +261,18 @@ const EpisodeTitlePage = () => {
<div className="item-hero-backdrop-container">
{item.data.BackdropImageTags ? (
<img
alt={item.data.Name}
src={api.getItemImageUrl(
item.data.ParentBackdropItemId,
"Backdrop",
{
tag: item.data
.ParentBackdropImageTags[0],
tag: item.data.ParentBackdropImageTags[0],
},
)}
className="item-hero-backdrop"
onLoad={(e) =>
(e.currentTarget.style.opacity = 1)
}
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
/>
) : (
<></>
@@ -296,39 +281,28 @@ const EpisodeTitlePage = () => {
<div
className="item-hero-image-container"
style={{
aspectRatio:
item.data.PrimaryImageAspectRatio ?? 1,
aspectRatio: item.data.PrimaryImageAspectRatio ?? 1,
}}
>
{Object.keys(item.data.ImageTags).includes(
"Primary",
) ? (
{Object.keys(item.data.ImageTags).includes("Primary") ? (
<>
<Blurhash
hash={
item.data.ImageBlurHashes
.Primary[
item.data.ImageTags[
"Primary"
]
item.data.ImageBlurHashes.Primary[
item.data.ImageTags.Primary
]
}
className="item-hero-image-blurhash"
/>
<img
src={api.getItemImageUrl(
item.data.Id,
"Primary",
{
quality: 90,
tag: item.data.ImageTags[
"Primary"
],
},
)}
onLoad={(e) =>
(e.currentTarget.style.opacity = 1)
}
alt={item.data.Name}
src={api.getItemImageUrl(item.data.Id, "Primary", {
quality: 90,
tag: item.data.ImageTags.Primary,
})}
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
className="item-hero-image"
/>
</>
@@ -337,24 +311,18 @@ const EpisodeTitlePage = () => {
)}
</div>
<div className="item-hero-detail flex flex-column">
<TextLink
variant={"h3"}
location={`/series/${item.data.SeriesId}`}
>
<TextLink variant={"h3"} location={`/series/${item.data.SeriesId}`}>
{item.data.ParentLogoItemId.length > 0 ? (
<img
src={api.getItemImageUrl(
item.data.ParentLogoItemId,
"Logo",
{
quality: 90,
fillWidth: 592,
fillHeight: 592,
},
)}
onLoad={(e) =>
(e.currentTarget.style.opacity = 1)
}
alt={item.data.SeriesName}
src={api.getItemImageUrl(item.data.ParentLogoItemId, "Logo", {
quality: 90,
fillWidth: 592,
fillHeight: 592,
})}
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
className="item-hero-logo"
/>
) : (
@@ -372,8 +340,7 @@ const EpisodeTitlePage = () => {
variant="filled"
label={qualityLabel()}
sx={{
borderRadius:
"8px !important",
borderRadius: "8px !important",
"& .MuiChip-label": {
fontSize: "2.2em",
},
@@ -384,16 +351,12 @@ const EpisodeTitlePage = () => {
<Chip
variant="filled"
label={
<Typography
variant="caption"
fontWeight={600}
>
<Typography variant="caption" fontWeight={600}>
{surroundSoundLabel()}
</Typography>
}
sx={{
borderRadius:
"8px !important",
borderRadius: "8px !important",
"& .MuiChip-label": {
fontSize: "2.2em",
},
@@ -404,19 +367,12 @@ const EpisodeTitlePage = () => {
<Chip
variant="filled"
label={
<Typography
variant="caption"
fontWeight={600}
>
{
videoTracks[0]
.VideoRangeType
}
<Typography variant="caption" fontWeight={600}>
{videoTracks[0].VideoRangeType}
</Typography>
}
sx={{
borderRadius:
"8px !important",
borderRadius: "8px !important",
"& .MuiChip-label": {
fontSize: "2.2em",
},
@@ -427,16 +383,12 @@ const EpisodeTitlePage = () => {
<Chip
variant="filled"
label={
<Typography
variant="caption"
fontWeight={600}
>
<Typography variant="caption" fontWeight={600}>
{atmosLabel()}
</Typography>
}
sx={{
borderRadius:
"8px !important",
borderRadius: "8px !important",
"& .MuiChip-label": {
fontSize: "2.2em",
},
@@ -459,8 +411,7 @@ const EpisodeTitlePage = () => {
</span>
}
sx={{
borderRadius:
"8px !important",
borderRadius: "8px !important",
"& .MuiChip-label": {
fontSize: "2.2em",
},
@@ -474,17 +425,11 @@ const EpisodeTitlePage = () => {
justifyItems="flex-start"
alignItems="center"
>
<Typography
style={{ opacity: "0.8" }}
variant="subtitle1"
>
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
{item.data.ProductionYear ?? ""}
</Typography>
{item.data.OfficialRating && (
<Chip
variant="filled"
label={item.data.OfficialRating}
/>
<Chip variant="filled" label={item.data.OfficialRating} />
)}
{item.data.CommunityRating && (
@@ -513,11 +458,7 @@ const EpisodeTitlePage = () => {
}}
variant="subtitle1"
>
{Math.round(
item.data
.CommunityRating *
10,
) / 10}
{Math.round(item.data.CommunityRating * 10) / 10}
</Typography>
</div>
)}
@@ -534,18 +475,12 @@ const EpisodeTitlePage = () => {
className="material-symbols-rounded "
style={{
color:
item.data
.CriticRating >
50
? green[400]
: red[400],
item.data.CriticRating > 50 ? green[400] : red[400],
fontVariationSettings:
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
}}
>
{item.data.CriticRating > 50
? "thumb_up"
: "thumb_down"}
{item.data.CriticRating > 50 ? "thumb_up" : "thumb_down"}
</div>
<Typography
style={{
@@ -559,32 +494,20 @@ const EpisodeTitlePage = () => {
)}
{item.data.RunTimeTicks && (
<Typography
style={{ opacity: "0.8" }}
variant="subtitle1"
>
{getRuntime(
item.data.RunTimeTicks,
)}
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
{getRuntime(item.data.RunTimeTicks)}
</Typography>
)}
{item.data.RunTimeTicks && (
<Typography
style={{ opacity: "0.8" }}
variant="subtitle1"
>
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
{endsAt(
item.data.RunTimeTicks -
item.data.UserData
.PlaybackPositionTicks,
item.data.UserData.PlaybackPositionTicks,
)}
</Typography>
)}
</Stack>
<Typography
variant="subtitle1"
style={{ opacity: 0.8 }}
>
<Typography variant="subtitle1" style={{ opacity: 0.8 }}>
{item.data.Genres.join(", ")}
</Typography>
@@ -594,38 +517,25 @@ const EpisodeTitlePage = () => {
itemId={item.data.Id}
itemType={item.data.Type}
itemUserData={item.data.UserData}
currentVideoTrack={
selectedVideoTrack
}
currentAudioTrack={
selectedAudioTrack
}
currentSubTrack={
selectedSubtitleTrack
}
currentVideoTrack={selectedVideoTrack}
currentAudioTrack={selectedAudioTrack}
currentSubTrack={selectedSubtitleTrack}
userId={user.data.Id}
/>
</div>
<div
className="flex flex-row"
style={{ gap: "1em" }}
>
<div className="flex flex-row" style={{ gap: "1em" }}>
<LikeButton
itemName={item.data.Name}
itemId={item.data.Id}
queryKey={["item", id]}
isFavorite={
item.data.UserData.IsFavorite
}
isFavorite={item.data.UserData.IsFavorite}
userId={user.data.Id}
/>
<MarkPlayedButton
itemName={item.data.Name}
itemId={item.data.Id}
queryKey={["item", id]}
isPlayed={
item.data.UserData.Played
}
isPlayed={item.data.UserData.Played}
userId={user.data.Id}
/>
</div>
@@ -644,29 +554,21 @@ const EpisodeTitlePage = () => {
<Typography>
{getRuntime(
item.data.RunTimeTicks -
item.data.UserData
.PlaybackPositionTicks,
item.data.UserData.PlaybackPositionTicks,
)}{" "}
left
</Typography>
<LinearProgress
color="white"
variant="determinate"
value={
item.data.UserData
.PlayedPercentage
}
value={item.data.UserData.PlayedPercentage}
style={{
borderRadius: "10px",
}}
/>
</div>
)}
<Typography
variant="h5"
fontStyle="italic"
mb={1}
>
<Typography variant="h5" fontStyle="italic" mb={1}>
{item.data.Taglines[0] ?? ""}
</Typography>
<Typography variant="subtitle1">
@@ -688,20 +590,15 @@ const EpisodeTitlePage = () => {
<>
<TextLink
key={writer.Id}
variant={
"subtitle1"
}
variant={"subtitle1"}
location={`/person/${writer.Id}`}
>
{writer.Name}
</TextLink>
{index !=
writers.length -
1 && (
{index !== writers.length - 1 && (
<span
style={{
whiteSpace:
"pre",
whiteSpace: "pre",
}}
>
,{" "}
@@ -724,35 +621,26 @@ const EpisodeTitlePage = () => {
Directed by
</Typography>
<div className="hero-text-container">
{directors.map(
(director, index) => (
<>
<TextLink
key={
director.Id
}
variant={
"subtitle1"
}
location={`/person/${director.Id}`}
{directors.map((director, index) => (
<>
<TextLink
key={director.Id}
variant={"subtitle1"}
location={`/person/${director.Id}`}
>
{director.Name}
</TextLink>
{index !== directors.length - 1 && (
<span
style={{
whiteSpace: "pre",
}}
>
{director.Name}
</TextLink>
{index !=
directors.length -
1 && (
<span
style={{
whiteSpace:
"pre",
}}
>
,{" "}
</span>
)}
</>
),
)}
,{" "}
</span>
)}
</>
))}
</div>
</div>
)}
@@ -772,17 +660,10 @@ const EpisodeTitlePage = () => {
marginBottom: "1em",
}}
value={selectedVideoTrack}
onChange={(e) =>
setSelectedVideoTrack(
e.target.value,
)
}
onChange={(e) => setSelectedVideoTrack(e.target.value)}
>
{videoTracks.map((track) => (
<MenuItem
key={track.Index}
value={track.Index}
>
<MenuItem key={track.Index} value={track.Index}>
{track.DisplayTitle}
</MenuItem>
))}
@@ -797,17 +678,10 @@ const EpisodeTitlePage = () => {
marginBottom: "1em",
}}
value={selectedAudioTrack}
onChange={(e) =>
setSelectedAudioTrack(
e.target.value,
)
}
onChange={(e) => setSelectedAudioTrack(e.target.value)}
>
{audioTracks.map((track) => (
<MenuItem
key={track.Index}
value={track.Index}
>
<MenuItem key={track.Index} value={track.Index}>
{track.DisplayTitle}
</MenuItem>
))}
@@ -821,20 +695,13 @@ const EpisodeTitlePage = () => {
width: "100%",
}}
value={selectedSubtitleTrack}
onChange={(e) =>
setSelectedSubtitleTrack(
e.target.value,
)
}
onChange={(e) => setSelectedSubtitleTrack(e.target.value)}
>
<MenuItem key={-1} value={-1}>
No Subtitle
</MenuItem>
{subtitleTracks.map((track) => (
<MenuItem
key={track.Index}
value={track.Index}
>
<MenuItem key={track.Index} value={track.Index}>
{track.DisplayTitle}
</MenuItem>
))}
@@ -907,28 +774,21 @@ const EpisodeTitlePage = () => {
>
{actor.PrimaryImageTag ? (
<img
src={api.getItemImageUrl(
actor.Id,
"Primary",
{
quality: 80,
fillWidth: 200,
fillHeight: 200,
},
)}
alt={actor.Name}
src={api.getItemImageUrl(actor.Id, "Primary", {
quality: 80,
fillWidth: 200,
fillHeight: 200,
})}
className="item-detail-cast-card-image"
/>
) : (
<div className="item-detail-cast-card-icon">
{getTypeIcon(
"Person",
)}
{getTypeIcon("Person")}
</div>
)}
<div className="item-detail-cast-card-text">
<Typography variant="subtitle1">
{actor.Name}
</Typography>
<Typography variant="subtitle1">{actor.Name}</Typography>
<Typography
variant="subtitle2"
style={{
@@ -955,28 +815,21 @@ const EpisodeTitlePage = () => {
>
{actor.PrimaryImageTag ? (
<img
src={api.getItemImageUrl(
actor.Id,
"Primary",
{
quality: 80,
fillWidth: 200,
fillHeight: 200,
},
)}
alt={actor.Name}
src={api.getItemImageUrl(actor.Id, "Primary", {
quality: 80,
fillWidth: 200,
fillHeight: 200,
})}
className="item-detail-cast-card-image"
/>
) : (
<div className="item-detail-cast-card-icon">
{getTypeIcon(
"Person",
)}
{getTypeIcon("Person")}
</div>
)}
<div className="item-detail-cast-card-text">
<Typography variant="subtitle1">
{actor.Name}
</Typography>
<Typography variant="subtitle1">{actor.Name}</Typography>
<Typography
variant="subtitle2"
style={{
@@ -993,9 +846,7 @@ const EpisodeTitlePage = () => {
)}
{directors.length > 0 && (
<div className="item-detail-cast-container">
<Typography variant="h6">
Directors
</Typography>
<Typography variant="h6">Directors</Typography>
<div className="item-detail-cast-grid">
{directors.map((actor) => (
<NavLink
@@ -1005,28 +856,21 @@ const EpisodeTitlePage = () => {
>
{actor.PrimaryImageTag ? (
<img
src={api.getItemImageUrl(
actor.Id,
"Primary",
{
quality: 80,
fillWidth: 200,
fillHeight: 200,
},
)}
alt={actor.Name}
src={api.getItemImageUrl(actor.Id, "Primary", {
quality: 80,
fillWidth: 200,
fillHeight: 200,
})}
className="item-detail-cast-card-image"
/>
) : (
<div className="item-detail-cast-card-icon">
{getTypeIcon(
"Person",
)}
{getTypeIcon("Person")}
</div>
)}
<div className="item-detail-cast-card-text">
<Typography variant="subtitle1">
{actor.Name}
</Typography>
<Typography variant="subtitle1">{actor.Name}</Typography>
<Typography
variant="subtitle2"
style={{
@@ -1043,9 +887,7 @@ const EpisodeTitlePage = () => {
)}
{producers.length > 0 && (
<div className="item-detail-cast-container">
<Typography variant="h6">
Producers
</Typography>
<Typography variant="h6">Producers</Typography>
<div className="item-detail-cast-grid">
{producers.map((actor) => (
<NavLink
@@ -1055,28 +897,21 @@ const EpisodeTitlePage = () => {
>
{actor.PrimaryImageTag ? (
<img
src={api.getItemImageUrl(
actor.Id,
"Primary",
{
quality: 80,
fillWidth: 200,
fillHeight: 200,
},
)}
alt={actor.Name}
src={api.getItemImageUrl(actor.Id, "Primary", {
quality: 80,
fillWidth: 200,
fillHeight: 200,
})}
className="item-detail-cast-card-image"
/>
) : (
<div className="item-detail-cast-card-icon">
{getTypeIcon(
"Person",
)}
{getTypeIcon("Person")}
</div>
)}
<div className="item-detail-cast-card-text">
<Typography variant="subtitle1">
{actor.Name}
</Typography>
<Typography variant="subtitle1">{actor.Name}</Typography>
<Typography
variant="subtitle2"
style={{
+2 -2
View File
@@ -119,9 +119,9 @@ const FavoritePage = () => {
});
useEffect(() => {
// Removing app's backdrop
setBackdrop("", "");
}, []);
});
return (
<main
className="scrollY"
-1
View File
@@ -1,4 +1,3 @@
import React, { useState } from "react";
import { useQuery } from "@tanstack/react-query";
+27 -19
View File
@@ -1,6 +1,5 @@
import PropTypes from "prop-types";
import React, { useState, useLayoutEffect } from "react";
import PropTypes from "prop-types";
import Box from "@mui/material/Box";
import Chip from "@mui/material/Chip";
@@ -15,7 +14,7 @@ import { green, red, yellow } from "@mui/material/colors";
import { Blurhash } from "react-blurhash";
import { useParams, Link, NavLink } from "react-router-dom";
import { Link, NavLink, useParams } from "react-router-dom";
import { motion } from "framer-motion";
@@ -38,14 +37,14 @@ import "./item.module.scss";
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
import { useBackdropStore } from "../../utils/store/backdrop";
import { useApi } from "../../utils/store/api";
import { endsAt, getRuntime } from "../../utils/date/time";
import PlayButton from "../../components/buttons/playButton";
import LikeButton from "../../components/buttons/likeButton";
import MarkPlayedButton from "../../components/buttons/markPlayedButton";
import PlayButton from "../../components/buttons/playButton";
import TextLink from "../../components/textLink";
import { getTypeIcon } from "../../components/utils/iconsCollection";
import { endsAt, getRuntime } from "../../utils/date/time";
import { useApi } from "../../utils/store/api";
import { useBackdropStore } from "../../utils/store/backdrop";
function TabPanel(props) {
const { children, value, index, ...other } = props;
@@ -179,7 +178,7 @@ const ItemDetail = () => {
setAudioTracks(audios);
setSubtitleTracks(subs);
}
}, [item.isSuccess]);
});
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
@@ -187,6 +186,7 @@ const ItemDetail = () => {
const [writers, setWriters] = useState([]);
const [actors, setActors] = useState([]);
const [producers, setProducers] = useState([]);
useLayoutEffect(() => {
if (item.isSuccess) {
setAppBackdrop(
@@ -207,7 +207,7 @@ const ItemDetail = () => {
const actorTp = item.data.People.filter((itm) => itm.Type === "Actor");
setActors(actorTp);
}
}, [item.isSuccess]);
});
const qualityLabel = () => {
if (
@@ -287,16 +287,14 @@ const ItemDetail = () => {
<div className="item-hero-backdrop-container">
{item.data.BackdropImageTags ? (
<img
src={api.getItemImageUrl(
item.data.Id,
"Backdrop",
{
tag: item.data
.BackdropImageTags[0],
},
)}
alt={item.data.Name}
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
tag: item.data.BackdropImageTags[0],
})}
className="item-hero-backdrop"
onLoad={(e) => (e.currentTarget.style.opacity = 1)}
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
/>
) : (
<></>
@@ -319,11 +317,14 @@ const ItemDetail = () => {
className="item-hero-image-blurhash"
/>
<img
alt={item.data.Name}
src={api.getItemImageUrl(item.data.Id, "Primary", {
quality: 90,
tag: item.data.ImageTags.Primary,
})}
onLoad={(e) => (e.currentTarget.style.opacity = 1)}
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
className="item-hero-image"
/>
</>
@@ -334,12 +335,15 @@ const ItemDetail = () => {
<div className="item-hero-detail flex flex-column">
{Object.keys(item.data.ImageTags).includes("Logo") ? (
<img
alt={item.data.Name}
src={api.getItemImageUrl(item.data.Id, "Logo", {
quality: 90,
fillWidth: 592,
fillHeight: 592,
})}
onLoad={(e) => (e.currentTarget.style.opacity = 1)}
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
className="item-hero-logo"
/>
) : (
@@ -755,6 +759,7 @@ const ItemDetail = () => {
>
{actor.PrimaryImageTag ? (
<img
alt={actor.Name}
src={api.getItemImageUrl(actor.Id, "Primary", {
quality: 80,
fillWidth: 200,
@@ -795,6 +800,7 @@ const ItemDetail = () => {
>
{actor.PrimaryImageTag ? (
<img
alt={actor.Name}
src={api.getItemImageUrl(actor.Id, "Primary", {
quality: 80,
fillWidth: 200,
@@ -835,6 +841,7 @@ const ItemDetail = () => {
>
{actor.PrimaryImageTag ? (
<img
alt={actor.Name}
src={api.getItemImageUrl(actor.Id, "Primary", {
quality: 80,
fillWidth: 200,
@@ -875,6 +882,7 @@ const ItemDetail = () => {
>
{actor.PrimaryImageTag ? (
<img
alt={actor.Name}
src={api.getItemImageUrl(actor.Id, "Primary", {
quality: 80,
fillWidth: 200,
+1 -1
View File
@@ -216,7 +216,7 @@ const LibraryView = () => {
]);
}
}
}, [currentLib.isSuccess]);
});
const [filterArray, setFilterArray] = useState([]);
+4 -10
View File
@@ -226,13 +226,7 @@ const PersonTitlePage = () => {
setActivePersonTab(4);
}
}
}, [
personMovies.isPending,
personShows.isPending,
personBooks.isPending,
personPhotos.isPending,
personEpisodes.isPending,
]);
});
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
const [animationDirection, setAnimationDirection] = useState("forward");
@@ -247,7 +241,7 @@ const PersonTitlePage = () => {
item.data.Id,
);
}
}, [item.isSuccess]);
});
if (item.isPending) {
return (
@@ -308,10 +302,10 @@ const PersonTitlePage = () => {
setActivePersonTab(newVal);
}}
>
{personTabs.map((tab, index) => {
{personTabs.map((tab) => {
return (
<Tab
key={index}
key={tab.title}
label={tab.title}
disabled={tab.data.data?.TotalRecordCount === 0}
/>
+4 -2
View File
@@ -174,7 +174,7 @@ export const VideoPlayer = () => {
playerRef.current.seekTo(timeToStart, "seconds");
setIsReady(true);
}
}, [isReady]);
});
const handleDisplayCurrentTime = () => {
let time = ticksToSec(progress * itemDuration);
@@ -249,6 +249,7 @@ export const VideoPlayer = () => {
setItemName(
<div className="video-osd-name">
<img
alt="Series Logo"
src={`${api.basePath}/Items/${
episodes.data.Items[currentEpisodeIndex + 1].SeriesId
}/Images/Logo`}
@@ -323,6 +324,7 @@ export const VideoPlayer = () => {
setItemName(
<div className="video-osd-name">
<img
alt="Series Logo"
src={`${api.basePath}/Items/${
episodes.data.Items[currentEpisodeIndex - 1].SeriesId
}/Images/Logo`}
@@ -434,7 +436,7 @@ export const VideoPlayer = () => {
return () => {
clearTimeout(timeout);
};
}, [volume]);
});
const handleExit = async () => {
// Remove app from fullscreen
+1 -1
View File
@@ -122,7 +122,7 @@ const PlaylistTitlePage = () => {
item.data.Id,
);
}
}, [item.isSuccess]);
});
if (item.isPending || similarItems.isPending) {
return (
+1 -1
View File
@@ -150,7 +150,7 @@ const SearchPage = () => {
useEffect(() => {
// Removing app's backdrop
setBackdrop("", "");
}, []);
});
return (
<div
className="scrollY"
+86 -109
View File
@@ -203,6 +203,7 @@ const SeriesTitlePage = () => {
const [writers, setWriters] = useState([]);
const [actors, setActors] = useState([]);
const [producers, setProducers] = useState([]);
useEffect(() => {
if (item.isSuccess) {
setAppBackdrop(
@@ -223,7 +224,7 @@ const SeriesTitlePage = () => {
const actorTp = item.data.People.filter((itm) => itm.Type === "Actor");
setActors(actorTp);
}
}, [item.isSuccess]);
});
if (item.isPending || similarItems.isPending) {
return (
@@ -260,16 +261,14 @@ const SeriesTitlePage = () => {
<div className="item-hero-backdrop-container">
{item.data.BackdropImageTags ? (
<img
src={api.getItemImageUrl(
item.data.Id,
"Backdrop",
{
tag: item.data
.BackdropImageTags[0],
},
)}
alt={item.data.Name}
src={api.getItemImageUrl(item.data.Id, "Backdrop", {
tag: item.data.BackdropImageTags[0],
})}
className="item-hero-backdrop"
onLoad={(e) => (e.currentTarget.style.opacity = 1)}
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
/>
) : (
<></>
@@ -292,11 +291,14 @@ const SeriesTitlePage = () => {
className="item-hero-image-blurhash"
/>
<img
alt={item.data.Name}
src={api.getItemImageUrl(item.data.Id, "Primary", {
quality: 90,
tag: item.data.ImageTags.Primary,
})}
onLoad={(e) => (e.currentTarget.style.opacity = 1)}
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
className="item-hero-image"
/>
</>
@@ -307,12 +309,15 @@ const SeriesTitlePage = () => {
<div className="item-hero-detail flex flex-column">
{Object.keys(item.data.ImageTags).includes("Logo") ? (
<img
alt={item.data.Name}
src={api.getItemImageUrl(item.data.Id, "Logo", {
quality: 90,
fillWidth: 592,
fillHeight: 592,
})}
onLoad={(e) => (e.currentTarget.style.opacity = 1)}
onLoad={(e) => {
e.currentTarget.style.opacity = 1;
}}
className="item-hero-logo"
/>
) : (
@@ -592,6 +597,7 @@ const SeriesTitlePage = () => {
>
{actor.PrimaryImageTag ? (
<img
alt={actor.Name}
src={api.getItemImageUrl(actor.Id, "Primary", {
quality: 80,
fillWidth: 200,
@@ -636,6 +642,7 @@ const SeriesTitlePage = () => {
>
{actor.PrimaryImageTag ? (
<img
alt={actor.Name}
src={api.getItemImageUrl(actor.Id, "Primary", {
quality: 80,
fillWidth: 200,
@@ -680,6 +687,7 @@ const SeriesTitlePage = () => {
>
{actor.PrimaryImageTag ? (
<img
alt={actor.Name}
src={api.getItemImageUrl(actor.Id, "Primary", {
quality: 80,
fillWidth: 200,
@@ -724,6 +732,7 @@ const SeriesTitlePage = () => {
>
{actor.PrimaryImageTag ? (
<img
alt={actor.Name}
src={api.getItemImageUrl(actor.Id, "Primary", {
quality: 80,
fillWidth: 200,
@@ -874,112 +883,80 @@ const SeriesTitlePage = () => {
<Divider />
<div className="item-detail-episodes-container">
{episodes.isPending
? Array.from(new Array(4)).map(
(a, index) => {
return (
<MuiCard
key={a}
? 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",
}}
/>
</CardMedia>
<CardContent
sx={{
background:
"transparent",
width: "100%",
padding: "0 0.5em",
alignItems: "flex-start",
backgroundColor: "transparent",
}}
elevation={0}
>
<CardMedia>
<Typography variant="h6">
<Skeleton
// animation="wave"
variant="rectangular"
variant="text"
sx={{
aspectRatio:
"1.777",
height: "auto",
m: 1,
borderRadius:
"10px",
animationDelay: `${
index *
0.2
}s`,
animationDuration:
"1.4s",
animationName:
"pulse",
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
}}
/>
</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",
}}
/>
</Typography>
</Typography>
<Typography variant="body2">
<Skeleton
variant="text"
sx={{
animationDelay: `${
index *
0.2
}s`,
animationDuration:
"1.4s",
animationName:
"pulse",
}}
/>
<Skeleton
variant="text"
sx={{
animationDelay: `${
index *
0.2
}s`,
animationDuration:
"1.4s",
animationName:
"pulse",
}}
/>
<Typography variant="body2">
<Skeleton
variant="text"
sx={{
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
}}
/>
<Skeleton
variant="text"
sx={{
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
}}
/>
<Skeleton
variant="text"
sx={{
animationDelay: `${
index *
0.2
}s`,
animationDuration:
"1.4s",
animationName:
"pulse",
}}
/>
</Typography>
</CardContent>
</MuiCard>
);
},
)
<Skeleton
variant="text"
sx={{
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
}}
/>
</Typography>
</CardContent>
</MuiCard>
);
})
: episodes.data.Items.map((episode) => {
return (
<motion.div
-1
View File
@@ -1,4 +1,3 @@
const Settings = () => {
return <h1>WIP Settings</h1>;
};