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
@@ -4,43 +4,43 @@ import React, { useEffect, useRef, useState } from "react";
|
||||
import { relaunch } from "@tauri-apps/api/process";
|
||||
|
||||
import MuiAppBar from "@mui/material/AppBar";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Toolbar from "@mui/material/Toolbar";
|
||||
import Avatar from "@mui/material/Avatar";
|
||||
import Button from "@mui/material/Button";
|
||||
import Grow from "@mui/material/Grow";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import ListItemIcon from "@mui/material/ListItemIcon";
|
||||
import Menu from "@mui/material/Menu";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import useScrollTrigger from "@mui/material/useScrollTrigger";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Button from "@mui/material/Button";
|
||||
import Popper from "@mui/material/Popper";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import Grow from "@mui/material/Grow";
|
||||
import Popper from "@mui/material/Popper";
|
||||
import Toolbar from "@mui/material/Toolbar";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import useScrollTrigger from "@mui/material/useScrollTrigger";
|
||||
|
||||
import { red } from "@mui/material/colors";
|
||||
|
||||
import { useLocation, useNavigate, NavLink } from "react-router-dom";
|
||||
import { NavLink, useLocation, useNavigate } from "react-router-dom";
|
||||
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
import "./appBar.module.scss";
|
||||
import { MdiAccount } from "../icons/mdiAccount";
|
||||
import { MdiHeartOutline } from "../icons/mdiHeartOutline";
|
||||
import { MdiArrowLeft } from "../icons/mdiArrowLeft";
|
||||
import { MdiCog } from "../icons/mdiCog";
|
||||
import { MdiInformation } from "../icons/mdiInformation";
|
||||
import { MdiMenu } from "../icons/mdiMenu";
|
||||
import { useDrawerStore } from "../../utils/store/drawer";
|
||||
import { delServer } from "../../utils/storage/servers";
|
||||
import { delUser } from "../../utils/storage/user";
|
||||
import { useDrawerStore } from "../../utils/store/drawer";
|
||||
import { MdiAccount } from "../icons/mdiAccount";
|
||||
import { MdiArrowLeft } from "../icons/mdiArrowLeft";
|
||||
import { MdiCog } from "../icons/mdiCog";
|
||||
import { MdiDelete } from "../icons/mdiDelete";
|
||||
import { MdiHeartOutline } from "../icons/mdiHeartOutline";
|
||||
import { MdiInformation } from "../icons/mdiInformation";
|
||||
import { MdiMenu } from "../icons/mdiMenu";
|
||||
import "./appBar.module.scss";
|
||||
|
||||
import { MdiLogoutVariant } from "../icons/mdiLogoutVariant";
|
||||
import { EventEmitter as event } from "../../eventEmitter";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import { MdiLogoutVariant } from "../icons/mdiLogoutVariant";
|
||||
|
||||
import { getTypeIcon } from "../../components/utils/iconsCollection";
|
||||
|
||||
@@ -53,9 +53,7 @@ const forwardRefNavLink = React.forwardRef({
|
||||
ref={ref}
|
||||
to={props.to}
|
||||
className={({ isActive }) =>
|
||||
`${props.className} ${
|
||||
isActive ? props.activeClassName : ""
|
||||
}`
|
||||
`${props.className} ${isActive ? props.activeClassName : ""}`
|
||||
}
|
||||
>
|
||||
{props.children}
|
||||
@@ -75,16 +73,16 @@ export const AppBar = () => {
|
||||
const user = useQuery({
|
||||
queryKey: ["user"],
|
||||
queryFn: async () => {
|
||||
let usr = await getUserApi(api).getCurrentUser();
|
||||
const usr = await getUserApi(api).getCurrentUser();
|
||||
return usr.data;
|
||||
},
|
||||
enabled: display,
|
||||
networkMode: "always",
|
||||
});
|
||||
let libraries = useQuery({
|
||||
const libraries = useQuery({
|
||||
queryKey: ["libraries"],
|
||||
queryFn: async () => {
|
||||
let libs = await getUserViewsApi(api).getUserViews({
|
||||
const libs = await getUserViewsApi(api).getUserViews({
|
||||
userId: user.data.Id,
|
||||
});
|
||||
return libs.data;
|
||||
@@ -157,7 +155,7 @@ export const AppBar = () => {
|
||||
setDisplay(true);
|
||||
}
|
||||
|
||||
if (location.pathname == "/home") {
|
||||
if (location.pathname === "/home") {
|
||||
setBackButtonVisible(false);
|
||||
} else {
|
||||
setBackButtonVisible(true);
|
||||
@@ -198,9 +196,7 @@ export const AppBar = () => {
|
||||
justifySelf: "left",
|
||||
}}
|
||||
>
|
||||
<div className="material-symbols-rounded">
|
||||
arrow_back
|
||||
</div>
|
||||
<div className="material-symbols-rounded">arrow_back</div>
|
||||
</IconButton>
|
||||
|
||||
<div
|
||||
@@ -219,10 +215,7 @@ export const AppBar = () => {
|
||||
size="large"
|
||||
className="appBar-text active"
|
||||
>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
fontWeight={600}
|
||||
>
|
||||
<Typography variant="subtitle1" fontWeight={600}>
|
||||
Home
|
||||
</Typography>
|
||||
</Button>
|
||||
@@ -235,10 +228,7 @@ export const AppBar = () => {
|
||||
size="large"
|
||||
color="white"
|
||||
>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
fontWeight={600}
|
||||
>
|
||||
<Typography variant="subtitle1" fontWeight={600}>
|
||||
Home
|
||||
</Typography>
|
||||
</Button>
|
||||
@@ -253,19 +243,12 @@ export const AppBar = () => {
|
||||
style={{ textTransform: "none" }}
|
||||
size="large"
|
||||
disableFocusRipple={false}
|
||||
color={
|
||||
isBrowsingLibrary ? "primary" : "white"
|
||||
}
|
||||
color={isBrowsingLibrary ? "primary" : "white"}
|
||||
className={
|
||||
isBrowsingLibrary
|
||||
? "appBar-text active"
|
||||
: "appBar-text"
|
||||
isBrowsingLibrary ? "appBar-text active" : "appBar-text"
|
||||
}
|
||||
>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
fontWeight={600}
|
||||
>
|
||||
<Typography variant="subtitle1" fontWeight={600}>
|
||||
Libraries
|
||||
</Typography>
|
||||
</Button>
|
||||
@@ -335,45 +318,32 @@ export const AppBar = () => {
|
||||
<div className="appBar-library-scrollContainer">
|
||||
{libraries.isPending
|
||||
? "loading..."
|
||||
: libraries.data.Items.map(
|
||||
(
|
||||
library,
|
||||
) => (
|
||||
<NavLink
|
||||
key={
|
||||
library.Id
|
||||
}
|
||||
className="appBar-library"
|
||||
to={`library/${library.Id}`}
|
||||
style={{
|
||||
borderRadius:
|
||||
"10px",
|
||||
}}
|
||||
>
|
||||
{Object.keys(
|
||||
library.ImageTags,
|
||||
).includes(
|
||||
"Primary",
|
||||
) ? (
|
||||
<img
|
||||
src={`${api.basePath}/Items/${library.Id}/Images/Primary?quality=90&fillHeight=226&fillWidth=127`}
|
||||
/>
|
||||
) : (
|
||||
<div className="appBar-library-icon">
|
||||
{" "}
|
||||
{getTypeIcon(
|
||||
library.CollectionType,
|
||||
)}{" "}
|
||||
<Typography variant="h6">
|
||||
{
|
||||
library.Name
|
||||
}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
</NavLink>
|
||||
),
|
||||
)}
|
||||
: libraries.data.Items.map((library) => (
|
||||
<NavLink
|
||||
key={library.Id}
|
||||
className="appBar-library"
|
||||
to={`library/${library.Id}`}
|
||||
style={{
|
||||
borderRadius: "10px",
|
||||
}}
|
||||
>
|
||||
{Object.keys(library.ImageTags).includes(
|
||||
"Primary",
|
||||
) ? (
|
||||
<img
|
||||
src={`${api.basePath}/Items/${library.Id}/Images/Primary?quality=90&fillHeight=226&fillWidth=127`}
|
||||
/>
|
||||
) : (
|
||||
<div className="appBar-library-icon">
|
||||
{" "}
|
||||
{getTypeIcon(library.CollectionType)}{" "}
|
||||
<Typography variant="h6">
|
||||
{library.Name}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
</NavLink>
|
||||
))}
|
||||
</div>
|
||||
</Paper>
|
||||
</Grow>
|
||||
@@ -386,37 +356,21 @@ export const AppBar = () => {
|
||||
style={{ justifySelf: "right", gap: "0.6em" }}
|
||||
>
|
||||
<IconButton onClick={() => navigate("/search")}>
|
||||
<div className="material-symbols-rounded">
|
||||
search
|
||||
</div>
|
||||
<div className="material-symbols-rounded">search</div>
|
||||
</IconButton>
|
||||
<IconButton onClick={() => navigate("/favorite")}>
|
||||
<div className="material-symbols-rounded">
|
||||
favorite
|
||||
</div>
|
||||
<div className="material-symbols-rounded">favorite</div>
|
||||
</IconButton>
|
||||
<IconButton
|
||||
sx={{ p: 0 }}
|
||||
onClick={handleMenuOpen}
|
||||
>
|
||||
<IconButton sx={{ p: 0 }} onClick={handleMenuOpen}>
|
||||
{user.isSuccess &&
|
||||
(user.data.PrimaryImageTag ==
|
||||
undefined ? (
|
||||
<Avatar
|
||||
className="appBar-avatar"
|
||||
alt={user.data.Name}
|
||||
>
|
||||
(user.data.PrimaryImageTag === undefined ? (
|
||||
<Avatar className="appBar-avatar" alt={user.data.Name}>
|
||||
<MdiAccount className="appBar-avatar-icon" />
|
||||
</Avatar>
|
||||
) : (
|
||||
<Avatar
|
||||
className="appBar-avatar"
|
||||
src={
|
||||
api.basePath +
|
||||
"/Users/" +
|
||||
user.data.Id +
|
||||
"/Images/Primary"
|
||||
}
|
||||
src={`${api.basePath}/Users/${user.data.Id}/Images/Primary`}
|
||||
alt={user.data.Name}
|
||||
>
|
||||
<MdiAccount className="appBar-avatar-icon" />
|
||||
@@ -430,30 +384,21 @@ export const AppBar = () => {
|
||||
sx={{ mt: 2 }}
|
||||
disableScrollLock
|
||||
>
|
||||
<MenuItem
|
||||
onClick={() => navigate("/settings")}
|
||||
disabled
|
||||
>
|
||||
<MenuItem onClick={() => navigate("/settings")} disabled>
|
||||
<ListItemIcon>
|
||||
<div className="material-symbols-rounded">
|
||||
settings
|
||||
</div>
|
||||
<div className="material-symbols-rounded">settings</div>
|
||||
</ListItemIcon>
|
||||
Settings
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => navigate("/about")}>
|
||||
<ListItemIcon>
|
||||
<div className="material-symbols-rounded">
|
||||
info
|
||||
</div>
|
||||
<div className="material-symbols-rounded">info</div>
|
||||
</ListItemIcon>
|
||||
About
|
||||
</MenuItem>
|
||||
<MenuItem onClick={handleLogout}>
|
||||
<ListItemIcon>
|
||||
<div className="material-symbols-rounded">
|
||||
logout
|
||||
</div>
|
||||
<div className="material-symbols-rounded">logout</div>
|
||||
</ListItemIcon>
|
||||
Logout
|
||||
</MenuItem>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/** @format */
|
||||
|
||||
import AppBar from "@mui/material/AppBar";
|
||||
import Toolbar from "@mui/material/Toolbar";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import { MdiArrowLeft } from "../icons/mdiArrowLeft";
|
||||
import Toolbar from "@mui/material/Toolbar";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { MdiArrowLeft } from "../icons/mdiArrowLeft";
|
||||
|
||||
export const AppBarBackOnly = () => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import PropTypes from "prop-types";
|
||||
/** @format */
|
||||
import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
|
||||
@@ -17,14 +17,9 @@ export const AvatarImage = ({ userId }) => {
|
||||
<div
|
||||
className="avatar-image"
|
||||
style={{
|
||||
backgroundImage:
|
||||
"url('" +
|
||||
api.basePath +
|
||||
"/Users/" +
|
||||
userId +
|
||||
"/Images/Primary')",
|
||||
backgroundImage: `url('${api.basePath}/Users/${userId}/Images/Primary')`,
|
||||
}}
|
||||
></div>
|
||||
/>
|
||||
|
||||
<div className="avatar-image-icon-container">
|
||||
<MdiAccount className="avatar-image-icon" />
|
||||
@@ -34,7 +29,7 @@ export const AvatarImage = ({ userId }) => {
|
||||
};
|
||||
|
||||
export const AvatarSideMenu = ({ userName }) => {
|
||||
return <div></div>;
|
||||
return <div />;
|
||||
};
|
||||
|
||||
AvatarImage.propType = {
|
||||
|
||||
@@ -6,12 +6,12 @@ import React from "react";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import { pink } from "@mui/material/colors";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { MdiHeart } from "../icons/mdiHeart";
|
||||
import { MdiHeartOutline } from "../icons/mdiHeartOutline";
|
||||
import { useSnackbar } from "notistack";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
|
||||
import { useApi } from "../../utils/store/api";
|
||||
|
||||
@@ -39,12 +39,9 @@ const LikeButton = ({ itemId, isFavorite, queryKey, userId, itemName }) => {
|
||||
enqueueSnackbar(`${error}`, {
|
||||
variant: "error",
|
||||
});
|
||||
enqueueSnackbar(
|
||||
`An error occured while updating "${itemName}"`,
|
||||
{
|
||||
variant: "error",
|
||||
},
|
||||
);
|
||||
enqueueSnackbar(`An error occured while updating "${itemName}"`, {
|
||||
variant: "error",
|
||||
});
|
||||
console.error(error);
|
||||
},
|
||||
onSettled: async () => {
|
||||
|
||||
@@ -3,16 +3,16 @@ import PropTypes from "prop-types";
|
||||
|
||||
import React from "react";
|
||||
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { green } from "@mui/material/colors";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||
import { MdiCheck } from "../icons/mdiCheck";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import { MdiCheck } from "../icons/mdiCheck";
|
||||
|
||||
const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
|
||||
const [api] = useApi((state) => [state.api]);
|
||||
@@ -39,12 +39,9 @@ const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
|
||||
enqueueSnackbar(`${error}`, {
|
||||
variant: "error",
|
||||
});
|
||||
enqueueSnackbar(
|
||||
`An error occured while updating "${itemName}"`,
|
||||
{
|
||||
variant: "error",
|
||||
},
|
||||
);
|
||||
enqueueSnackbar(`An error occured while updating "${itemName}"`, {
|
||||
variant: "error",
|
||||
});
|
||||
console.error(error);
|
||||
},
|
||||
onSettled: async () => {
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
import PropTypes from "prop-types";
|
||||
/** @format */
|
||||
import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import Button from "@mui/material/Button";
|
||||
import Fab from "@mui/material/Fab";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import {
|
||||
setItem,
|
||||
usePlaybackDataLoadStore,
|
||||
usePlaybackStore,
|
||||
} from "../../utils/store/playback";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import {
|
||||
BaseItemKind,
|
||||
ItemFields,
|
||||
SortOrder,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getPlaylistsApi } from "@jellyfin/sdk/lib/utils/api/playlists-api";
|
||||
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
||||
import {
|
||||
setItem,
|
||||
usePlaybackDataLoadStore,
|
||||
usePlaybackStore,
|
||||
} from "../../utils/store/playback";
|
||||
|
||||
const PlayButton = ({
|
||||
itemId,
|
||||
@@ -114,17 +114,12 @@ const PlayButton = ({
|
||||
seriesId: itemId,
|
||||
limit: 1,
|
||||
startIndex: 0,
|
||||
fields: [
|
||||
ItemFields.MediaSources,
|
||||
ItemFields.MediaStreams,
|
||||
],
|
||||
fields: [ItemFields.MediaSources, ItemFields.MediaStreams],
|
||||
enableUserData: true,
|
||||
});
|
||||
break;
|
||||
case BaseItemKind.Playlist:
|
||||
result = await getPlaylistsApi(
|
||||
api,
|
||||
).getPlaylistItems({
|
||||
result = await getPlaylistsApi(api).getPlaylistItems({
|
||||
userId: userId,
|
||||
playlistId: playlistItemId,
|
||||
});
|
||||
@@ -133,10 +128,7 @@ const PlayButton = ({
|
||||
result = await getItemsApi(api).getItems({
|
||||
parentId: itemId,
|
||||
userId: userId,
|
||||
fields: [
|
||||
ItemFields.MediaSources,
|
||||
ItemFields.MediaStreams,
|
||||
],
|
||||
fields: [ItemFields.MediaSources, ItemFields.MediaStreams],
|
||||
sortOrder: SortOrder.Ascending,
|
||||
sortBy: "IndexNumber",
|
||||
});
|
||||
@@ -147,26 +139,16 @@ const PlayButton = ({
|
||||
recursive: true,
|
||||
includeItemTypes: [BaseItemKind.Audio],
|
||||
userId: userId,
|
||||
fields: [
|
||||
ItemFields.MediaSources,
|
||||
ItemFields.MediaStreams,
|
||||
],
|
||||
fields: [ItemFields.MediaSources, ItemFields.MediaStreams],
|
||||
sortOrder: SortOrder.Ascending,
|
||||
sortBy: [
|
||||
"PremiereDate",
|
||||
"ProductionYear",
|
||||
"SortName",
|
||||
],
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
});
|
||||
break;
|
||||
default:
|
||||
result = await getItemsApi(api).getItems({
|
||||
ids: [itemId],
|
||||
userId: userId,
|
||||
fields: [
|
||||
ItemFields.MediaSources,
|
||||
ItemFields.MediaStreams,
|
||||
],
|
||||
fields: [ItemFields.MediaSources, ItemFields.MediaStreams],
|
||||
sortOrder: SortOrder.Ascending,
|
||||
sortBy: "IndexNumber",
|
||||
});
|
||||
@@ -198,7 +180,7 @@ const PlayButton = ({
|
||||
setItemId(item.Items[0].Id);
|
||||
setDuration(item.Items[0].RunTimeTicks);
|
||||
|
||||
if (item.Items[0].Type == BaseItemKind.Episode) {
|
||||
if (item.Items[0].Type === BaseItemKind.Episode) {
|
||||
setSeriesId(item.Items[0].SeriesId);
|
||||
// setEpisodeIndex(item.Ite)
|
||||
}
|
||||
@@ -229,9 +211,7 @@ const PlayButton = ({
|
||||
} else {
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<Typography variant="h6">
|
||||
{item.Items[0].Name}
|
||||
</Typography>
|
||||
<Typography variant="h6">{item.Items[0].Name}</Typography>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
@@ -248,16 +228,9 @@ const PlayButton = ({
|
||||
}}
|
||||
/>
|
||||
<Typography variant="subtitle1">
|
||||
S
|
||||
{
|
||||
item.Items[0]
|
||||
.ParentIndexNumber
|
||||
}
|
||||
S{item.Items[0].ParentIndexNumber}
|
||||
:E
|
||||
{
|
||||
item.Items[0].IndexNumber
|
||||
}{" "}
|
||||
{item.Items[0].Name}
|
||||
{item.Items[0].IndexNumber} {item.Items[0].Name}
|
||||
</Typography>
|
||||
</div>,
|
||||
);
|
||||
@@ -268,16 +241,9 @@ const PlayButton = ({
|
||||
{item.Items[0].SeriesName}
|
||||
</Typography>
|
||||
<Typography variant="subtitle1">
|
||||
S
|
||||
{
|
||||
item.Items[0]
|
||||
.ParentIndexNumber
|
||||
}
|
||||
S{item.Items[0].ParentIndexNumber}
|
||||
:E
|
||||
{
|
||||
item.Items[0].IndexNumber
|
||||
}{" "}
|
||||
{item.Items[0].Name}
|
||||
{item.Items[0].IndexNumber} {item.Items[0].Name}
|
||||
</Typography>
|
||||
</div>,
|
||||
);
|
||||
@@ -287,9 +253,7 @@ const PlayButton = ({
|
||||
default:
|
||||
setItemName(
|
||||
<div className="video-osd-name">
|
||||
<Typography variant="h6">
|
||||
{item.Items[0].Name}
|
||||
</Typography>
|
||||
<Typography variant="h6">{item.Items[0].Name}</Typography>
|
||||
</div>,
|
||||
);
|
||||
break;
|
||||
@@ -302,7 +266,7 @@ const PlayButton = ({
|
||||
?Static=true&mediaSourceId=${item.Items[0].Id}&deviceId=${api.deviceInfo.id}&api_key=${api.accessToken}&Tag=${item.Items[0].MediaSources[0].ETag}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`,
|
||||
);
|
||||
|
||||
navigate(`/player`);
|
||||
navigate("/player");
|
||||
}
|
||||
},
|
||||
onSettled: () => {
|
||||
@@ -339,53 +303,52 @@ const PlayButton = ({
|
||||
</div>
|
||||
</Fab>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<Button
|
||||
className={className}
|
||||
variant="contained"
|
||||
onClick={handleClick}
|
||||
startIcon={
|
||||
<div
|
||||
className="material-symbols-rounded"
|
||||
style={{
|
||||
fontSize: "2em",
|
||||
}}
|
||||
>
|
||||
play_arrow
|
||||
</div>
|
||||
}
|
||||
{...buttonProps}
|
||||
sx={{
|
||||
position: "relative",
|
||||
overflow: "hidden",
|
||||
}}
|
||||
size={size}
|
||||
>
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
value={
|
||||
100 > itemUserData.PlayedPercentage > 0
|
||||
? itemUserData.PlayedPercentage
|
||||
: 0
|
||||
}
|
||||
sx={{
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
height: "100%",
|
||||
background: "transparent",
|
||||
opacity: 0.2,
|
||||
zIndex: 0,
|
||||
}}
|
||||
color="white"
|
||||
/>
|
||||
{itemUserData.PlaybackPositionTicks > 0 ? "Resume" : "Play"}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Button
|
||||
className={className}
|
||||
variant="contained"
|
||||
onClick={handleClick}
|
||||
startIcon={
|
||||
<div
|
||||
className="material-symbols-rounded"
|
||||
style={{
|
||||
fontSize: "2em",
|
||||
}}
|
||||
>
|
||||
play_arrow
|
||||
</div>
|
||||
}
|
||||
{...buttonProps}
|
||||
sx={{
|
||||
position: "relative",
|
||||
overflow: "hidden",
|
||||
}}
|
||||
size={size}
|
||||
>
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
value={
|
||||
100 > itemUserData.PlayedPercentage > 0
|
||||
? itemUserData.PlayedPercentage
|
||||
: 0
|
||||
}
|
||||
sx={{
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
height: "100%",
|
||||
background: "transparent",
|
||||
opacity: 0.2,
|
||||
zIndex: 0,
|
||||
}}
|
||||
color="white"
|
||||
/>
|
||||
{itemUserData.PlaybackPositionTicks > 0 ? "Resume" : "Play"}
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
export default PlayButton;
|
||||
|
||||
@@ -10,8 +10,8 @@ import { Blurhash } from "react-blurhash";
|
||||
|
||||
import { MdiAccountTie } from "../icons/mdiAccountTie";
|
||||
|
||||
import "./card.module.scss";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import "./card.module.scss";
|
||||
|
||||
/**
|
||||
* @typedef {Object} Props
|
||||
@@ -70,9 +70,7 @@ export const ActorCard = ({
|
||||
/>
|
||||
)}
|
||||
<div className="card-image-icon-container">
|
||||
<div className="material-symbols-rounded">
|
||||
person
|
||||
</div>
|
||||
<div className="material-symbols-rounded">person</div>
|
||||
</div>
|
||||
<img
|
||||
src={api.getItemImageUrl(
|
||||
|
||||
@@ -3,17 +3,17 @@ import React from "react";
|
||||
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
import Typography from "@mui/material/Typography";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import { getTypeIcon } from "../utils/iconsCollection";
|
||||
import "./card.module.scss";
|
||||
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import LikeButton from "../buttons/likeButton";
|
||||
import MarkPlayedButton from "../buttons/markPlayedButton";
|
||||
import PlayButton from "../buttons/playButton";
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import ErrorBoundary from "../errorBoundary";
|
||||
|
||||
const cardImageAspectRatios = {
|
||||
@@ -73,9 +73,9 @@ export const Card = ({
|
||||
const defaultOnClick = () => {
|
||||
if (availableSpecialRoutes.includes(item.Type)) {
|
||||
navigate(`/${item.Type.toLocaleLowerCase()}/${item.Id}`);
|
||||
} else if (!!item.Role || item.Type == BaseItemKind.Person) {
|
||||
} else if (!!item.Role || item.Type === BaseItemKind.Person) {
|
||||
navigate(`/person/${item.Id}`);
|
||||
} else if (item.Type == BaseItemKind.MusicArtist) {
|
||||
} else if (item.Type === BaseItemKind.MusicArtist) {
|
||||
navigate(`/artist/${item.Id}`);
|
||||
} else {
|
||||
navigate(`/item/${item.Id}`);
|
||||
@@ -85,7 +85,6 @@ export const Card = ({
|
||||
<div
|
||||
className="card"
|
||||
elevation={0}
|
||||
tabIndex={0}
|
||||
onClick={onClick ? onClick : defaultOnClick}
|
||||
>
|
||||
<div
|
||||
@@ -94,23 +93,19 @@ export const Card = ({
|
||||
aspectRatio: cardImageAspectRatios[cardType],
|
||||
}}
|
||||
>
|
||||
<ErrorBoundary fallback={<></>}>
|
||||
<ErrorBoundary fallback=>
|
||||
<div
|
||||
className="card-indicator check"
|
||||
style={{
|
||||
opacity: item.UserData?.Played ? 1 : 0,
|
||||
}}
|
||||
>
|
||||
<div className="material-symbols-rounded">
|
||||
done
|
||||
</div>
|
||||
<div className="material-symbols-rounded">done</div>
|
||||
</div>
|
||||
<div
|
||||
className={`card-indicator text`}
|
||||
className={"card-indicator text"}
|
||||
style={{
|
||||
opacity: item.UserData?.UnplayedItemCount
|
||||
? 1
|
||||
: 0,
|
||||
opacity: item.UserData?.UnplayedItemCount ? 1 : 0,
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
@@ -133,29 +128,24 @@ export const Card = ({
|
||||
/>
|
||||
)} */}
|
||||
<div className="card-image-icon-container">
|
||||
{overrideIcon
|
||||
? getTypeIcon(overrideIcon)
|
||||
: getTypeIcon(item.Type)}
|
||||
{overrideIcon ? getTypeIcon(overrideIcon) : getTypeIcon(item.Type)}
|
||||
</div>
|
||||
<img
|
||||
src={
|
||||
overrideIcon == "User"
|
||||
overrideIcon === "User"
|
||||
? `${api.basePath}/Users/${item.Id}/Images/Primary`
|
||||
: api.getItemImageUrl(
|
||||
seriesId
|
||||
? item.SeriesId
|
||||
: item.AlbumId
|
||||
? item.AlbumId
|
||||
: item.Id,
|
||||
? item.AlbumId
|
||||
: item.Id,
|
||||
imageType,
|
||||
{
|
||||
quality: 90,
|
||||
fillHeight: 226,
|
||||
fillWidth: Math.floor(
|
||||
226 /
|
||||
cardImageAspectRatios[
|
||||
cardType
|
||||
],
|
||||
226 / cardImageAspectRatios[cardType],
|
||||
),
|
||||
},
|
||||
)
|
||||
@@ -185,16 +175,12 @@ export const Card = ({
|
||||
}}
|
||||
iconOnly
|
||||
audio={
|
||||
item.Type ==
|
||||
BaseItemKind.MusicAlbum ||
|
||||
item.Type == BaseItemKind.Audio ||
|
||||
item.Type ==
|
||||
BaseItemKind.AudioBook ||
|
||||
item.Type == BaseItemKind.Playlist
|
||||
}
|
||||
playlistItem={
|
||||
item.Type == BaseItemKind.Playlist
|
||||
item.Type === BaseItemKind.MusicAlbum ||
|
||||
item.Type === BaseItemKind.Audio ||
|
||||
item.Type === BaseItemKind.AudioBook ||
|
||||
item.Type === BaseItemKind.Playlist
|
||||
}
|
||||
playlistItem={item.Type === BaseItemKind.Playlist}
|
||||
playlistItemId={item.Id}
|
||||
/>
|
||||
<LikeButton
|
||||
|
||||
@@ -4,20 +4,20 @@ import { useNavigate } from "react-router-dom";
|
||||
|
||||
import MuiCard from "@mui/material/Card";
|
||||
import CardActionArea from "@mui/material/CardActionArea";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import { Blurhash } from "react-blurhash";
|
||||
|
||||
import "./card.module.scss";
|
||||
import { MdiCheck } from "../icons/mdiCheck";
|
||||
import "./card.module.scss";
|
||||
|
||||
import { getRuntimeCompact } from "../../utils/date/time";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import LikeButton from "../buttons/likeButton";
|
||||
import MarkPlayedButton from "../buttons/markPlayedButton";
|
||||
import PlayButton from "../buttons/playButton";
|
||||
import { MdiTelevisionClassic } from "../icons/mdiTelevisionClassic";
|
||||
import { getRuntimeCompact } from "../../utils/date/time";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
|
||||
/**
|
||||
* @typedef {Object} Props
|
||||
@@ -70,9 +70,7 @@ export const EpisodeCard = ({
|
||||
opacity: item.UserData?.Played ? 1 : 0,
|
||||
}}
|
||||
>
|
||||
<div className="material-symbols-rounded">
|
||||
done
|
||||
</div>
|
||||
<div className="material-symbols-rounded">done</div>
|
||||
</div>
|
||||
)}
|
||||
{!!imageBlurhash && (
|
||||
@@ -86,9 +84,7 @@ export const EpisodeCard = ({
|
||||
/>
|
||||
)}
|
||||
<div className="card-image-icon-container">
|
||||
<div className="material-symbols-rounded">
|
||||
tv_gen
|
||||
</div>
|
||||
<div className="material-symbols-rounded">tv_gen</div>
|
||||
</div>
|
||||
<img
|
||||
src={api.getItemImageUrl(item.Id, "Primary", {
|
||||
@@ -146,8 +142,7 @@ export const EpisodeCard = ({
|
||||
bottom: 0,
|
||||
zIndex: 2,
|
||||
height: "6px",
|
||||
background:
|
||||
"rgb(5 5 5 / 0.5) !important",
|
||||
background: "rgb(5 5 5 / 0.5) !important",
|
||||
backdropFilter: "blur(5px)",
|
||||
}}
|
||||
color="primary"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** @format */
|
||||
|
||||
import React, { useState } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import React, { useState } from "react";
|
||||
|
||||
import Carousel from "react-multi-carousel";
|
||||
import "react-multi-carousel/lib/styles.css";
|
||||
@@ -9,10 +9,10 @@ import "react-multi-carousel/lib/styles.css";
|
||||
import { MdiChevronLeft } from "../icons/mdiChevronLeft";
|
||||
import { MdiChevronRight } from "../icons/mdiChevronRight";
|
||||
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import ButtonGroup from "@mui/material/ButtonGroup";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import "./cardScroller.module.scss";
|
||||
export const CardScroller = ({
|
||||
@@ -65,8 +65,8 @@ export const CardScroller = ({
|
||||
sx={{ mb: 1 }}
|
||||
className={
|
||||
disableDecoration
|
||||
? `card-scroller-header-container hidden-decoration`
|
||||
: `card-scroller-header-container`
|
||||
? "card-scroller-header-container hidden-decoration"
|
||||
: "card-scroller-header-container"
|
||||
}
|
||||
>
|
||||
<Typography
|
||||
@@ -75,25 +75,20 @@ export const CardScroller = ({
|
||||
className="card-scroller-heading"
|
||||
{...headingProps}
|
||||
>
|
||||
<div className="card-scroller-heading-decoration"></div>{" "}
|
||||
{title}
|
||||
<div className="card-scroller-heading-decoration" /> {title}
|
||||
</Typography>
|
||||
<ButtonGroup className="card-scroller-button-group">
|
||||
<IconButton
|
||||
className="card-scroller-button"
|
||||
onClick={() => carouselRef.previous()}
|
||||
>
|
||||
<div className="material-symbols-rounded">
|
||||
chevron_left
|
||||
</div>
|
||||
<div className="material-symbols-rounded">chevron_left</div>
|
||||
</IconButton>
|
||||
<IconButton
|
||||
className="card-scroller-button"
|
||||
onClick={() => carouselRef.next()}
|
||||
>
|
||||
<div className="material-symbols-rounded">
|
||||
chevron_right
|
||||
</div>
|
||||
<div className="material-symbols-rounded">chevron_right</div>
|
||||
</IconButton>
|
||||
</ButtonGroup>
|
||||
</Box>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
/** @format */
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import { MdiChevronLeft } from "../icons/mdiChevronLeft";
|
||||
import { MdiChevronRight } from "../icons/mdiChevronRight";
|
||||
|
||||
import "./carousel.scss";
|
||||
import { useCarouselStore } from "../../utils/store/carousel";
|
||||
import "./carousel.scss";
|
||||
|
||||
const swipeConfidenceThreshold = 8000;
|
||||
const swipePower = (offset, velocity) => {
|
||||
@@ -30,7 +30,7 @@ const Carousel = ({ content, onChange }) => {
|
||||
<IconButton
|
||||
className="carousel-button left"
|
||||
onClick={() => {
|
||||
if (currentSlide == 0) {
|
||||
if (currentSlide === 0) {
|
||||
setDirection("left");
|
||||
setCurrentSlide(content.length - 1);
|
||||
}
|
||||
@@ -62,15 +62,12 @@ const Carousel = ({ content, onChange }) => {
|
||||
onDragEnd={(e, { offset, velocity }) => {
|
||||
const swipe = swipePower(offset.x, velocity.x);
|
||||
if (
|
||||
currentSlide != content.length - 1 &&
|
||||
currentSlide !== content.length - 1 &&
|
||||
swipe < -swipeConfidenceThreshold
|
||||
) {
|
||||
setDirection("right");
|
||||
setCurrentSlide((init) => init + 1);
|
||||
} else if (
|
||||
currentSlide != 0 &&
|
||||
swipe > swipeConfidenceThreshold
|
||||
) {
|
||||
} else if (currentSlide !== 0 && swipe > swipeConfidenceThreshold) {
|
||||
setDirection("left");
|
||||
setCurrentSlide((init) => init - 1);
|
||||
}
|
||||
@@ -87,7 +84,7 @@ const Carousel = ({ content, onChange }) => {
|
||||
<IconButton
|
||||
className="carousel-button right"
|
||||
onClick={() => {
|
||||
if (currentSlide == content.length - 1) {
|
||||
if (currentSlide === content.length - 1) {
|
||||
setDirection("right");
|
||||
setCurrentSlide(0);
|
||||
} else if (currentSlide < content.length - 1) {
|
||||
@@ -106,7 +103,7 @@ const Carousel = ({ content, onChange }) => {
|
||||
{content.map((item, index) => (
|
||||
<div
|
||||
className={
|
||||
currentSlide == index
|
||||
currentSlide === index
|
||||
? "carousel-indicator active"
|
||||
: "carousel-indicator"
|
||||
}
|
||||
|
||||
@@ -4,31 +4,31 @@ import { Blurhash } from "react-blurhash";
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
|
||||
import Paper from "@mui/material/Paper";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Chip from "@mui/material/Chip";
|
||||
import Button from "@mui/material/Button";
|
||||
import Chip from "@mui/material/Chip";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import { yellow } from "@mui/material/colors";
|
||||
import ErrorBoundary from "../errorBoundary";
|
||||
|
||||
import CarouselSlideError from "../errors/carousel";
|
||||
import { MdiStar } from "../icons/mdiStar";
|
||||
import { endsAt, getRuntime } from "../../utils/date/time";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { MediaTypeIconCollection, getTypeIcon } from "../utils/iconsCollection";
|
||||
import { MdiChevronRight } from "../icons/mdiChevronRight";
|
||||
import { green, red } from "@mui/material/colors";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { red, green } from "@mui/material/colors";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { endsAt, getRuntime } from "../../utils/date/time";
|
||||
import CarouselSlideError from "../errors/carousel";
|
||||
import { MdiChevronRight } from "../icons/mdiChevronRight";
|
||||
import { MdiStar } from "../icons/mdiStar";
|
||||
import { MediaTypeIconCollection, getTypeIcon } from "../utils/iconsCollection";
|
||||
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import { useCarouselStore } from "../../utils/store/carousel";
|
||||
import LikeButton from "../buttons/likeButton";
|
||||
import MarkPlayedButton from "../buttons/markPlayedButton";
|
||||
import { useCarouselStore } from "../../utils/store/carousel";
|
||||
import PlayButton from "../buttons/playButton";
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
|
||||
const availableSpecialRoutes = [
|
||||
BaseItemKind.Series,
|
||||
@@ -53,7 +53,7 @@ const CarouselSlide = ({ item }) => {
|
||||
const user = useQuery({
|
||||
queryKey: ["user"],
|
||||
queryFn: async () => {
|
||||
let usr = await getUserApi(api).getCurrentUser();
|
||||
const usr = await getUserApi(api).getCurrentUser();
|
||||
return usr.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
@@ -69,9 +69,7 @@ const CarouselSlide = ({ item }) => {
|
||||
}
|
||||
};
|
||||
|
||||
const [animationDirection] = useCarouselStore((state) => [
|
||||
state.direction,
|
||||
]);
|
||||
const [animationDirection] = useCarouselStore((state) => [state.direction]);
|
||||
|
||||
return (
|
||||
<ErrorBoundary fallback={<CarouselSlideError itemName={item.Name} />}>
|
||||
@@ -86,15 +84,11 @@ const CarouselSlide = ({ item }) => {
|
||||
<div className="hero-carousel-background-container">
|
||||
{!!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]
|
||||
]
|
||||
}
|
||||
// hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
|
||||
@@ -116,9 +110,7 @@ const CarouselSlide = ({ item }) => {
|
||||
style={{
|
||||
opacity: 0,
|
||||
}}
|
||||
onLoad={(e) =>
|
||||
(e.target.style.opacity = 1)
|
||||
}
|
||||
onLoad={(e) => (e.target.style.opacity = 1)}
|
||||
loading="eager"
|
||||
/>
|
||||
</>
|
||||
@@ -132,7 +124,7 @@ const CarouselSlide = ({ item }) => {
|
||||
component={motion.div}
|
||||
initial={{
|
||||
transform:
|
||||
animationDirection == "right"
|
||||
animationDirection === "right"
|
||||
? "translateX(60px)"
|
||||
: "translateX(-60px)",
|
||||
opacity: 0,
|
||||
@@ -143,7 +135,7 @@ const CarouselSlide = ({ item }) => {
|
||||
}}
|
||||
exit={{
|
||||
transform:
|
||||
animationDirection == "right"
|
||||
animationDirection === "right"
|
||||
? "translateX(-60px)"
|
||||
: "translateX(60px)",
|
||||
|
||||
@@ -166,21 +158,13 @@ const CarouselSlide = ({ item }) => {
|
||||
) : (
|
||||
<img
|
||||
className="hero-carousel-text-logo"
|
||||
src={
|
||||
api.basePath +
|
||||
"/Items/" +
|
||||
item.Id +
|
||||
"/Images/Logo?quality=90&tag=" +
|
||||
item.ImageTags.Logo
|
||||
}
|
||||
src={`${api.basePath}/Items/${item.Id}/Images/Logo?quality=90&tag=${item.ImageTags.Logo}`}
|
||||
style={{
|
||||
opacity: 0,
|
||||
transition: "opacity 0.2s",
|
||||
objectFit: "contain",
|
||||
}}
|
||||
onLoad={(e) =>
|
||||
(e.target.style.opacity = 1)
|
||||
}
|
||||
onLoad={(e) => (e.target.style.opacity = 1)}
|
||||
/>
|
||||
)}
|
||||
</Typography>
|
||||
@@ -188,7 +172,7 @@ const CarouselSlide = ({ item }) => {
|
||||
component={motion.div}
|
||||
initial={{
|
||||
transform:
|
||||
animationDirection == "right"
|
||||
animationDirection === "right"
|
||||
? "translateX(20px)"
|
||||
: "translateX(-20px)",
|
||||
opacity: 0,
|
||||
@@ -199,7 +183,7 @@ const CarouselSlide = ({ item }) => {
|
||||
}}
|
||||
exit={{
|
||||
transform:
|
||||
animationDirection == "right"
|
||||
animationDirection === "right"
|
||||
? "translateX(-20px)"
|
||||
: "translateX(20px)",
|
||||
|
||||
@@ -216,18 +200,10 @@ const CarouselSlide = ({ item }) => {
|
||||
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"}
|
||||
/>
|
||||
<Chip variant="filled" label={item.OfficialRating ?? "Not Rated"} />
|
||||
|
||||
{item.CommunityRating && (
|
||||
<div
|
||||
@@ -255,9 +231,7 @@ const CarouselSlide = ({ item }) => {
|
||||
}}
|
||||
variant="subtitle1"
|
||||
>
|
||||
{Math.round(
|
||||
item.CommunityRating * 10,
|
||||
) / 10}
|
||||
{Math.round(item.CommunityRating * 10) / 10}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
@@ -273,17 +247,12 @@ const CarouselSlide = ({ item }) => {
|
||||
<div
|
||||
className="material-symbols-rounded "
|
||||
style={{
|
||||
color:
|
||||
item.CriticRating > 50
|
||||
? green[400]
|
||||
: red[400],
|
||||
color: item.CriticRating > 50 ? green[400] : red[400],
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
}}
|
||||
>
|
||||
{item.CriticRating > 50
|
||||
? "thumb_up"
|
||||
: "thumb_down"}
|
||||
{item.CriticRating > 50 ? "thumb_up" : "thumb_down"}
|
||||
</div>
|
||||
<Typography
|
||||
style={{
|
||||
@@ -297,18 +266,12 @@ const CarouselSlide = ({ item }) => {
|
||||
)}
|
||||
|
||||
{!!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>
|
||||
)}
|
||||
@@ -317,7 +280,7 @@ const CarouselSlide = ({ item }) => {
|
||||
component={motion.div}
|
||||
initial={{
|
||||
transform:
|
||||
animationDirection == "right"
|
||||
animationDirection === "right"
|
||||
? "translateX(20px)"
|
||||
: "translateX(-20px)",
|
||||
opacity: 0,
|
||||
@@ -328,7 +291,7 @@ const CarouselSlide = ({ item }) => {
|
||||
}}
|
||||
exit={{
|
||||
transform:
|
||||
animationDirection == "right"
|
||||
animationDirection === "right"
|
||||
? "translateX(-20px)"
|
||||
: "translateX(20px)",
|
||||
|
||||
@@ -373,14 +336,12 @@ const CarouselSlide = ({ item }) => {
|
||||
}}
|
||||
itemUserData={item.UserData}
|
||||
audio={
|
||||
item.Type == BaseItemKind.MusicAlbum ||
|
||||
item.Type == BaseItemKind.Audio ||
|
||||
item.Type == BaseItemKind.AudioBook ||
|
||||
item.Type == BaseItemKind.Playlist
|
||||
}
|
||||
playlistItem={
|
||||
item.Type == BaseItemKind.Playlist
|
||||
item.Type === BaseItemKind.MusicAlbum ||
|
||||
item.Type === BaseItemKind.Audio ||
|
||||
item.Type === BaseItemKind.AudioBook ||
|
||||
item.Type === BaseItemKind.Playlist
|
||||
}
|
||||
playlistItem={item.Type === BaseItemKind.Playlist}
|
||||
playlistItemId={item.Id}
|
||||
/>
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/** @format */
|
||||
import React from "react";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
/** @format */
|
||||
import React from "react";
|
||||
import { MdiEmoticonDead } from "../icons/mdiEmoticonDead";
|
||||
|
||||
import slideBackground from "../../assets/errorbg.png";
|
||||
@@ -20,9 +20,7 @@ const CarouselSlideError = ({ itemName }) => {
|
||||
backgroundSize: "cover",
|
||||
}}
|
||||
>
|
||||
<MdiEmoticonDead
|
||||
sx={{ fontSize: "10em", opacity: "0.8" }}
|
||||
/>
|
||||
<MdiEmoticonDead sx={{ fontSize: "10em", opacity: "0.8" }} />
|
||||
<Typography mb={2} variant="h4" sx={{ opacity: "0.5" }}>
|
||||
Error caused by
|
||||
</Typography>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import React from "react";
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
import React from "react";
|
||||
|
||||
const Icon = (icon, extraProps) => {
|
||||
return (
|
||||
<SvgIcon {...extraProps}>
|
||||
<path d={icon}></path>
|
||||
<path d={icon} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
/** @format */
|
||||
|
||||
import { MdiChevronLeft } from "./mdiChevronLeft";
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
import { MdiChevronLeft } from "./mdiChevronLeft";
|
||||
|
||||
import { mdiAccount } from "@mdi/js";
|
||||
|
||||
export const MdiAccount = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiAccount}></path>
|
||||
<path d={mdiAccount} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiAccountMusic } from "@mdi/js";
|
||||
export const MdiAccountMusic = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiAccountMusic}></path>
|
||||
<path d={mdiAccountMusic} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiAccountTie } from "@mdi/js";
|
||||
export const MdiAccountTie = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiAccountTie}></path>
|
||||
<path d={mdiAccountTie} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiAlbum } from "@mdi/js";
|
||||
export const MdiAlbum = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiAlbum}></path>
|
||||
<path d={mdiAlbum} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiAlertDecagram } from "@mdi/js";
|
||||
export const MdiAlertDecagram = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiAlertDecagram}></path>
|
||||
<path d={mdiAlertDecagram} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiArrowLeft } from "@mdi/js";
|
||||
export const MdiArrowLeft = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiArrowLeft}></path>
|
||||
<path d={mdiArrowLeft} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiBackburger } from "@mdi/js";
|
||||
export const MdiBackburger = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiBackburger}></path>
|
||||
<path d={mdiBackburger} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiBook } from "@mdi/js";
|
||||
export const MdiBook = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiBook}></path>
|
||||
<path d={mdiBook} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiBookMultiple } from "@mdi/js";
|
||||
export const MdiBookMultiple = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiBookMultiple}></path>
|
||||
<path d={mdiBookMultiple} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiBookMusic } from "@mdi/js";
|
||||
export const MdiBookMusic = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiBookMusic}></path>
|
||||
<path d={mdiBookMusic} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiCheck } from "@mdi/js";
|
||||
export const MdiCheck = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiCheck}></path>
|
||||
<path d={mdiCheck} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiChevronDown } from "@mdi/js";
|
||||
export const MdiChevronDown = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiChevronDown}></path>
|
||||
<path d={mdiChevronDown} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiChevronLeft } from "@mdi/js";
|
||||
export const MdiChevronLeft = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiChevronLeft}></path>
|
||||
<path d={mdiChevronLeft} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiChevronRight } from "@mdi/js";
|
||||
export const MdiChevronRight = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiChevronRight}></path>
|
||||
<path d={mdiChevronRight} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiClockOutline } from "@mdi/js";
|
||||
export const MdiClockOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiClockOutline}></path>
|
||||
<path d={mdiClockOutline} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiClose } from "@mdi/js";
|
||||
export const MdiClose = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiClose}></path>
|
||||
<path d={mdiClose} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -1,15 +1,15 @@
|
||||
/** @format */
|
||||
|
||||
import { MdiChevronLeft } from "./mdiChevronLeft";
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
import { MdiChevronLeft } from "./mdiChevronLeft";
|
||||
|
||||
import { mdiCog } from "@mdi/js";
|
||||
|
||||
export const MdiCog = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiCog}></path>
|
||||
<path d={mdiCog} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiCogSync } from "@mdi/js";
|
||||
export const MdiCogSync = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiCogSync}></path>
|
||||
<path d={mdiCogSync} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiDelete } from "@mdi/js";
|
||||
export const MdiDelete = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiDelete}></path>
|
||||
<path d={mdiDelete} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiDramaMasks } from "@mdi/js";
|
||||
export const MdiDramaMasks = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiDramaMasks}></path>
|
||||
<path d={mdiDramaMasks} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiEmoticonCry } from "@mdi/js";
|
||||
export const MdiEmoticonCry = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiEmoticonCry}></path>
|
||||
<path d={mdiEmoticonCry} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiEmoticonCryOutline } from "@mdi/js";
|
||||
export const MdiEmoticonCryOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiEmoticonCryOutline}></path>
|
||||
<path d={mdiEmoticonCryOutline} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiEmoticonDead } from "@mdi/js";
|
||||
export const MdiEmoticonDead = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiEmoticonDead}></path>
|
||||
<path d={mdiEmoticonDead} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiEyeOffOutline } from "@mdi/js";
|
||||
export const MdiEyeOffOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiEyeOffOutline}></path>
|
||||
<path d={mdiEyeOffOutline} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiEyeOutline } from "@mdi/js";
|
||||
export const MdiEyeOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiEyeOutline}></path>
|
||||
<path d={mdiEyeOutline} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiFastForward } from "@mdi/js";
|
||||
export const MdiFastForward = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFastForward}></path>
|
||||
<path d={mdiFastForward} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiFilmstrip } from "@mdi/js";
|
||||
export const MdiFilmstrip = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFilmstrip}></path>
|
||||
<path d={mdiFilmstrip} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiFilmstripBoxMultiple } from "@mdi/js";
|
||||
export const MdiFilmstripBoxMultiple = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFilmstripBoxMultiple}></path>
|
||||
<path d={mdiFilmstripBoxMultiple} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiFilterOutline } from "@mdi/js";
|
||||
export const MdiFilterOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFilterOutline}></path>
|
||||
<path d={mdiFilterOutline} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiFolderMultiple } from "@mdi/js";
|
||||
export const MdiFolderMultiple = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFolderMultiple}></path>
|
||||
<path d={mdiFolderMultiple} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiFolderMusicOutline } from "@mdi/js";
|
||||
export const MdiFolderMusicOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFolderMusicOutline}></path>
|
||||
<path d={mdiFolderMusicOutline} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiFolderOutline } from "@mdi/js";
|
||||
export const MdiFolderOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFolderOutline}></path>
|
||||
<path d={mdiFolderOutline} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiFullscreen } from "@mdi/js";
|
||||
export const MdiFullscreen = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFullscreen}></path>
|
||||
<path d={mdiFullscreen} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiFullscreenExit } from "@mdi/js";
|
||||
export const MdiFullscreenExit = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFullscreenExit}></path>
|
||||
<path d={mdiFullscreenExit} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiHdr } from "@mdi/js";
|
||||
export const MdiHdr = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiHdr}></path>
|
||||
<path d={mdiHdr} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiHeart } from "@mdi/js";
|
||||
export const MdiHeart = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiHeart}></path>
|
||||
<path d={mdiHeart} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiHeartOutline } from "@mdi/js";
|
||||
export const MdiHeartOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiHeartOutline}></path>
|
||||
<path d={mdiHeartOutline} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiHomeVariant } from "@mdi/js";
|
||||
export const MdiHomeVariant = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiHomeVariant}></path>
|
||||
<path d={mdiHomeVariant} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiHomeVariantOutline } from "@mdi/js";
|
||||
export const MdiHomeVariantOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiHomeVariantOutline}></path>
|
||||
<path d={mdiHomeVariantOutline} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiImage } from "@mdi/js";
|
||||
export const MdiImage = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiImage}></path>
|
||||
<path d={mdiImage} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiImageMultiple } from "@mdi/js";
|
||||
export const MdiImageMultiple = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiImageMultiple}></path>
|
||||
<path d={mdiImageMultiple} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiInformation } from "@mdi/js";
|
||||
export const MdiInformation = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiInformation}></path>
|
||||
<path d={mdiInformation} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiLogoutVariant } from "@mdi/js";
|
||||
export const MdiLogoutVariant = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiLogoutVariant}></path>
|
||||
<path d={mdiLogoutVariant} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiMagnify } from "@mdi/js";
|
||||
export const MdiMagnify = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiMagnify}></path>
|
||||
<path d={mdiMagnify} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiMenu } from "@mdi/js";
|
||||
export const MdiMenu = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiMenu}></path>
|
||||
<path d={mdiMenu} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiMicrophone } from "@mdi/js";
|
||||
export const MdiMicrophone = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiMicrophone}></path>
|
||||
<path d={mdiMicrophone} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiMovieOutline } from "@mdi/js";
|
||||
export const MdiMovieOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiMovieOutline}></path>
|
||||
<path d={mdiMovieOutline} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiMultimedia } from "@mdi/js";
|
||||
export const MdiMultimedia = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiMultimedia}></path>
|
||||
<path d={mdiMultimedia} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiMusic } from "@mdi/js";
|
||||
export const MdiMusic = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiMusic}></path>
|
||||
<path d={mdiMusic} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiMusicBoxMultipleOutline } from "@mdi/js";
|
||||
export const MdiMusicBoxMultipleOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiMusicBoxMultipleOutline}></path>
|
||||
<path d={mdiMusicBoxMultipleOutline} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiPause } from "@mdi/js";
|
||||
export const MdiPause = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiPause}></path>
|
||||
<path d={mdiPause} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiPictureInPictureBottomRight } from "@mdi/js";
|
||||
export const MdiPictureInPictureBottomRight = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiPictureInPictureBottomRight}></path>
|
||||
<path d={mdiPictureInPictureBottomRight} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiPlay } from "@mdi/js";
|
||||
export const MdiPlay = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiPlay}></path>
|
||||
<path d={mdiPlay} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiPlayBoxMultiple } from "@mdi/js";
|
||||
export const MdiPlayBoxMultiple = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiPlayBoxMultiple}></path>
|
||||
<path d={mdiPlayBoxMultiple} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiPlayOutline } from "@mdi/js";
|
||||
export const MdiPlayOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiPlayOutline}></path>
|
||||
<path d={mdiPlayOutline} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiPlaySpeed } from "@mdi/js";
|
||||
export const MdiPlaySpeed = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiPlaySpeed}></path>
|
||||
<path d={mdiPlaySpeed} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiPlaylistMusicOutline } from "@mdi/js";
|
||||
export const MdiPlaylistMusicOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiPlaylistMusicOutline}></path>
|
||||
<path d={mdiPlaylistMusicOutline} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiRewind } from "@mdi/js";
|
||||
export const MdiRewind = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiRewind}></path>
|
||||
<path d={mdiRewind} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiSkipNext } from "@mdi/js";
|
||||
export const MdiSkipNext = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiSkipNext}></path>
|
||||
<path d={mdiSkipNext} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiSkipPrevious } from "@mdi/js";
|
||||
export const MdiSkipPrevious = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiSkipPrevious}></path>
|
||||
<path d={mdiSkipPrevious} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiSortAscending } from "@mdi/js";
|
||||
export const MdiSortAscending = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiSortAscending}></path>
|
||||
<path d={mdiSortAscending} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -6,7 +6,7 @@ import { mdiSortDescending } from "@mdi/js";
|
||||
export const MdiSortDescending = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiSortDescending}></path>
|
||||
<path d={mdiSortDescending} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiStar } from "@mdi/js";
|
||||
export const MdiStar = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiStar}></path>
|
||||
<path d={mdiStar} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiStarHalfFull } from "@mdi/js";
|
||||
export const MdiStarHalfFull = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiStarHalfFull}></path>
|
||||
<path d={mdiStarHalfFull} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiTelevision } from "@mdi/js";
|
||||
export const MdiTelevision = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiTelevision}></path>
|
||||
<path d={mdiTelevision} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiTelevisionClassic } from "@mdi/js";
|
||||
export const MdiTelevisionClassic = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiTelevisionClassic}></path>
|
||||
<path d={mdiTelevisionClassic} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiVolumeHigh } from "@mdi/js";
|
||||
export const MdiVolumeHigh = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiVolumeHigh}></path>
|
||||
<path d={mdiVolumeHigh} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiVolumeOff } from "@mdi/js";
|
||||
export const MdiVolumeOff = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiVolumeOff}></path>
|
||||
<path d={mdiVolumeOff} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { mdiYoutube } from "@mdi/js";
|
||||
export const MdiYoutube = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiYoutube}></path>
|
||||
<path d={mdiYoutube} />
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -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]
|
||||
]
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/** @format */
|
||||
import React, { useEffect, useState } from "react";
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { NavLink, useLocation } from "react-router-dom";
|
||||
|
||||
import { styled } from "@mui/material/styles";
|
||||
import Tooltip from "@mui/material/Tooltip";
|
||||
import MuiDrawer from "@mui/material/Drawer";
|
||||
import Tooltip from "@mui/material/Tooltip";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { styled } from "@mui/material/styles";
|
||||
|
||||
import { getTypeIcon } from "../../components/utils/iconsCollection.jsx";
|
||||
|
||||
import "./sidemenu.module.scss";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import "./sidemenu.module.scss";
|
||||
|
||||
import Icon from "../../assets/icon.svg";
|
||||
|
||||
@@ -46,16 +46,16 @@ export const SideMenu = () => {
|
||||
const user = useQuery({
|
||||
queryKey: ["user"],
|
||||
queryFn: async () => {
|
||||
let usr = await getUserApi(api).getCurrentUser();
|
||||
const usr = await getUserApi(api).getCurrentUser();
|
||||
return usr.data;
|
||||
},
|
||||
enabled: display,
|
||||
networkMode: "always",
|
||||
});
|
||||
let libraries = useQuery({
|
||||
const libraries = useQuery({
|
||||
queryKey: ["libraries"],
|
||||
queryFn: async () => {
|
||||
let libs = await getUserViewsApi(api).getUserViews({
|
||||
const libs = await getUserViewsApi(api).getUserViews({
|
||||
userId: user.data.Id,
|
||||
});
|
||||
return libs.data;
|
||||
@@ -93,14 +93,14 @@ export const SideMenu = () => {
|
||||
sx: {
|
||||
backgroundColor: "inherit",
|
||||
border: "none",
|
||||
width: `5em`,
|
||||
width: "5em",
|
||||
height: "100vh",
|
||||
zIndex: "1",
|
||||
},
|
||||
}}
|
||||
sx={{
|
||||
zIndex: 1,
|
||||
width: `5em`,
|
||||
width: "5em",
|
||||
background: "transparent !important ",
|
||||
}}
|
||||
>
|
||||
@@ -117,10 +117,7 @@ export const SideMenu = () => {
|
||||
<></>
|
||||
) : (
|
||||
<>
|
||||
<NavLink
|
||||
to="/home"
|
||||
className="sidemenu-item small"
|
||||
>
|
||||
<NavLink to="/home" className="sidemenu-item small">
|
||||
<div className="sidemenu-item-icon">
|
||||
{getTypeIcon("Home")}
|
||||
</div>
|
||||
@@ -152,16 +149,12 @@ export const SideMenu = () => {
|
||||
className="sidemenu-item"
|
||||
>
|
||||
<div className="sidemenu-item-icon">
|
||||
{getTypeIcon(
|
||||
lib.CollectionType,
|
||||
)}
|
||||
{getTypeIcon(lib.CollectionType)}
|
||||
</div>
|
||||
<Typography
|
||||
className="sidemenu-item-text"
|
||||
variant="caption"
|
||||
fontWeight={
|
||||
500
|
||||
}
|
||||
fontWeight={500}
|
||||
style={{
|
||||
width: "80%",
|
||||
}}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import Typography from "@mui/material/Typography";
|
||||
/** @format */
|
||||
import React from "react";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import "./musicTrack.module.scss";
|
||||
import { getRuntimeMusic } from "../../utils/date/time";
|
||||
import LikeButton from "../buttons/likeButton";
|
||||
import TextLink from "../textLink";
|
||||
import PlayButton from "../buttons/playButton";
|
||||
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
||||
import { MdiMusic } from "../icons/mdiMusic";
|
||||
import { useApi } from "../../utils/store/api";
|
||||
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
||||
import LikeButton from "../buttons/likeButton";
|
||||
import PlayButton from "../buttons/playButton";
|
||||
import { MdiMusic } from "../icons/mdiMusic";
|
||||
import TextLink from "../textLink";
|
||||
import "./musicTrack.module.scss";
|
||||
|
||||
/**
|
||||
* @typedef {Object} Props
|
||||
@@ -51,9 +51,7 @@ const MusicTrack = ({
|
||||
</div>
|
||||
<img
|
||||
src={api.getItemImageUrl(
|
||||
Object.keys(item.ImageTags).length == 0
|
||||
? item.AlbumId
|
||||
: item.Id,
|
||||
Object.keys(item.ImageTags).length === 0 ? item.AlbumId : item.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 70,
|
||||
@@ -88,9 +86,7 @@ const MusicTrack = ({
|
||||
variant="subtitle1"
|
||||
style={{
|
||||
color:
|
||||
item.Id == currentTrackItem.Id
|
||||
? "hsl(337, 96%, 56%)"
|
||||
: "white",
|
||||
item.Id === currentTrackItem.Id ? "hsl(337, 96%, 56%)" : "white",
|
||||
}}
|
||||
>
|
||||
{item.Name}
|
||||
@@ -113,7 +109,7 @@ const MusicTrack = ({
|
||||
>
|
||||
{artist.Name}
|
||||
</TextLink>
|
||||
{index != item.ArtistItems.length - 1 && (
|
||||
{index !== item.ArtistItems.length - 1 && (
|
||||
<span
|
||||
style={{
|
||||
whiteSpace: "pre",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/** @format */
|
||||
|
||||
import React from "react";
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { yellow } from "@mui/material/colors";
|
||||
import React from "react";
|
||||
|
||||
export const EmptyNotice = ({ extraMsg }) => {
|
||||
return (
|
||||
@@ -23,8 +23,7 @@ export const EmptyNotice = ({ extraMsg }) => {
|
||||
style={{
|
||||
fontSize: "10em",
|
||||
color: yellow[800],
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 400, "GRAD" 25, "opsz" 60',
|
||||
fontVariationSettings: '"FILL" 1, "wght" 400, "GRAD" 25, "opsz" 60',
|
||||
}}
|
||||
>
|
||||
sentiment_dissatisfied
|
||||
@@ -32,11 +31,7 @@ export const EmptyNotice = ({ extraMsg }) => {
|
||||
<Typography variant="h4" fontWeight={300}>
|
||||
No results found
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
fontWeight={300}
|
||||
style={{ opacity: 0.5 }}
|
||||
>
|
||||
<Typography variant="subtitle1" fontWeight={300} style={{ opacity: 0.5 }}>
|
||||
{extraMsg}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import Box from "@mui/material/Box";
|
||||
import Button from "@mui/material/Button";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { red } from "@mui/material/colors";
|
||||
/** @format */
|
||||
import React from "react";
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Button from "@mui/material/Button";
|
||||
import { red } from "@mui/material/colors";
|
||||
|
||||
export const ErrorNotice = ({ error, resetErrorBoundary }) => {
|
||||
console.error(error);
|
||||
@@ -25,8 +25,7 @@ export const ErrorNotice = ({ error, resetErrorBoundary }) => {
|
||||
fontSize: "10em",
|
||||
color: red[800],
|
||||
"--clr": "rgb(198 40 40 / 30%)",
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 400, "GRAD" 25, "opsz" 60',
|
||||
fontVariationSettings: '"FILL" 1, "wght" 400, "GRAD" 25, "opsz" 60',
|
||||
}}
|
||||
>
|
||||
error
|
||||
@@ -68,8 +67,8 @@ export const ErrorNotice = ({ error, resetErrorBoundary }) => {
|
||||
marginTop: "1em",
|
||||
}}
|
||||
>
|
||||
Note: You need to click on CLOSE button if you change the
|
||||
page in order to close this error message
|
||||
Note: You need to click on CLOSE button if you change the page in order
|
||||
to close this error message
|
||||
</Typography>
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -3,38 +3,38 @@ import React, { useEffect, useRef, useState } from "react";
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import Fab from "@mui/material/Fab";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import Slider from "@mui/material/Slider";
|
||||
import Popper from "@mui/material/Popper";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import Popper from "@mui/material/Popper";
|
||||
import Slider from "@mui/material/Slider";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import WaveSurfer from "wavesurfer.js";
|
||||
|
||||
import { useAudioPlayback } from "../../../utils/store/audioPlayback";
|
||||
|
||||
import "./audioPlayer.module.scss";
|
||||
import { MdiPlay } from "../../icons/mdiPlay";
|
||||
import { MdiPause } from "../../icons/mdiPause";
|
||||
import { AnimatePresence } from "framer-motion";
|
||||
import { MdiPause } from "../../icons/mdiPause";
|
||||
import { MdiPlay } from "../../icons/mdiPlay";
|
||||
import "./audioPlayer.module.scss";
|
||||
|
||||
import { getRuntimeMusic, secToTicks } from "../../../utils/date/time";
|
||||
import { MdiSkipNext } from "../../icons/mdiSkipNext";
|
||||
import { MdiSkipPrevious } from "../../icons/mdiSkipPrevious";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getRuntimeMusic, secToTicks } from "../../../utils/date/time";
|
||||
import { MdiClose } from "../../icons/mdiClose";
|
||||
import { MdiMusic } from "../../icons/mdiMusic";
|
||||
import { MdiSkipNext } from "../../icons/mdiSkipNext";
|
||||
import { MdiSkipPrevious } from "../../icons/mdiSkipPrevious";
|
||||
|
||||
import { theme } from "../../../theme";
|
||||
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||
import { theme } from "../../../theme";
|
||||
import { useApi } from "../../../utils/store/api";
|
||||
import { MdiPlaylistMusicOutline } from "../../icons/mdiPlaylistMusicOutline";
|
||||
import { MdiVolumeHigh } from "../../icons/mdiVolumeHigh";
|
||||
import { MdiVolumeOff } from "../../icons/mdiVolumeOff";
|
||||
import { MdiPlaylistMusicOutline } from "../../icons/mdiPlaylistMusicOutline";
|
||||
import MusicTrack from "../../musicTrack";
|
||||
import { useApi } from "../../../utils/store/api";
|
||||
|
||||
const AudioPlayer = () => {
|
||||
const [api] = useApi((state) => [state.api]);
|
||||
@@ -69,7 +69,7 @@ const AudioPlayer = () => {
|
||||
const user = useQuery({
|
||||
queryKey: ["user"],
|
||||
queryFn: async () => {
|
||||
let usr = await getUserApi(api).getCurrentUser();
|
||||
const usr = await getUserApi(api).getCurrentUser();
|
||||
return usr.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
@@ -134,16 +134,14 @@ const AudioPlayer = () => {
|
||||
});
|
||||
waveSurfer.on("finish", () => {
|
||||
setPlaying(false);
|
||||
if (currentTrack != tracks.length - 1) {
|
||||
if (currentTrack !== tracks.length - 1) {
|
||||
setCurrentTrack(currentTrack + 1);
|
||||
setAudioUrl(
|
||||
`${api.basePath}/Audio/${
|
||||
tracks[currentTrack + 1].Id
|
||||
}/universal?deviceId=${
|
||||
api.deviceInfo.id
|
||||
}&userId=${user.data.Id}&api_key=${
|
||||
api.accessToken
|
||||
}`,
|
||||
}/universal?deviceId=${api.deviceInfo.id}&userId=${
|
||||
user.data.Id
|
||||
}&api_key=${api.accessToken}`,
|
||||
);
|
||||
setAudioItem(tracks[currentTrack + 1]);
|
||||
setShowWaveform(false);
|
||||
@@ -212,7 +210,7 @@ const AudioPlayer = () => {
|
||||
transform: "translateY(100%)",
|
||||
}}
|
||||
style={{
|
||||
width: `100%`,
|
||||
width: "100%",
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.2,
|
||||
@@ -237,8 +235,7 @@ const AudioPlayer = () => {
|
||||
<img
|
||||
className="audio-player-image"
|
||||
src={api.getItemImageUrl(
|
||||
Object.keys(item.ImageTags)
|
||||
.length == 0
|
||||
Object.keys(item.ImageTags).length === 0
|
||||
? item.AlbumId
|
||||
: item.Id,
|
||||
"Primary",
|
||||
@@ -259,7 +256,7 @@ const AudioPlayer = () => {
|
||||
}}
|
||||
fontWeight={500}
|
||||
>
|
||||
{!!item.IndexNumber
|
||||
{item.IndexNumber
|
||||
? `${item.IndexNumber}. ${item.Name}`
|
||||
: item.Name}
|
||||
</Typography>
|
||||
@@ -271,10 +268,7 @@ const AudioPlayer = () => {
|
||||
noWrap
|
||||
fontWeight={400}
|
||||
>
|
||||
by{" "}
|
||||
{item.Artists.map(
|
||||
(artist) => artist,
|
||||
).join(",")}
|
||||
by {item.Artists.map((artist) => artist).join(",")}
|
||||
</Typography>
|
||||
</div>
|
||||
</motion.div>
|
||||
@@ -282,11 +276,9 @@ const AudioPlayer = () => {
|
||||
<div style={{ display: "flex", gap: "1em" }}>
|
||||
<IconButton
|
||||
onClick={handlePrevious}
|
||||
disabled={currentTrack == 0}
|
||||
disabled={currentTrack === 0}
|
||||
>
|
||||
<div className="material-symbols-rounded">
|
||||
skip_previous
|
||||
</div>
|
||||
<div className="material-symbols-rounded">skip_previous</div>
|
||||
</IconButton>
|
||||
<div
|
||||
style={{
|
||||
@@ -305,31 +297,22 @@ const AudioPlayer = () => {
|
||||
transition: "opacity 500ms",
|
||||
}}
|
||||
/>
|
||||
<Fab
|
||||
size="small"
|
||||
onClick={handlePlayPause}
|
||||
>
|
||||
<Fab size="small" onClick={handlePlayPause}>
|
||||
<div
|
||||
className="material-symbols-rounded"
|
||||
style={{
|
||||
fontSize: "2em",
|
||||
}}
|
||||
>
|
||||
{playing
|
||||
? "pause"
|
||||
: "play_arrow"}
|
||||
{playing ? "pause" : "play_arrow"}
|
||||
</div>
|
||||
</Fab>
|
||||
</div>
|
||||
<IconButton
|
||||
onClick={handleNext}
|
||||
disabled={
|
||||
tracks.length - 1 == currentTrack
|
||||
}
|
||||
disabled={tracks.length - 1 === currentTrack}
|
||||
>
|
||||
<div className="material-symbols-rounded">
|
||||
skip_next
|
||||
</div>
|
||||
<div className="material-symbols-rounded">skip_next</div>
|
||||
</IconButton>
|
||||
</div>
|
||||
<div
|
||||
@@ -348,15 +331,13 @@ const AudioPlayer = () => {
|
||||
opacity: 0.8,
|
||||
}}
|
||||
>
|
||||
{getRuntimeMusic(
|
||||
secToTicks(currentTime),
|
||||
)}
|
||||
{getRuntimeMusic(secToTicks(currentTime))}
|
||||
</Typography>
|
||||
<div
|
||||
id="waveform"
|
||||
ref={waveSurferContainerRef}
|
||||
data-show={Boolean(showWaveform)}
|
||||
></div>
|
||||
/>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
fontWeight={300}
|
||||
@@ -405,9 +386,7 @@ const AudioPlayer = () => {
|
||||
</Paper>
|
||||
</Popper>
|
||||
<IconButton onClick={handleOpenQueue} disabled>
|
||||
<div className="material-symbols-rounded">
|
||||
queue_music
|
||||
</div>
|
||||
<div className="material-symbols-rounded">queue_music</div>
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={(e) => {
|
||||
@@ -422,13 +401,9 @@ const AudioPlayer = () => {
|
||||
value={isMuted ? 0 : volume * 100}
|
||||
step={1}
|
||||
max={100}
|
||||
onChange={(e, newVal) =>
|
||||
setVolume(newVal / 100)
|
||||
}
|
||||
onChange={(e, newVal) => setVolume(newVal / 100)}
|
||||
valueLabelDisplay="auto"
|
||||
valueLabelFormat={(value) =>
|
||||
Math.floor(value)
|
||||
}
|
||||
valueLabelFormat={(value) => Math.floor(value)}
|
||||
size="small"
|
||||
sx={{
|
||||
mr: 1,
|
||||
@@ -442,16 +417,13 @@ const AudioPlayer = () => {
|
||||
padding: 1,
|
||||
borderRadius: "10px",
|
||||
border: "1px solid rgb(255 255 255 / 0.15)",
|
||||
boxShadow:
|
||||
"0 0 10px rgb(0 0 0 / 0.4) ",
|
||||
transform:
|
||||
"translatey(-120%) scale(0)",
|
||||
boxShadow: "0 0 10px rgb(0 0 0 / 0.4) ",
|
||||
transform: "translatey(-120%) scale(0)",
|
||||
"&:before": {
|
||||
display: "none",
|
||||
},
|
||||
"&.MuiSlider-valueLabelOpen": {
|
||||
transform:
|
||||
"translateY(-120%) scale(1)",
|
||||
transform: "translateY(-120%) scale(1)",
|
||||
},
|
||||
"& > *": {
|
||||
transform: "rotate(0deg)",
|
||||
@@ -460,9 +432,7 @@ const AudioPlayer = () => {
|
||||
}}
|
||||
/>
|
||||
<IconButton onClick={resetPlayer}>
|
||||
<div className="material-symbols-rounded">
|
||||
close
|
||||
</div>
|
||||
<div className="material-symbols-rounded">close</div>
|
||||
</IconButton>
|
||||
</div>
|
||||
</motion.div>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/** @format */
|
||||
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
import Box from "@mui/material/Box";
|
||||
import Card from "@mui/material/Card";
|
||||
import CardActionArea from "@mui/material/CardActionArea";
|
||||
import CardContent from "@mui/material/CardContent";
|
||||
import CardMedia from "@mui/material/CardMedia";
|
||||
import CardActionArea from "@mui/material/CardActionArea";
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Box from "@mui/material/Box";
|
||||
|
||||
export const CardsSkeleton = () => {
|
||||
return (
|
||||
@@ -21,7 +21,7 @@ export const CardsSkeleton = () => {
|
||||
<Skeleton width="35%" animation="wave" />
|
||||
</Typography>
|
||||
<Skeleton width="100%" variant="rounded" animation="wave">
|
||||
<div style={{ paddingTop: "20%" }}></div>
|
||||
<div style={{ paddingTop: "20%" }} />
|
||||
</Skeleton>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import Box from "@mui/material/Box";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
import Typography from "@mui/material/Typography";
|
||||
/** @format */
|
||||
import React from "react";
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { theme } from "../../theme";
|
||||
export const CarouselSkeleton = () => {
|
||||
return (
|
||||
@@ -26,7 +26,7 @@ export const CarouselSkeleton = () => {
|
||||
sx={{ fontSize: "8rem" }}
|
||||
width={300}
|
||||
animation="wave"
|
||||
></Skeleton>
|
||||
/>
|
||||
</Typography>
|
||||
<Typography variant="p" className="hero-carousel-text">
|
||||
<Skeleton
|
||||
@@ -34,7 +34,7 @@ export const CarouselSkeleton = () => {
|
||||
sx={{ fontSize: "3rem" }}
|
||||
width={400}
|
||||
animation="wave"
|
||||
></Skeleton>
|
||||
/>
|
||||
</Typography>
|
||||
<Typography variant="p" className="hero-carousel-text">
|
||||
<Skeleton
|
||||
@@ -42,7 +42,7 @@ export const CarouselSkeleton = () => {
|
||||
sx={{ fontSize: "3rem" }}
|
||||
width={400}
|
||||
animation="wave"
|
||||
></Skeleton>
|
||||
/>
|
||||
</Typography>
|
||||
</div>
|
||||
</Paper>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/** @format */
|
||||
|
||||
import Card from "@mui/material/Card";
|
||||
import CardMedia from "@mui/material/CardMedia";
|
||||
import CardContent from "@mui/material/CardContent";
|
||||
import Grid from "@mui/material/Unstable_Grid2";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import CardMedia from "@mui/material/CardMedia";
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Grid from "@mui/material/Unstable_Grid2";
|
||||
|
||||
import { borderRadiusDefault } from "../../palette.module.scss";
|
||||
|
||||
@@ -23,10 +23,7 @@ export const EpisodeCardsSkeleton = () => {
|
||||
{Array.from(new Array(4)).map((a, index) => {
|
||||
return (
|
||||
<Grid xs={1} sm={1} md={1} key={index}>
|
||||
<Card
|
||||
sx={{ background: "transparent" }}
|
||||
elevation={0}
|
||||
>
|
||||
<Card sx={{ background: "transparent" }} elevation={0}>
|
||||
<CardMedia>
|
||||
<Skeleton
|
||||
animation="wave"
|
||||
@@ -35,8 +32,7 @@ export const EpisodeCardsSkeleton = () => {
|
||||
aspectRatio: "1.777",
|
||||
height: "auto",
|
||||
m: 1,
|
||||
borderRadius:
|
||||
borderRadiusDefault,
|
||||
borderRadius: borderRadiusDefault,
|
||||
}}
|
||||
/>
|
||||
</CardMedia>
|
||||
@@ -48,26 +44,14 @@ export const EpisodeCardsSkeleton = () => {
|
||||
}}
|
||||
>
|
||||
<Typography variant="h6">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
animation="wave"
|
||||
/>
|
||||
<Skeleton variant="text" animation="wave" />
|
||||
</Typography>
|
||||
|
||||
<Typography variant="body2">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
animation="wave"
|
||||
/>
|
||||
<Skeleton
|
||||
variant="text"
|
||||
animation="wave"
|
||||
/>
|
||||
<Skeleton variant="text" animation="wave" />
|
||||
<Skeleton variant="text" animation="wave" />
|
||||
|
||||
<Skeleton
|
||||
variant="text"
|
||||
animation="wave"
|
||||
/>
|
||||
<Skeleton variant="text" animation="wave" />
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/** @format */
|
||||
|
||||
import Card from "@mui/material/Card";
|
||||
import CardMedia from "@mui/material/CardMedia";
|
||||
import CardContent from "@mui/material/CardContent";
|
||||
import Grid from "@mui/material/Unstable_Grid2";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
import CardMedia from "@mui/material/CardMedia";
|
||||
import Divider from "@mui/material/Divider";
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Grid from "@mui/material/Unstable_Grid2";
|
||||
|
||||
import { borderRadiusDefault } from "../../palette.module.scss";
|
||||
|
||||
@@ -30,11 +30,7 @@ export const SeasonSelectorSkeleton = () => {
|
||||
}}
|
||||
>
|
||||
<Typography variant="h3">
|
||||
<Skeleton
|
||||
width={320}
|
||||
variant="text"
|
||||
animation="wave"
|
||||
/>
|
||||
<Skeleton width={320} variant="text" animation="wave" />
|
||||
</Typography>
|
||||
<Skeleton animation="wave" height={64} width={128} />
|
||||
</div>
|
||||
@@ -52,14 +48,11 @@ export const SeasonSelectorSkeleton = () => {
|
||||
justifyContent: "space-between",
|
||||
paddingBottom: " 0.5em",
|
||||
}}
|
||||
></div>
|
||||
/>
|
||||
{Array.from(new Array(4)).map((a, index) => {
|
||||
return (
|
||||
<Grid xs={1} sm={1} md={1} key={index}>
|
||||
<Card
|
||||
sx={{ background: "transparent" }}
|
||||
elevation={0}
|
||||
>
|
||||
<Card sx={{ background: "transparent" }} elevation={0}>
|
||||
<CardMedia>
|
||||
<Skeleton
|
||||
animation="wave"
|
||||
@@ -68,8 +61,7 @@ export const SeasonSelectorSkeleton = () => {
|
||||
aspectRatio: "1.777",
|
||||
height: "auto",
|
||||
m: 1,
|
||||
borderRadius:
|
||||
borderRadiusDefault,
|
||||
borderRadius: borderRadiusDefault,
|
||||
}}
|
||||
/>
|
||||
</CardMedia>
|
||||
@@ -81,26 +73,14 @@ export const SeasonSelectorSkeleton = () => {
|
||||
}}
|
||||
>
|
||||
<Typography variant="h6">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
animation="wave"
|
||||
/>
|
||||
<Skeleton variant="text" animation="wave" />
|
||||
</Typography>
|
||||
|
||||
<Typography variant="body2">
|
||||
<Skeleton
|
||||
variant="text"
|
||||
animation="wave"
|
||||
/>
|
||||
<Skeleton
|
||||
variant="text"
|
||||
animation="wave"
|
||||
/>
|
||||
<Skeleton variant="text" animation="wave" />
|
||||
<Skeleton variant="text" animation="wave" />
|
||||
|
||||
<Skeleton
|
||||
variant="text"
|
||||
animation="wave"
|
||||
/>
|
||||
<Skeleton variant="text" animation="wave" />
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
/** @format */
|
||||
import React from "react";
|
||||
import { MdiAccount } from "../icons/mdiAccount";
|
||||
import { MdiAccountMusic } from "../icons/mdiAccountMusic";
|
||||
import { MdiAccountTie } from "../icons/mdiAccountTie";
|
||||
import { MdiAlbum } from "../icons/mdiAlbum";
|
||||
import { MdiBook } from "../icons/mdiBook";
|
||||
import { MdiBookMultiple } from "../icons/mdiBookMultiple";
|
||||
import { MdiBookMusic } from "../icons/mdiBookMusic";
|
||||
import { MdiDramaMasks } from "../icons/mdiDramaMasks";
|
||||
import { MdiFilmstrip } from "../icons/mdiFilmstrip";
|
||||
import { MdiFilmstripBoxMultiple } from "../icons/mdiFilmstripBoxMultiple";
|
||||
import { MdiFolderMultiple } from "../icons/mdiFolderMultiple";
|
||||
import { MdiFolderMusicOutline } from "../icons/mdiFolderMusicOutline";
|
||||
import { MdiFolderOutline } from "../icons/mdiFolderOutline";
|
||||
import { MdiImage } from "../icons/mdiImage";
|
||||
import { MdiImageMultiple } from "../icons/mdiImageMultiple";
|
||||
import { MdiMicrophone } from "../icons/mdiMicrophone";
|
||||
import { MdiMovieOutline } from "../icons/mdiMovieOutline";
|
||||
import { MdiMultimedia } from "../icons/mdiMultimedia";
|
||||
import { MdiMusic } from "../icons/mdiMusic";
|
||||
import { MdiMusicBoxMultipleOutline } from "../icons/mdiMusicBoxMultipleOutline";
|
||||
import { MdiPlayBoxMultiple } from "../icons/mdiPlayBoxMultiple";
|
||||
import { MdiPlaylistMusicOutline } from "../icons/mdiPlaylistMusicOutline";
|
||||
import { MdiTelevision } from "../icons/mdiTelevision";
|
||||
import { MdiFolderOutline } from "../icons/mdiFolderOutline";
|
||||
import { MdiFolderMusicOutline } from "../icons/mdiFolderMusicOutline";
|
||||
import { MdiYoutube } from "../icons/mdiYoutube";
|
||||
import { MdiMultimedia } from "../icons/mdiMultimedia";
|
||||
import { MdiBookMultiple } from "../icons/mdiBookMultiple";
|
||||
import { MdiImageMultiple } from "../icons/mdiImageMultiple";
|
||||
import { MdiTelevisionClassic } from "../icons/mdiTelevisionClassic";
|
||||
import { MdiFilmstrip } from "../icons/mdiFilmstrip";
|
||||
import { MdiMicrophone } from "../icons/mdiMicrophone";
|
||||
import { MdiImage } from "../icons/mdiImage";
|
||||
import { MdiBook } from "../icons/mdiBook";
|
||||
import { MdiFolderMultiple } from "../icons/mdiFolderMultiple";
|
||||
import { MdiBookMusic } from "../icons/mdiBookMusic";
|
||||
import { MdiPlayBoxMultiple } from "../icons/mdiPlayBoxMultiple";
|
||||
import { MdiAlbum } from "../icons/mdiAlbum";
|
||||
import { MdiAccountMusic } from "../icons/mdiAccountMusic";
|
||||
import { MdiDramaMasks } from "../icons/mdiDramaMasks";
|
||||
import { MdiMusic } from "../icons/mdiMusic";
|
||||
import { MdiAccountTie } from "../icons/mdiAccountTie";
|
||||
import { MdiAccount } from "../icons/mdiAccount";
|
||||
import { MdiFilmstripBoxMultiple } from "../icons/mdiFilmstripBoxMultiple";
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { MdiYoutube } from "../icons/mdiYoutube";
|
||||
|
||||
export const MediaCollectionTypeIconCollection = {
|
||||
universal: <MdiMultimedia />,
|
||||
@@ -66,20 +66,12 @@ export const getTypeIcon = (icon) => {
|
||||
case BaseItemKind.Audio:
|
||||
return <div className="material-symbols-rounded">mic</div>;
|
||||
case BaseItemKind.AudioBook:
|
||||
return (
|
||||
<div className="material-symbols-rounded">
|
||||
speech_to_text
|
||||
</div>
|
||||
);
|
||||
return <div className="material-symbols-rounded">speech_to_text</div>;
|
||||
case BaseItemKind.Book:
|
||||
return <div className="material-symbols-rounded">book</div>;
|
||||
case "boxsets":
|
||||
case BaseItemKind.BoxSet:
|
||||
return (
|
||||
<div className="material-symbols-rounded">
|
||||
video_library
|
||||
</div>
|
||||
);
|
||||
return <div className="material-symbols-rounded">video_library</div>;
|
||||
case "livetv":
|
||||
case BaseItemKind.TvProgram:
|
||||
case BaseItemKind.TvChannel:
|
||||
@@ -90,9 +82,7 @@ export const getTypeIcon = (icon) => {
|
||||
case BaseItemKind.ChannelFolderItem:
|
||||
case BaseItemKind.Channel:
|
||||
return (
|
||||
<div className="material-symbols-rounded">
|
||||
settings_input_antenna
|
||||
</div>
|
||||
<div className="material-symbols-rounded">settings_input_antenna</div>
|
||||
);
|
||||
case "tvshows":
|
||||
case BaseItemKind.Season:
|
||||
@@ -103,9 +93,7 @@ export const getTypeIcon = (icon) => {
|
||||
case BaseItemKind.Playlist:
|
||||
case BaseItemKind.PlaylistsFolder:
|
||||
case BaseItemKind.ManualPlaylistsFolder:
|
||||
return (
|
||||
<div className="material-symbols-rounded">queue_music</div>
|
||||
);
|
||||
return <div className="material-symbols-rounded">queue_music</div>;
|
||||
case "movies":
|
||||
case BaseItemKind.Movie:
|
||||
return <div className="material-symbols-rounded">movie</div>;
|
||||
@@ -115,14 +103,10 @@ export const getTypeIcon = (icon) => {
|
||||
return <div className="material-symbols-rounded">artist</div>;
|
||||
case BaseItemKind.Genre:
|
||||
case BaseItemKind.MusicGenre:
|
||||
return (
|
||||
<div className="material-symbols-rounded">domino_mask</div>
|
||||
);
|
||||
return <div className="material-symbols-rounded">domino_mask</div>;
|
||||
case "musicvideos":
|
||||
case BaseItemKind.MusicVideo:
|
||||
return (
|
||||
<div className="material-symbols-rounded">music_video</div>
|
||||
);
|
||||
return <div className="material-symbols-rounded">music_video</div>;
|
||||
case "User":
|
||||
case BaseItemKind.Person:
|
||||
return <div className="material-symbols-rounded">person</div>;
|
||||
@@ -130,40 +114,22 @@ export const getTypeIcon = (icon) => {
|
||||
return <div className="material-symbols-rounded">image</div>;
|
||||
case "photos":
|
||||
case BaseItemKind.PhotoAlbum:
|
||||
return (
|
||||
<div className="material-symbols-rounded">
|
||||
photo_library
|
||||
</div>
|
||||
);
|
||||
return <div className="material-symbols-rounded">photo_library</div>;
|
||||
case "universal":
|
||||
case BaseItemKind.Studio:
|
||||
return <div className="material-symbols-rounded">category</div>;
|
||||
case "trailers":
|
||||
case BaseItemKind.Trailer:
|
||||
return (
|
||||
<div className="material-symbols-rounded">
|
||||
smart_display
|
||||
</div>
|
||||
);
|
||||
return <div className="material-symbols-rounded">smart_display</div>;
|
||||
case BaseItemKind.Video:
|
||||
return <div className="material-symbols-rounded">theaters</div>;
|
||||
case "music":
|
||||
return (
|
||||
<div className="material-symbols-rounded">
|
||||
library_music
|
||||
</div>
|
||||
);
|
||||
return <div className="material-symbols-rounded">library_music</div>;
|
||||
case "books":
|
||||
return (
|
||||
<div className="material-symbols-rounded">
|
||||
library_books
|
||||
</div>
|
||||
);
|
||||
return <div className="material-symbols-rounded">library_books</div>;
|
||||
case "folders":
|
||||
return <div className="material-symbols-rounded">folder</div>;
|
||||
default:
|
||||
return (
|
||||
<div className="material-symbols-rounded">description</div>
|
||||
);
|
||||
return <div className="material-symbols-rounded">description</div>;
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user