feat(lint): use biome instead
This commit is contained in:
1 parent
dca2a31639
commit
8d68eb546d
129 files changed
+2352
-4366
No files matched your search
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:react/recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"react",
|
||||
"react-refresh"
|
||||
],
|
||||
"rules": {
|
||||
"no-mixed-spaces-and-tabs": "off",
|
||||
"react/prop-types": "off",
|
||||
"react-refresh/only-export-components": "warn"
|
||||
}
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"biomejs.biome"
|
||||
]
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.5.0/schema.json",
|
||||
"organizeImports": {
|
||||
"enabled": true
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true,
|
||||
"style": {
|
||||
"noNonNullAssertion": "off"
|
||||
}
|
||||
}
|
||||
},
|
||||
"files": {
|
||||
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js"],
|
||||
"ignoreUnknown": true
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -8,7 +8,7 @@
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"tauri": "tauri",
|
||||
"lint": "eslint"
|
||||
"lint": "biome check --apply src/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.11.3",
|
||||
@@ -50,6 +50,7 @@
|
||||
"zustand": "^4.4.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.5.0",
|
||||
"@tauri-apps/cli": "^1.5.9",
|
||||
"@types/uuid": "^9.0.7",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
|
||||
Generated
+91
@@ -118,6 +118,9 @@ dependencies:
|
||||
version: 4.4.7(@types/react@18.2.47)(react@18.2.0)
|
||||
|
||||
devDependencies:
|
||||
'@biomejs/biome':
|
||||
specifier: ^1.5.0
|
||||
version: 1.5.0
|
||||
'@tauri-apps/cli':
|
||||
specifier: ^1.5.9
|
||||
version: 1.5.9
|
||||
@@ -365,6 +368,94 @@ packages:
|
||||
'@babel/helper-validator-identifier': 7.22.20
|
||||
to-fast-properties: 2.0.0
|
||||
|
||||
/@biomejs/biome@1.5.0:
|
||||
resolution: {integrity: sha512-ln+o5jbs109qpeDoA+5n+vlAPai3DhlK0tHtZXzQvu4tswFgxNiJCeIXmlW1DYHziTmtBImV3Y0uhbm2iVSE3Q==}
|
||||
engines: {node: '>=14.*'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
optionalDependencies:
|
||||
'@biomejs/cli-darwin-arm64': 1.5.0
|
||||
'@biomejs/cli-darwin-x64': 1.5.0
|
||||
'@biomejs/cli-linux-arm64': 1.5.0
|
||||
'@biomejs/cli-linux-arm64-musl': 1.5.0
|
||||
'@biomejs/cli-linux-x64': 1.5.0
|
||||
'@biomejs/cli-linux-x64-musl': 1.5.0
|
||||
'@biomejs/cli-win32-arm64': 1.5.0
|
||||
'@biomejs/cli-win32-x64': 1.5.0
|
||||
dev: true
|
||||
|
||||
/@biomejs/cli-darwin-arm64@1.5.0:
|
||||
resolution: {integrity: sha512-3+D7axf04dpadGMOaqb2q+zyQnhWW0o/Imt7TJBWsoE0N3/+28Wht8g3UEHHcUL5FPuGIfsE+NcYntBaaAsEIg==}
|
||||
engines: {node: '>=14.*'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@biomejs/cli-darwin-x64@1.5.0:
|
||||
resolution: {integrity: sha512-8k5aaLWE/B6ZAXLC+z/Vwh9ogyiSaiRIfvg+F9foxuneHl2R/D/2Iy7pvd3Yoi4Kf6/MBdowekPVezGP4/Kbcw==}
|
||||
engines: {node: '>=14.*'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@biomejs/cli-linux-arm64-musl@1.5.0:
|
||||
resolution: {integrity: sha512-+1B3J8tWLTOvP3+00Cap+XhEXMvxwCHvVfuywUsB7Sqd66NWic3wKJuGbGcS3PuCWtGuIFsiQMNAGqiOXG4uBQ==}
|
||||
engines: {node: '>=14.*'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@biomejs/cli-linux-arm64@1.5.0:
|
||||
resolution: {integrity: sha512-RiecxG71E1jnqiJZ3FaikVBDRkk2ohIxBo0O4o68g87y6Hug//G0S83sj6Wqyn8DgKMCRWQg+XYMgk5CwLVowA==}
|
||||
engines: {node: '>=14.*'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@biomejs/cli-linux-x64-musl@1.5.0:
|
||||
resolution: {integrity: sha512-4S2rLluc0WT+XTbLTgcm9+5EEFwJmoGiUEzR6N0P2sIjZD8c5KNf9Ou46BP1Pdg5AgqV+IIClGPK1I80ApSh1Q==}
|
||||
engines: {node: '>=14.*'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@biomejs/cli-linux-x64@1.5.0:
|
||||
resolution: {integrity: sha512-TlTsG+ptSmnDTUsAAYsXyGOXMcFiF8SiwhPdj4YsNkJRgx9M2curEVcTVm66FINIPK6VJTUcEDahFlx3NPUOzA==}
|
||||
engines: {node: '>=14.*'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@biomejs/cli-win32-arm64@1.5.0:
|
||||
resolution: {integrity: sha512-sWOi1SR+YqJuXElBncGRnWBR7IN7ni6GQY4Zm/vTpP6nVA0dX5C301eQUW1N/VnFQb6fyrJTcBslDUKyemsN/g==}
|
||||
engines: {node: '>=14.*'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@biomejs/cli-win32-x64@1.5.0:
|
||||
resolution: {integrity: sha512-OoqgUXyzmRwX466bklOsWS7WdcvWtBuxF94DXATNe7bUiBa2tlW8QX7VVZvPnMKH57E5J619AkB3b5fhzyUhXA==}
|
||||
engines: {node: '>=14.*'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@emotion/babel-plugin@11.11.0:
|
||||
resolution: {integrity: sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==}
|
||||
dependencies:
|
||||
|
||||
+86
-177
@@ -5,105 +5,103 @@ import React, { useState, useEffect } from "react";
|
||||
import useKonami from "react-use-konami";
|
||||
|
||||
import { ThemeProvider } from "@mui/material/styles";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
import { SnackbarProvider } from "notistack";
|
||||
import {
|
||||
Routes,
|
||||
Route,
|
||||
useNavigate,
|
||||
useLocation,
|
||||
Navigate,
|
||||
Route,
|
||||
Routes,
|
||||
useLocation,
|
||||
useNavigate,
|
||||
} from "react-router-dom";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
|
||||
import { relaunch } from "@tauri-apps/api/process";
|
||||
import {
|
||||
UpdateManifest,
|
||||
checkUpdate,
|
||||
installUpdate,
|
||||
} from "@tauri-apps/api/updater";
|
||||
import { relaunch } from "@tauri-apps/api/process";
|
||||
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
|
||||
// Theming
|
||||
import CssBaseline from "@mui/material/CssBaseline";
|
||||
import { theme } from "./theme";
|
||||
import "./styles/global.scss";
|
||||
import { theme } from "./theme";
|
||||
|
||||
import LoadingButton from "@mui/lab/LoadingButton";
|
||||
import Button from "@mui/material/Button";
|
||||
// MUI
|
||||
import Dialog from "@mui/material/Dialog";
|
||||
import DialogActions from "@mui/material/DialogActions";
|
||||
import DialogContent from "@mui/material/DialogContent";
|
||||
import DialogContentText from "@mui/material/DialogContentText";
|
||||
import DialogTitle from "@mui/material/DialogTitle";
|
||||
import Button from "@mui/material/Button";
|
||||
import Slide from "@mui/material/Slide";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Slide from "@mui/material/Slide";
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import LoadingButton from "@mui/lab/LoadingButton";
|
||||
|
||||
import About from "./routes/about";
|
||||
import FavoritePage from "./routes/favorite/index.jsx";
|
||||
import Home from "./routes/home";
|
||||
import ItemDetail from "./routes/item";
|
||||
import LibraryView from "./routes/library";
|
||||
import { LoginWithImage, UserLogin, UserLoginManual } from "./routes/login";
|
||||
import SearchPage from "./routes/search";
|
||||
import SeriesTitlePage from "./routes/series/index.jsx";
|
||||
import Settings from "./routes/settings";
|
||||
// Routes
|
||||
import { ServerSetup } from "./routes/setup/server";
|
||||
import ServerList from "./routes/setup/serverList/index.jsx";
|
||||
import Home from "./routes/home";
|
||||
import { UserLogin, LoginWithImage, UserLoginManual } from "./routes/login";
|
||||
import LibraryView from "./routes/library";
|
||||
import ItemDetail from "./routes/item";
|
||||
import SeriesTitlePage from "./routes/series/index.jsx";
|
||||
import FavoritePage from "./routes/favorite/index.jsx";
|
||||
import Settings from "./routes/settings";
|
||||
import About from "./routes/about";
|
||||
import SearchPage from "./routes/search";
|
||||
|
||||
import { VideoPlayer } from "./routes/player/videoPlayer.jsx";
|
||||
import Markdown from "react-markdown";
|
||||
import { VideoPlayer } from "./routes/player/videoPlayer.jsx";
|
||||
|
||||
import { AppBar } from "./components/appBar/appBar.jsx";
|
||||
|
||||
import "@fontsource-variable/jetbrains-mono";
|
||||
import "@fontsource/noto-sans/100-italic.css";
|
||||
// Fonts
|
||||
import "@fontsource/noto-sans/100.css";
|
||||
import "@fontsource/noto-sans/100-italic.css";
|
||||
import "@fontsource/noto-sans/200.css";
|
||||
import "@fontsource/noto-sans/200-italic.css";
|
||||
import "@fontsource/noto-sans/300.css";
|
||||
import "@fontsource/noto-sans/200.css";
|
||||
import "@fontsource/noto-sans/300-italic.css";
|
||||
import "@fontsource/noto-sans/400.css";
|
||||
import "@fontsource/noto-sans/300.css";
|
||||
import "@fontsource/noto-sans/400-italic.css";
|
||||
import "@fontsource/noto-sans/500.css";
|
||||
import "@fontsource/noto-sans/400.css";
|
||||
import "@fontsource/noto-sans/500-italic.css";
|
||||
import "@fontsource/noto-sans/600.css";
|
||||
import "@fontsource/noto-sans/500.css";
|
||||
import "@fontsource/noto-sans/600-italic.css";
|
||||
import "@fontsource/noto-sans/700.css";
|
||||
import "@fontsource/noto-sans/600.css";
|
||||
import "@fontsource/noto-sans/700-italic.css";
|
||||
import "@fontsource/noto-sans/800.css";
|
||||
import "@fontsource/noto-sans/700.css";
|
||||
import "@fontsource/noto-sans/800-italic.css";
|
||||
import "@fontsource/noto-sans/900.css";
|
||||
import "@fontsource/noto-sans/800.css";
|
||||
import "@fontsource/noto-sans/900-italic.css";
|
||||
import "@fontsource/noto-sans/900.css";
|
||||
import "material-symbols";
|
||||
import "@fontsource-variable/jetbrains-mono";
|
||||
|
||||
import AudioPlayer from "./components/playback/audioPlayer/index.jsx";
|
||||
import MusicAlbumTitlePage from "./routes/album/index.jsx";
|
||||
import ArtistTitlePage from "./routes/artist/index.jsx";
|
||||
import BoxSetTitlePage from "./routes/boxset/index.jsx";
|
||||
import EpisodeTitlePage from "./routes/episode/index.jsx";
|
||||
import PersonTitlePage from "./routes/person/index.jsx";
|
||||
import PlaylistTitlePage from "./routes/playlist/index.jsx";
|
||||
import { useAudioPlayback } from "./utils/store/audioPlayback.js";
|
||||
import { useBackdropStore } from "./utils/store/backdrop.js";
|
||||
import { usePlaybackDataLoadStore } from "./utils/store/playback.js";
|
||||
import BoxSetTitlePage from "./routes/boxset/index.jsx";
|
||||
import PersonTitlePage from "./routes/person/index.jsx";
|
||||
import MusicAlbumTitlePage from "./routes/album/index.jsx";
|
||||
import AudioPlayer from "./components/playback/audioPlayer/index.jsx";
|
||||
import { useAudioPlayback } from "./utils/store/audioPlayback.js";
|
||||
import ArtistTitlePage from "./routes/artist/index.jsx";
|
||||
import EpisodeTitlePage from "./routes/episode/index.jsx";
|
||||
import PlaylistTitlePage from "./routes/playlist/index.jsx";
|
||||
|
||||
import { useApi } from "./utils/store/api";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { CircularProgress } from "@mui/material";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||
import { useCentralStore } from "./utils/store/central.js";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { ErrorBoundary } from "react-error-boundary";
|
||||
import { ErrorNotice } from "./components/notices/errorNotice/errorNotice.jsx";
|
||||
|
||||
|
||||
import { useApi } from "./utils/store/api";
|
||||
import { useCentralStore } from "./utils/store/central.js";
|
||||
|
||||
const LoginRoute = () => {
|
||||
const navigate = useNavigate();
|
||||
@@ -183,8 +181,8 @@ function App() {
|
||||
state.isPending,
|
||||
]);
|
||||
|
||||
const handleRelaunch = async (_event: any, reason?: string) => {
|
||||
if (reason && reason == "backdropClick") {
|
||||
const handleRelaunch = async (_event: unknown, reason?: string) => {
|
||||
if (reason && reason === "backdropClick") {
|
||||
return;
|
||||
}
|
||||
await relaunch();
|
||||
@@ -192,6 +190,7 @@ function App() {
|
||||
|
||||
const location = useLocation();
|
||||
|
||||
// biome-ignore lint/correctness/useExhaustiveDependencies: this dependency is required
|
||||
useEffect(() => {
|
||||
window.scrollTo(0, 0);
|
||||
}, [location.key]);
|
||||
@@ -228,7 +227,9 @@ function App() {
|
||||
|
||||
const [updateDialog, setUpdateDialog] = useState(false);
|
||||
|
||||
const [updateInfo, setUpdateInfo] = useState<UpdateManifest | undefined>(undefined);
|
||||
const [updateInfo, setUpdateInfo] = useState<UpdateManifest | undefined>(
|
||||
undefined,
|
||||
);
|
||||
|
||||
const [updateDialogButton, setUpdateDialogButton] = useState(false);
|
||||
|
||||
@@ -241,9 +242,7 @@ function App() {
|
||||
setUpdateInfo(manifest);
|
||||
setUpdateDialog(true);
|
||||
// You could show a dialog asking the user if they want to install the update here.
|
||||
console.log(
|
||||
`Update found : ${manifest?.version}, ${manifest?.date}`,
|
||||
);
|
||||
console.log(`Update found : ${manifest?.version}, ${manifest?.date}`);
|
||||
|
||||
// Install the update. This will also restart the app on Windows!
|
||||
// await installUpdate();
|
||||
@@ -275,7 +274,8 @@ function App() {
|
||||
<CircularProgress size={72} thickness={1.4} />
|
||||
</div>
|
||||
);
|
||||
} else if (initialRoute) {
|
||||
}
|
||||
if (initialRoute) {
|
||||
return (
|
||||
<SnackbarProvider maxSnack={5}>
|
||||
<ThemeProvider theme={theme}>
|
||||
@@ -298,7 +298,7 @@ function App() {
|
||||
// maxWidth="md"
|
||||
fullWidth
|
||||
>
|
||||
{updateInfo != undefined && (
|
||||
{updateInfo !== undefined && (
|
||||
<>
|
||||
<DialogTitle>
|
||||
Update Available!
|
||||
@@ -312,9 +312,7 @@ function App() {
|
||||
</DialogTitle>
|
||||
<DialogContent dividers>
|
||||
<DialogContentText>
|
||||
<Markdown>
|
||||
{updateInfo.body}
|
||||
</Markdown>
|
||||
<Markdown>{updateInfo.body}</Markdown>
|
||||
</DialogContentText>
|
||||
</DialogContent>
|
||||
<DialogActions
|
||||
@@ -322,9 +320,7 @@ function App() {
|
||||
padding: "1em",
|
||||
}}
|
||||
>
|
||||
<IconButton
|
||||
disabled={updateDialogButton}
|
||||
>
|
||||
<IconButton disabled={updateDialogButton}>
|
||||
<SvgIcon>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
@@ -333,6 +329,7 @@ function App() {
|
||||
fill="currentColor"
|
||||
viewBox="0 0 16 16"
|
||||
>
|
||||
<title>Update</title>
|
||||
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8" />
|
||||
</svg>
|
||||
</SvgIcon>
|
||||
@@ -342,9 +339,7 @@ function App() {
|
||||
color="error"
|
||||
variant="outlined"
|
||||
disabled={updateDialogButton}
|
||||
onClick={() =>
|
||||
setUpdateDialog(false)
|
||||
}
|
||||
onClick={() => setUpdateDialog(false)}
|
||||
>
|
||||
close
|
||||
</Button>
|
||||
@@ -355,9 +350,7 @@ function App() {
|
||||
loading={updateDialogButton}
|
||||
loadingIndicator="Updating..."
|
||||
onClick={async () => {
|
||||
setUpdateDialogButton(
|
||||
true,
|
||||
);
|
||||
setUpdateDialogButton(true);
|
||||
await installUpdate();
|
||||
enqueueSnackbar(
|
||||
"Update has been installed! You need to relaunch JellyPlayer.",
|
||||
@@ -387,18 +380,14 @@ function App() {
|
||||
src="https://www.youtube.com/embed/dQw4w9WgXcQ?autoplay=1&disablekb=1"
|
||||
title="EasterEgg"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
></iframe>
|
||||
/>
|
||||
</Dialog>
|
||||
<Slide
|
||||
direction="up"
|
||||
in={easterEgg}
|
||||
mountOnEnter
|
||||
unmountOnExit
|
||||
>
|
||||
<Slide direction="up" in={easterEgg} mountOnEnter unmountOnExit>
|
||||
<img
|
||||
src="https://i.gifer.com/PYh.gif"
|
||||
width={320}
|
||||
height={320}
|
||||
alt="nyan cat gif"
|
||||
style={{
|
||||
zIndex: "99999999",
|
||||
position: "fixed",
|
||||
@@ -445,9 +434,7 @@ function App() {
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
<div
|
||||
className={
|
||||
audioPlayerVisible ? "audio-playing" : ""
|
||||
}
|
||||
className={audioPlayerVisible ? "audio-playing" : ""}
|
||||
style={{
|
||||
display: "flex",
|
||||
width: "100vw",
|
||||
@@ -464,12 +451,7 @@ function App() {
|
||||
// key={location.key}
|
||||
element={<AnimationWrapper />}
|
||||
> */}
|
||||
<Route
|
||||
path="/"
|
||||
element={
|
||||
<Navigate to={initialRoute} />
|
||||
}
|
||||
></Route>
|
||||
<Route path="/" element={<Navigate to={initialRoute} />} />
|
||||
<Route
|
||||
path="/error"
|
||||
element={
|
||||
@@ -481,126 +463,53 @@ function App() {
|
||||
maxWidth="md"
|
||||
>
|
||||
<DialogTitle id="alert-dialog-text">
|
||||
Unable to reach
|
||||
server
|
||||
Unable to reach server
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<DialogContentText id="alert-dialog-desc">
|
||||
Unable to
|
||||
connect to the
|
||||
jellyfin
|
||||
server.
|
||||
Unable to connect to the jellyfin server.
|
||||
</DialogContentText>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button
|
||||
onClick={() =>
|
||||
navigate(
|
||||
"/servers/list",
|
||||
)
|
||||
}
|
||||
>
|
||||
<Button onClick={() => navigate("/servers/list")}>
|
||||
Change Server
|
||||
</Button>
|
||||
<Button
|
||||
variant="outlined"
|
||||
onClick={
|
||||
handleRelaunch
|
||||
}
|
||||
>
|
||||
Restart
|
||||
JellyPlayer
|
||||
<Button variant="outlined" onClick={handleRelaunch}>
|
||||
Restart JellyPlayer
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/login/index"
|
||||
element={<LoginRoute />}
|
||||
/>
|
||||
<Route path="/login/index" element={<LoginRoute />} />
|
||||
|
||||
<Route
|
||||
path="/home"
|
||||
element={<Home />}
|
||||
/>
|
||||
<Route
|
||||
path="/setup/server"
|
||||
element={<ServerSetup />}
|
||||
/>
|
||||
<Route
|
||||
path="/servers/list"
|
||||
element={<ServerList />}
|
||||
/>
|
||||
<Route path="/home" element={<Home />} />
|
||||
<Route path="/setup/server" element={<ServerSetup />} />
|
||||
<Route path="/servers/list" element={<ServerList />} />
|
||||
<Route
|
||||
path="/login/withImg/:userName/:userId/"
|
||||
element={<LoginWithImage />}
|
||||
/>
|
||||
<Route
|
||||
path="/login/users"
|
||||
element={<UserLogin />}
|
||||
/>
|
||||
<Route
|
||||
path="/login/manual"
|
||||
element={<UserLoginManual />}
|
||||
/>
|
||||
<Route
|
||||
path="/library/:id"
|
||||
element={<LibraryView />}
|
||||
/>
|
||||
<Route
|
||||
path="/item/:id"
|
||||
element={<ItemDetail />}
|
||||
/>
|
||||
<Route path="/login/users" element={<UserLogin />} />
|
||||
<Route path="/login/manual" element={<UserLoginManual />} />
|
||||
<Route path="/library/:id" element={<LibraryView />} />
|
||||
<Route path="/item/:id" element={<ItemDetail />} />
|
||||
<Route
|
||||
path="/musicalbum/:id"
|
||||
element={<MusicAlbumTitlePage />}
|
||||
errorElement={<div>Error</div>}
|
||||
/>
|
||||
<Route
|
||||
path="/artist/:id"
|
||||
element={<ArtistTitlePage />}
|
||||
/>
|
||||
<Route
|
||||
path="/boxset/:id"
|
||||
element={<BoxSetTitlePage />}
|
||||
/>
|
||||
<Route
|
||||
path="/episode/:id"
|
||||
element={<EpisodeTitlePage />}
|
||||
/>
|
||||
<Route
|
||||
path="/person/:id"
|
||||
element={<PersonTitlePage />}
|
||||
/>
|
||||
<Route
|
||||
path="/playlist/:id"
|
||||
element={<PlaylistTitlePage />}
|
||||
/>
|
||||
<Route
|
||||
path="/series/:id"
|
||||
element={<SeriesTitlePage />}
|
||||
/>
|
||||
<Route
|
||||
path="/search"
|
||||
element={<SearchPage />}
|
||||
/>
|
||||
<Route
|
||||
path="/favorite"
|
||||
element={<FavoritePage />}
|
||||
/>
|
||||
<Route
|
||||
path="/settings"
|
||||
element={<Settings />}
|
||||
/>
|
||||
<Route
|
||||
path="/about"
|
||||
element={<About />}
|
||||
/>
|
||||
<Route
|
||||
path="/player"
|
||||
element={<VideoPlayer />}
|
||||
/>
|
||||
<Route path="/artist/:id" element={<ArtistTitlePage />} />
|
||||
<Route path="/boxset/:id" element={<BoxSetTitlePage />} />
|
||||
<Route path="/episode/:id" element={<EpisodeTitlePage />} />
|
||||
<Route path="/person/:id" element={<PersonTitlePage />} />
|
||||
<Route path="/playlist/:id" element={<PlaylistTitlePage />} />
|
||||
<Route path="/series/:id" element={<SeriesTitlePage />} />
|
||||
<Route path="/search" element={<SearchPage />} />
|
||||
<Route path="/favorite" element={<FavoritePage />} />
|
||||
<Route path="/settings" element={<Settings />} />
|
||||
<Route path="/about" element={<About />} />
|
||||
<Route path="/player" element={<VideoPlayer />} />
|
||||
{/* </Route> */}
|
||||
</Routes>
|
||||
</ErrorBoundary>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Loaded 100 of 129 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user