feat(lint): use biome instead
This commit is contained in:
1 parent
dca2a31639
commit
8d68eb546d
129 files changed
+2352
-4366
No files matched your search
@@ -1,26 +1,26 @@
|
||||
/** @format */
|
||||
import React, { useState } from "react";
|
||||
|
||||
import Paper from "@mui/material/Paper";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import MuiLink from "@mui/material/Link";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { getRuntimeMusic } from "../../../utils/date/time";
|
||||
|
||||
import { MdiClockOutline } from "../../icons/mdiClockOutline";
|
||||
import { MdiAlbum } from "../../icons/mdiAlbum";
|
||||
import { MdiClockOutline } from "../../icons/mdiClockOutline";
|
||||
|
||||
import "./albumArtist.scss";
|
||||
import { useAudioPlayback } from "../../../utils/store/audioPlayback";
|
||||
import LikeButton from "../../buttons/likeButton";
|
||||
import { SortOrder } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { useApi } from "../../../utils/store/api";
|
||||
import { useAudioPlayback } from "../../../utils/store/audioPlayback";
|
||||
import LikeButton from "../../buttons/likeButton";
|
||||
import "./albumArtist.scss";
|
||||
|
||||
export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||
const [api] = useApi((state) => [state.api]);
|
||||
@@ -92,18 +92,12 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||
onLoad={() => setImgLoaded(true)}
|
||||
/>
|
||||
<div className="album-image-icon-container">
|
||||
<MdiAlbum
|
||||
className="album-image-icon"
|
||||
sx={{ fontSize: "6em" }}
|
||||
/>
|
||||
<MdiAlbum className="album-image-icon" sx={{ fontSize: "6em" }} />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<Stack>
|
||||
<Typography
|
||||
variant="h5"
|
||||
style={{ opacity: `0.6`, mb: 1 }}
|
||||
>
|
||||
<Typography variant="h5" style={{ opacity: "0.6", mb: 1 }}>
|
||||
{album.ProductionYear}
|
||||
</Typography>
|
||||
<MuiLink
|
||||
@@ -142,7 +136,7 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||
>
|
||||
#
|
||||
</Typography>
|
||||
<div></div>
|
||||
<div />
|
||||
<Typography
|
||||
variant="h6"
|
||||
style={{
|
||||
@@ -159,9 +153,8 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||
<div
|
||||
key={track.Id}
|
||||
className={
|
||||
currentTrackItem.Id == track.Id &&
|
||||
currentTrackItem.ParentId ==
|
||||
track.ParentId
|
||||
currentTrackItem.Id === track.Id &&
|
||||
currentTrackItem.ParentId === track.ParentId
|
||||
? "item-detail-album-track playing"
|
||||
: "item-detail-album-track"
|
||||
}
|
||||
@@ -173,28 +166,18 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||
justifySelf: "end",
|
||||
}}
|
||||
>
|
||||
{track.IndexNumber
|
||||
? track.IndexNumber
|
||||
: "-"}
|
||||
{track.IndexNumber ? track.IndexNumber : "-"}
|
||||
</Typography>
|
||||
|
||||
<LikeButton
|
||||
itemId={track.Id}
|
||||
isFavorite={
|
||||
track.UserData?.IsFavorite
|
||||
}
|
||||
queryKey={[
|
||||
"artist",
|
||||
"album",
|
||||
album.Id,
|
||||
]}
|
||||
isFavorite={track.UserData?.IsFavorite}
|
||||
queryKey={["artist", "album", album.Id]}
|
||||
userId={user.Id}
|
||||
itemName={track.Name}
|
||||
color={
|
||||
currentTrackItem.Id ==
|
||||
track.Id &&
|
||||
currentTrackItem.ParentId ==
|
||||
track.ParentId
|
||||
currentTrackItem.Id === track.Id &&
|
||||
currentTrackItem.ParentId === track.ParentId
|
||||
? "hsl(337, 96%, 56%)"
|
||||
: "white"
|
||||
}
|
||||
@@ -216,25 +199,21 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||
>
|
||||
{track.Name}
|
||||
</Typography>
|
||||
{track.AlbumArtist ==
|
||||
"Various Artists" && (
|
||||
{track.AlbumArtist === "Various Artists" && (
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{track.ArtistItems.map(
|
||||
(artist) =>
|
||||
artist.Name,
|
||||
).join(", ")}
|
||||
{track.ArtistItems.map((artist) => artist.Name).join(
|
||||
", ",
|
||||
)}
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
<Typography variant="subtitle1">
|
||||
{getRuntimeMusic(
|
||||
track.RunTimeTicks,
|
||||
)}
|
||||
{getRuntimeMusic(track.RunTimeTicks)}
|
||||
</Typography>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
/** @format */
|
||||
import React from "react";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { CardScroller } from "../../cardScroller/cardScroller";
|
||||
import { Card } from "../../card/card";
|
||||
import { CardScroller } from "../../cardScroller/cardScroller";
|
||||
import { CardsSkeleton } from "../../skeleton/cards";
|
||||
|
||||
import { BaseItemKind } 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 { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { useApi } from "../../../utils/store/api";
|
||||
|
||||
/**
|
||||
@@ -18,7 +18,7 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
||||
const user = useQuery({
|
||||
queryKey: ["user"],
|
||||
queryFn: async () => {
|
||||
let usr = await getUserApi(api).getCurrentUser();
|
||||
const usr = await getUserApi(api).getCurrentUser();
|
||||
return usr.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
@@ -43,10 +43,7 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
||||
}
|
||||
if (data.isSuccess && data.data.length >= 1) {
|
||||
return (
|
||||
<CardScroller
|
||||
displayCards={8}
|
||||
title={"Latest " + latestMediaLib[1]}
|
||||
>
|
||||
<CardScroller displayCards={8} title={`Latest ${latestMediaLib[1]}`}>
|
||||
{data.data.map((item) => {
|
||||
return (
|
||||
<Card
|
||||
@@ -54,49 +51,37 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
||||
item={item}
|
||||
seriesId={item.SeriesId}
|
||||
cardTitle={
|
||||
item.Type == BaseItemKind.Episode
|
||||
? item.SeriesName
|
||||
: item.Name
|
||||
item.Type === BaseItemKind.Episode ? item.SeriesName : item.Name
|
||||
}
|
||||
imageType={"Primary"}
|
||||
cardCaption={
|
||||
item.Type == BaseItemKind.Episode
|
||||
item.Type === BaseItemKind.Episode
|
||||
? `S${item.ParentIndexNumber}:E${item.IndexNumber} - ${item.Name}`
|
||||
: item.Type == BaseItemKind.Series
|
||||
? `${item.ProductionYear} - ${
|
||||
item.EndDate
|
||||
? new Date(
|
||||
item.EndDate,
|
||||
).toLocaleString(
|
||||
[],
|
||||
{
|
||||
: item.Type === BaseItemKind.Series
|
||||
? `${item.ProductionYear} - ${
|
||||
item.EndDate
|
||||
? new Date(item.EndDate).toLocaleString([], {
|
||||
year: "numeric",
|
||||
},
|
||||
)
|
||||
: "Present"
|
||||
}`
|
||||
: item.ProductionYear
|
||||
})
|
||||
: "Present"
|
||||
}`
|
||||
: item.ProductionYear
|
||||
}
|
||||
cardType={
|
||||
item.Type == BaseItemKind.MusicAlbum ||
|
||||
item.Type == BaseItemKind.Audio
|
||||
item.Type === BaseItemKind.MusicAlbum ||
|
||||
item.Type === BaseItemKind.Audio
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
queryKey={[
|
||||
"homeSection, latestMedia",
|
||||
latestMediaLib,
|
||||
]}
|
||||
queryKey={["homeSection, latestMedia", latestMediaLib]}
|
||||
userId={user.data.Id}
|
||||
imageBlurhash={
|
||||
!!item.ImageBlurHashes?.Primary &&
|
||||
item.ImageBlurHashes?.Primary[
|
||||
Object.keys(
|
||||
item.ImageBlurHashes.Primary,
|
||||
)[0]
|
||||
Object.keys(item.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
}
|
||||
></Card>
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
import Chip from "@mui/material/Chip";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import TextField from "@mui/material/TextField";
|
||||
import Typography from "@mui/material/Typography";
|
||||
/** @format */
|
||||
import React, { useEffect, useState } from "react";
|
||||
import TextField from "@mui/material/TextField";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import Chip from "@mui/material/Chip";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
|
||||
// import { BaseItemDto } from "";
|
||||
// import { BaseItemPerson } from "@jellyfin/sdk/lib/generated-client/models/base-item-person";
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client/models/base-item-kind";
|
||||
import { MediaStreamType } from "@jellyfin/sdk/lib/generated-client/models/media-stream-type";
|
||||
|
||||
import { Card } from "../../card/card";
|
||||
import { yellow, red } from "@mui/material/colors";
|
||||
import { red, yellow } from "@mui/material/colors";
|
||||
import { endsAt, getRuntime, getRuntimeFull } from "../../../utils/date/time";
|
||||
import LikeButton from "../../buttons/likeButton";
|
||||
import MarkPlayedButton from "../../buttons/markPlayedButton";
|
||||
import PlayButton from "../../buttons/playButton";
|
||||
import { Card } from "../../card/card";
|
||||
|
||||
import "./hero.module.scss";
|
||||
import { Blurhash } from "react-blurhash";
|
||||
import TextLink from "../../textLink";
|
||||
import "./hero.module.scss";
|
||||
|
||||
import { useApi } from "../../../utils/store/api";
|
||||
import { ErrorBoundary } from "react-error-boundary";
|
||||
import { useApi } from "../../../utils/store/api";
|
||||
/**
|
||||
* @typedef {Object} Props
|
||||
* @property {import("@jellyfin/sdk/lib/generated-client/models").BaseItemDto} item
|
||||
@@ -72,19 +72,19 @@ const Hero = ({
|
||||
const [api] = useApi((state) => [state.api]);
|
||||
|
||||
const filterMediaStreamVideo = (source) => {
|
||||
if (source.Type == MediaStreamType.Video) {
|
||||
if (source.Type === MediaStreamType.Video) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
const filterMediaStreamAudio = (source) => {
|
||||
if (source.Type == MediaStreamType.Audio) {
|
||||
if (source.Type === MediaStreamType.Audio) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
const filterMediaStreamSubtitle = (source) => {
|
||||
if (source.Type == MediaStreamType.Subtitle) {
|
||||
if (source.Type === MediaStreamType.Subtitle) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -92,9 +92,7 @@ const Hero = ({
|
||||
|
||||
const videoTracks = item.MediaStreams?.filter(filterMediaStreamVideo);
|
||||
const audioTracks = item.MediaStreams?.filter(filterMediaStreamAudio);
|
||||
const subtitleTracks = item.MediaStreams?.filter(
|
||||
filterMediaStreamSubtitle,
|
||||
);
|
||||
const subtitleTracks = item.MediaStreams?.filter(filterMediaStreamSubtitle);
|
||||
|
||||
const [currentVideoIndex, setCurrentVideoIndex] = useState(0);
|
||||
const [currentAudioIndex, setCurrentAudioIndex] = useState(0);
|
||||
@@ -110,59 +108,44 @@ const Hero = ({
|
||||
|
||||
const qualityLabel = () => {
|
||||
if (
|
||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||
"2160p",
|
||||
) ||
|
||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("2160p") ||
|
||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("4k")
|
||||
) {
|
||||
return "4K";
|
||||
} else if (
|
||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||
"1080p",
|
||||
) ||
|
||||
}if (
|
||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("1080p") ||
|
||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("hd")
|
||||
) {
|
||||
return "HD";
|
||||
} else {
|
||||
return "SD";
|
||||
}
|
||||
return "SD";
|
||||
};
|
||||
|
||||
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",
|
||||
)
|
||||
}if (
|
||||
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("atmos")
|
||||
) {
|
||||
return "Atmos";
|
||||
} else if (
|
||||
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||
"truehd",
|
||||
)
|
||||
}if (
|
||||
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("truehd")
|
||||
) {
|
||||
return "TrueHD";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
return "";
|
||||
};
|
||||
|
||||
const surroundSoundLabel = () => {
|
||||
if (audioTracks[0]?.DisplayTitle.includes("7.1")) {
|
||||
return "7.1";
|
||||
} else if (audioTracks[0].DisplayTitle.includes("5.1")) {
|
||||
}if (audioTracks[0].DisplayTitle.includes("5.1")) {
|
||||
return "5.1";
|
||||
} else {
|
||||
return "2.0";
|
||||
}
|
||||
return "2.0";
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -175,15 +158,11 @@ const Hero = ({
|
||||
<div className="hero-backdrop">
|
||||
{!!item.ImageBlurHashes.Backdrop && (
|
||||
<>
|
||||
{Object.keys(item.ImageBlurHashes.Backdrop)
|
||||
.length != 0 && (
|
||||
{Object.keys(item.ImageBlurHashes.Backdrop).length !== 0 && (
|
||||
<Blurhash
|
||||
hash={
|
||||
item.ImageBlurHashes.Backdrop[
|
||||
Object.keys(
|
||||
item.ImageBlurHashes
|
||||
.Backdrop,
|
||||
)[0]
|
||||
Object.keys(item.ImageBlurHashes.Backdrop)[0]
|
||||
]
|
||||
}
|
||||
width="1080"
|
||||
@@ -209,7 +188,7 @@ const Hero = ({
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<div className="hero-backdrop-icon-container"></div>
|
||||
<div className="hero-backdrop-icon-container" />
|
||||
</div>
|
||||
<div
|
||||
className="item-detail-hero-info-container"
|
||||
@@ -242,10 +221,7 @@ const Hero = ({
|
||||
item.SeriesName
|
||||
)}
|
||||
</TextLink>
|
||||
<Typography
|
||||
variant="h3"
|
||||
fontWeight={300}
|
||||
>
|
||||
<Typography variant="h3" fontWeight={300}>
|
||||
{`S${item.ParentIndexNumber}:E${item.IndexNumber} ${item.Name}`}
|
||||
</Typography>
|
||||
</>
|
||||
@@ -298,8 +274,7 @@ const Hero = ({
|
||||
</Typography>
|
||||
}
|
||||
sx={{
|
||||
borderRadius:
|
||||
"8px !important",
|
||||
borderRadius: "8px !important",
|
||||
"& .MuiChip-label": {
|
||||
fontSize: "2.2em",
|
||||
},
|
||||
@@ -319,8 +294,7 @@ const Hero = ({
|
||||
</Typography>
|
||||
}
|
||||
sx={{
|
||||
borderRadius:
|
||||
"8px !important",
|
||||
borderRadius: "8px !important",
|
||||
"& .MuiChip-label": {
|
||||
fontSize: "2.2em",
|
||||
},
|
||||
@@ -336,15 +310,11 @@ const Hero = ({
|
||||
fontWeight={600}
|
||||
fontFamily="JetBrains Mono Variable"
|
||||
>
|
||||
{
|
||||
videoTracks[0]
|
||||
.VideoRangeType
|
||||
}
|
||||
{videoTracks[0].VideoRangeType}
|
||||
</Typography>
|
||||
}
|
||||
sx={{
|
||||
borderRadius:
|
||||
"8px !important",
|
||||
borderRadius: "8px !important",
|
||||
"& .MuiChip-label": {
|
||||
fontSize: "2.2em",
|
||||
},
|
||||
@@ -364,8 +334,7 @@ const Hero = ({
|
||||
</Typography>
|
||||
}
|
||||
sx={{
|
||||
borderRadius:
|
||||
"8px !important",
|
||||
borderRadius: "8px !important",
|
||||
"& .MuiChip-label": {
|
||||
fontSize: "2.2em",
|
||||
},
|
||||
@@ -385,8 +354,7 @@ const Hero = ({
|
||||
</Typography>
|
||||
}
|
||||
sx={{
|
||||
borderRadius:
|
||||
"8px !important",
|
||||
borderRadius: "8px !important",
|
||||
"& .MuiChip-label": {
|
||||
fontSize: "2.2em",
|
||||
},
|
||||
@@ -404,21 +372,14 @@ const Hero = ({
|
||||
justifyItems="flex-start"
|
||||
alignItems="center"
|
||||
>
|
||||
<Typography
|
||||
style={{ opacity: "0.8" }}
|
||||
variant="subtitle1"
|
||||
>
|
||||
{item.ProductionYear
|
||||
? item.ProductionYear
|
||||
: "Unknown"}
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
|
||||
{item.ProductionYear ? item.ProductionYear : "Unknown"}
|
||||
</Typography>
|
||||
<Chip
|
||||
variant="filled"
|
||||
label={
|
||||
item.OfficialRating ?? "Not Rated"
|
||||
}
|
||||
label={item.OfficialRating ?? "Not Rated"}
|
||||
/>
|
||||
<ErrorBoundary fallback={<></>}>
|
||||
<ErrorBoundary fallback=>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
@@ -444,10 +405,7 @@ const Hero = ({
|
||||
}}
|
||||
variant="subtitle1"
|
||||
>
|
||||
{Math.round(
|
||||
item.CommunityRating *
|
||||
10,
|
||||
) / 10}
|
||||
{Math.round(item.CommunityRating * 10) / 10}
|
||||
</Typography>
|
||||
</div>
|
||||
</ErrorBoundary>
|
||||
@@ -482,28 +440,18 @@ const Hero = ({
|
||||
)}
|
||||
|
||||
{!!item.RunTimeTicks && (
|
||||
<Typography
|
||||
style={{ opacity: "0.8" }}
|
||||
variant="subtitle1"
|
||||
>
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
|
||||
{getRuntime(item.RunTimeTicks)}
|
||||
</Typography>
|
||||
)}
|
||||
{!!item.RunTimeTicks && (
|
||||
<Typography
|
||||
style={{ opacity: "0.8" }}
|
||||
variant="subtitle1"
|
||||
>
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
|
||||
{endsAt(item.RunTimeTicks)}
|
||||
</Typography>
|
||||
)}
|
||||
</Stack>
|
||||
)}
|
||||
<Typography
|
||||
style={{ opacity: "0.8" }}
|
||||
variant="subtitle1"
|
||||
mt={1}
|
||||
>
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle1" mt={1}>
|
||||
{item.Genres.join(", ")}
|
||||
</Typography>
|
||||
</div>
|
||||
@@ -527,9 +475,7 @@ const Hero = ({
|
||||
/>
|
||||
<Typography variant="subtitle1" fontWeight={600}>
|
||||
{getRuntimeFull(
|
||||
item.RunTimeTicks -
|
||||
item.UserData
|
||||
.PlaybackPositionTicks,
|
||||
item.RunTimeTicks - item.UserData.PlaybackPositionTicks,
|
||||
)}{" "}
|
||||
remaining
|
||||
</Typography>
|
||||
@@ -557,10 +503,7 @@ const Hero = ({
|
||||
}}
|
||||
itemUserData={item.UserData}
|
||||
audio={audioPlayButton}
|
||||
playlistItemId={
|
||||
item.Type == BaseItemKind.Playlist &&
|
||||
item.Id
|
||||
}
|
||||
playlistItemId={item.Type === BaseItemKind.Playlist && item.Id}
|
||||
/>
|
||||
)}
|
||||
{!disableLikeButton && (
|
||||
@@ -606,11 +549,7 @@ const Hero = ({
|
||||
size="small"
|
||||
value={currentVideoIndex}
|
||||
select
|
||||
onChange={(e) =>
|
||||
setCurrentVideoIndex(
|
||||
e.target.value,
|
||||
)
|
||||
}
|
||||
onChange={(e) => setCurrentVideoIndex(e.target.value)}
|
||||
SelectProps={{
|
||||
MenuProps: {
|
||||
disableScrollLock: true,
|
||||
@@ -619,10 +558,7 @@ const Hero = ({
|
||||
>
|
||||
{videoTracks.map((track) => {
|
||||
return (
|
||||
<MenuItem
|
||||
key={track.Index}
|
||||
value={track.Index}
|
||||
>
|
||||
<MenuItem key={track.Index} value={track.Index}>
|
||||
{track.DisplayTitle}
|
||||
</MenuItem>
|
||||
);
|
||||
@@ -645,11 +581,7 @@ const Hero = ({
|
||||
size="small"
|
||||
value={currentAudioIndex}
|
||||
select
|
||||
onChange={(e) =>
|
||||
setCurrentAudioIndex(
|
||||
e.target.value,
|
||||
)
|
||||
}
|
||||
onChange={(e) => setCurrentAudioIndex(e.target.value)}
|
||||
SelectProps={{
|
||||
MenuProps: {
|
||||
disableScrollLock: true,
|
||||
@@ -658,10 +590,7 @@ const Hero = ({
|
||||
>
|
||||
{audioTracks.map((track) => {
|
||||
return (
|
||||
<MenuItem
|
||||
key={track.Index}
|
||||
value={track.Index}
|
||||
>
|
||||
<MenuItem key={track.Index} value={track.Index}>
|
||||
{track.DisplayTitle}
|
||||
</MenuItem>
|
||||
);
|
||||
@@ -686,9 +615,7 @@ const Hero = ({
|
||||
select
|
||||
onChange={(e) => {
|
||||
console.log(e.target.value);
|
||||
setCurrentSubtitleIndex(
|
||||
e.target.value,
|
||||
);
|
||||
setCurrentSubtitleIndex(e.target.value);
|
||||
}}
|
||||
SelectProps={{
|
||||
MenuProps: {
|
||||
@@ -698,10 +625,7 @@ const Hero = ({
|
||||
>
|
||||
{subtitleTracks.map((track) => {
|
||||
return (
|
||||
<MenuItem
|
||||
key={track.Index}
|
||||
value={track.Index}
|
||||
>
|
||||
<MenuItem key={track.Index} value={track.Index}>
|
||||
{track.DisplayTitle}
|
||||
</MenuItem>
|
||||
);
|
||||
@@ -715,17 +639,10 @@ const Hero = ({
|
||||
marginTop: "0.2em",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
fontStyle="italic"
|
||||
variant="h5"
|
||||
mb={1}
|
||||
mt={1}
|
||||
>
|
||||
<Typography fontStyle="italic" variant="h5" mb={1} mt={1}>
|
||||
{item.Taglines[0]}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1">
|
||||
{item.Overview}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1">{item.Overview}</Typography>
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
@@ -755,12 +672,10 @@ const Hero = ({
|
||||
>
|
||||
{writer.Name}
|
||||
</TextLink>
|
||||
{index !=
|
||||
writers.length - 1 && (
|
||||
{index !== writers.length - 1 && (
|
||||
<span
|
||||
style={{
|
||||
whiteSpace:
|
||||
"pre",
|
||||
whiteSpace: "pre",
|
||||
}}
|
||||
>
|
||||
,{" "}
|
||||
@@ -797,12 +712,10 @@ const Hero = ({
|
||||
>
|
||||
{director.Name}
|
||||
</TextLink>
|
||||
{index !=
|
||||
directors.length - 1 && (
|
||||
{index !== directors.length - 1 && (
|
||||
<span
|
||||
style={{
|
||||
whiteSpace:
|
||||
"pre",
|
||||
whiteSpace: "pre",
|
||||
}}
|
||||
>
|
||||
,{" "}
|
||||
@@ -839,12 +752,10 @@ const Hero = ({
|
||||
>
|
||||
{artist.Name}
|
||||
</TextLink>
|
||||
{index !=
|
||||
artists.length - 1 && (
|
||||
{index !== artists.length - 1 && (
|
||||
<span
|
||||
style={{
|
||||
whiteSpace:
|
||||
"pre",
|
||||
whiteSpace: "pre",
|
||||
}}
|
||||
>
|
||||
,{" "}
|
||||
@@ -872,9 +783,7 @@ const Hero = ({
|
||||
Studios
|
||||
</Typography>
|
||||
<Typography variant="subtitle1">
|
||||
{studios
|
||||
.map((studio) => studio.Name)
|
||||
.join(", ")}
|
||||
{studios.map((studio) => studio.Name).join(", ")}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/** @format */
|
||||
import React from "react";
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { Card } from "../../../card/card";
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
/** @format */
|
||||
import React from "react";
|
||||
import { useApi } from "../../../../utils/store/api";
|
||||
import { Card } from "../../../card/card";
|
||||
import { CardScroller } from "../../../cardScroller/cardScroller";
|
||||
|
||||
const GenreView = ({ libraryId, genreId, genreName, userId }) => {
|
||||
@@ -24,11 +24,7 @@ const GenreView = ({ libraryId, genreId, genreName, userId }) => {
|
||||
if (items.isSuccess && items.data.Items.length > 0) {
|
||||
return (
|
||||
<div className="library-genre">
|
||||
<CardScroller
|
||||
title={genreName}
|
||||
displayCards={8}
|
||||
disableDecoration
|
||||
>
|
||||
<CardScroller title={genreName} displayCards={8} disableDecoration>
|
||||
{items.data.Items.map((item) => {
|
||||
return (
|
||||
<Card
|
||||
@@ -36,64 +32,47 @@ const GenreView = ({ libraryId, genreId, genreName, userId }) => {
|
||||
item={item}
|
||||
seriesId={item.SeriesId}
|
||||
cardTitle={
|
||||
item.Type == BaseItemKind.Episode
|
||||
item.Type === BaseItemKind.Episode
|
||||
? item.SeriesName
|
||||
: item.Name
|
||||
}
|
||||
imageType={"Primary"}
|
||||
cardCaption={
|
||||
item.Type == BaseItemKind.Episode
|
||||
item.Type === BaseItemKind.Episode
|
||||
? `S${item.ParentIndexNumber}:E${item.IndexNumber} - ${item.Name}`
|
||||
: item.Type ==
|
||||
BaseItemKind.Series
|
||||
? `${item.ProductionYear} - ${
|
||||
!!item.EndDate
|
||||
? new Date(
|
||||
item.EndDate,
|
||||
).toLocaleString(
|
||||
[],
|
||||
{
|
||||
: item.Type === BaseItemKind.Series
|
||||
? `${item.ProductionYear} - ${
|
||||
item.EndDate
|
||||
? new Date(item.EndDate).toLocaleString([], {
|
||||
year: "numeric",
|
||||
},
|
||||
)
|
||||
: "Present"
|
||||
}`
|
||||
: item.ProductionYear
|
||||
})
|
||||
: "Present"
|
||||
}`
|
||||
: item.ProductionYear
|
||||
}
|
||||
disableOverlay={
|
||||
item.Type == BaseItemKind.Person ||
|
||||
item.Type ==
|
||||
BaseItemKind.MusicAlbum ||
|
||||
item.Type == BaseItemKind.Genre ||
|
||||
item.Type ==
|
||||
BaseItemKind.MusicGenre ||
|
||||
item.Type == BaseItemKind.Studio
|
||||
item.Type === BaseItemKind.Person ||
|
||||
item.Type === BaseItemKind.MusicAlbum ||
|
||||
item.Type === BaseItemKind.Genre ||
|
||||
item.Type === BaseItemKind.MusicGenre ||
|
||||
item.Type === BaseItemKind.Studio
|
||||
}
|
||||
cardType={
|
||||
item.Type ==
|
||||
BaseItemKind.MusicAlbum ||
|
||||
item.Type == BaseItemKind.Audio ||
|
||||
item.Type == BaseItemKind.Genre ||
|
||||
item.Type ==
|
||||
BaseItemKind.MusicGenre ||
|
||||
item.Type == BaseItemKind.Studio ||
|
||||
item.Type == BaseItemKind.Playlist
|
||||
item.Type === BaseItemKind.MusicAlbum ||
|
||||
item.Type === BaseItemKind.Audio ||
|
||||
item.Type === BaseItemKind.Genre ||
|
||||
item.Type === BaseItemKind.MusicGenre ||
|
||||
item.Type === BaseItemKind.Studio ||
|
||||
item.Type === BaseItemKind.Playlist
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
queryKey={[
|
||||
"library",
|
||||
"genreItem",
|
||||
genreId,
|
||||
]}
|
||||
queryKey={["library", "genreItem", genreId]}
|
||||
userId={userId}
|
||||
imageBlurhash={
|
||||
!!item.ImageBlurHashes?.Primary &&
|
||||
item.ImageBlurHashes?.Primary[
|
||||
Object.keys(
|
||||
item.ImageBlurHashes
|
||||
.Primary,
|
||||
)[0]
|
||||
Object.keys(item.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user