18 files changed
+224
-372
No files matched your search
+115
-7
@@ -26,10 +26,9 @@ import MenuItem from "@mui/material/MenuItem";
|
||||
import Link from "@mui/material/Link";
|
||||
import { green, pink, yellow } from "@mui/material/colors";
|
||||
|
||||
import { motion, useScroll } from "framer-motion";
|
||||
import { motion } from "framer-motion";
|
||||
|
||||
import { Blurhash } from "react-blurhash";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { useParams, useNavigate, Link as RouterLink } from "react-router-dom";
|
||||
|
||||
import {
|
||||
@@ -44,7 +43,6 @@ import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||
import { getVideosApi } from "@jellyfin/sdk/lib/utils/api/videos-api";
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
@@ -99,7 +97,6 @@ function a11yProps(index) {
|
||||
|
||||
const ItemDetail = () => {
|
||||
const { id } = useParams();
|
||||
const dispatch = useDispatch();
|
||||
const navigate = useNavigate();
|
||||
const [primageImageLoaded, setPrimaryImageLoaded] = useState(false);
|
||||
const [backdropImageLoaded, setBackdropImageLoaded] = useState(false);
|
||||
@@ -318,6 +315,7 @@ const ItemDetail = () => {
|
||||
return result.data;
|
||||
},
|
||||
enabled: item.isSuccess && item.data.Type == BaseItemKind.MusicArtist,
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const artistSongs = useQuery({
|
||||
@@ -335,6 +333,25 @@ const ItemDetail = () => {
|
||||
return result.data;
|
||||
},
|
||||
enabled: item.isSuccess && item.data.Type == BaseItemKind.MusicArtist,
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const artistAppearances = useQuery({
|
||||
queryKey: ["item", id, "artist", "appearences"],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(window.api).getItems({
|
||||
contributingArtistIds: [item.data.Id],
|
||||
excludeItemIds: [item.data.Id],
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
sortOrder: [SortOrder.Descending],
|
||||
recursive: true,
|
||||
includeItemTypes: [BaseItemKind.MusicAlbum],
|
||||
userId: user.data.Id,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: item.isSuccess && item.data.Type == BaseItemKind.MusicArtist,
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const handleMarkPlayedOrunPlayed = async () => {
|
||||
@@ -416,9 +433,29 @@ const ItemDetail = () => {
|
||||
personEpisodes.isLoading,
|
||||
]);
|
||||
|
||||
const artistTabs = ["Discography", "Songs"];
|
||||
const artistTabs = ["Discography", "Songs", "Appearances"];
|
||||
const [activeArtistTab, setActiveArtistTab] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
artistDiscography.isSuccess &&
|
||||
artistSongs.isSuccess &&
|
||||
artistAppearances.isSuccess
|
||||
) {
|
||||
if (artistDiscography.data.TotalRecordCount != 0) {
|
||||
setActivePersonTab(0);
|
||||
} else if (artistSongs.data.TotalRecordCount != 0) {
|
||||
setActivePersonTab(1);
|
||||
} else if (artistAppearances.data.TotalRecordCount != 0) {
|
||||
setActivePersonTab(2);
|
||||
}
|
||||
}
|
||||
}, [
|
||||
artistDiscography.isLoading,
|
||||
artistSongs.isLoading,
|
||||
artistAppearances.isLoading,
|
||||
]);
|
||||
|
||||
const [videoTracks, setVideoTracks] = useState([]);
|
||||
const [audioTracks, setAudioTracks] = useState([]);
|
||||
const [subtitleTracks, setSubtitleTracks] = useState([]);
|
||||
@@ -2393,7 +2430,6 @@ const ItemDetail = () => {
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.35,
|
||||
ease: "easeInOut",
|
||||
delay:
|
||||
mindex *
|
||||
0.05,
|
||||
@@ -2468,7 +2504,8 @@ const ItemDetail = () => {
|
||||
|
||||
{item.data.Type == BaseItemKind.MusicArtist &&
|
||||
artistDiscography.isSuccess &&
|
||||
artistSongs.isSuccess && (
|
||||
artistSongs.isSuccess &&
|
||||
artistAppearances.isSuccess && (
|
||||
<Box>
|
||||
<Tabs
|
||||
value={activeArtistTab}
|
||||
@@ -2490,6 +2527,28 @@ const ItemDetail = () => {
|
||||
index,
|
||||
)}
|
||||
key={index}
|
||||
disabled={
|
||||
(pitem ==
|
||||
"Discography" &&
|
||||
artistDiscography
|
||||
.data
|
||||
.TotalRecordCount ==
|
||||
0) ||
|
||||
(pitem ==
|
||||
"Songs" &&
|
||||
artistSongs
|
||||
.data
|
||||
.TotalRecordCount ==
|
||||
0) ||
|
||||
(pitem ==
|
||||
"Appearances" &&
|
||||
artistAppearances
|
||||
.data
|
||||
.TotalRecordCount ==
|
||||
0)
|
||||
? true
|
||||
: false
|
||||
}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@@ -2682,6 +2741,55 @@ const ItemDetail = () => {
|
||||
</Table>
|
||||
</TableContainer>
|
||||
)}
|
||||
{pitem ==
|
||||
"Appearances" && (
|
||||
<TableContainer>
|
||||
<Table>
|
||||
<TableBody>
|
||||
{artistAppearances.data.Items.map(
|
||||
(
|
||||
musicItem,
|
||||
mindex,
|
||||
) => {
|
||||
return (
|
||||
<ArtistAlbum
|
||||
key={
|
||||
musicItem.Id
|
||||
}
|
||||
user={
|
||||
user.data
|
||||
}
|
||||
album={
|
||||
musicItem
|
||||
}
|
||||
boxProps={{
|
||||
component:
|
||||
motion.div,
|
||||
initial: {
|
||||
y: 30,
|
||||
opacity: 0,
|
||||
},
|
||||
animate: {
|
||||
y: 0,
|
||||
opacity: 1,
|
||||
},
|
||||
transition:
|
||||
{
|
||||
duration: 0.35,
|
||||
ease: "easeInOut",
|
||||
delay:
|
||||
mindex *
|
||||
0.05,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
},
|
||||
)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
)}
|
||||
</TabPanel>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -30,7 +30,6 @@ import TableRow from "@mui/material/TableRow";
|
||||
import TableCell from "@mui/material/TableCell";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Pagination from "@mui/material/Pagination";
|
||||
import ButtonBase from "@mui/material/ButtonBase";
|
||||
|
||||
import { theme } from "../../theme";
|
||||
|
||||
@@ -386,7 +385,8 @@ const LibraryView = () => {
|
||||
queryFn: () => fetchLibItems(id),
|
||||
enabled: currentLib.isSuccess,
|
||||
networkMode: "always",
|
||||
keepPreviousData: true,
|
||||
keepPreviousData: false,
|
||||
cacheTime: 0,
|
||||
});
|
||||
|
||||
const handleCurrentViewType = (e) => {
|
||||
@@ -1025,8 +1025,8 @@ const LibraryView = () => {
|
||||
{items.data.Items.map((item, index) => {
|
||||
return (
|
||||
<TableRow
|
||||
component={motion.row}
|
||||
key={index}
|
||||
component={motion.div}
|
||||
key={item.Id}
|
||||
sx={{
|
||||
"& td,& th": {
|
||||
borderBottom:
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
/** @format */
|
||||
|
||||
import { useState, useEffect, useMemo } from "react";
|
||||
import { useState } from "react";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useNavigate, useParams, Link } from "react-router-dom";
|
||||
import { EventEmitter as event } from "../../eventEmitter.js";
|
||||
|
||||
import { useDispatch } from "react-redux";
|
||||
import { showSidemenu } from "../../utils/slice/sidemenu.js";
|
||||
|
||||
import { getServer } from "../../utils/storage/servers.js";
|
||||
import { saveUser } from "../../utils/storage/user.js";
|
||||
|
||||
// import Icon from "mdi-material-ui";
|
||||
@@ -26,8 +22,6 @@ import InputLabel from "@mui/material/InputLabel";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import LoadingButton from "@mui/lab/LoadingButton";
|
||||
import Button from "@mui/material/Button";
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import { useSnackbar } from "notistack";
|
||||
import FormGroup from "@mui/material/FormGroup";
|
||||
@@ -35,21 +29,16 @@ import FormControlLabel from "@mui/material/FormControlLabel";
|
||||
import Checkbox from "@mui/material/Checkbox";
|
||||
|
||||
import { AvatarImage } from "../../components/avatar/avatar.jsx";
|
||||
import { CardScroller } from "../../components/cardScroller/cardScroller.jsx";
|
||||
import { Card } from "../../components/card/card.jsx";
|
||||
import { AppBarBackOnly } from "../../components/appBar/backOnly.jsx";
|
||||
|
||||
// import { jellyfin } from "../../jellyfin";
|
||||
// import getSystemApi from "@jellyfin/sdk";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { getBrandingApi } from "@jellyfin/sdk/lib/utils/api/branding-api";
|
||||
|
||||
import "./login.module.scss";
|
||||
import { CardsSkeleton } from "../../components/skeleton/cards.jsx";
|
||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice.jsx";
|
||||
|
||||
export const LoginWithImage = () => {
|
||||
const dispatch = useDispatch();
|
||||
const { userName, userId } = useParams();
|
||||
|
||||
const [password, setPassword] = useState({
|
||||
@@ -99,7 +88,6 @@ export const LoginWithImage = () => {
|
||||
}
|
||||
event.emit("set-api-accessToken", window.api.basePath);
|
||||
setLoading(false);
|
||||
dispatch(showSidemenu());
|
||||
navigate(`/home`);
|
||||
};
|
||||
|
||||
@@ -159,7 +147,7 @@ export const LoginWithImage = () => {
|
||||
{userName}
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item minWidth="100%">
|
||||
<Grid minWidth="100%">
|
||||
<FormGroup>
|
||||
<FormControl variant="outlined" fullWidth>
|
||||
<InputLabel htmlFor="user-password">
|
||||
@@ -208,7 +196,7 @@ export const LoginWithImage = () => {
|
||||
/>
|
||||
</FormGroup>
|
||||
</Grid>
|
||||
<Grid item minWidth="100%">
|
||||
<Grid minWidth="100%">
|
||||
<LoadingButton
|
||||
variant="contained"
|
||||
endIcon={<MdiChevronRight />}
|
||||
@@ -241,9 +229,7 @@ export const UserLogin = () => {
|
||||
queryKey: ["login", "users"],
|
||||
queryFn: async () => {
|
||||
const users = await getUserApi(window.api).getPublicUsers();
|
||||
console.log(users.data);
|
||||
return users.data;
|
||||
// return {};
|
||||
},
|
||||
networkMode: "always",
|
||||
});
|
||||
@@ -345,7 +331,6 @@ export const UserLoginManual = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [rememberMe, setRememberMe] = useState(true);
|
||||
|
||||
const dispatch = useDispatch();
|
||||
const navigate = useNavigate();
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
@@ -439,14 +424,15 @@ export const UserLoginManual = () => {
|
||||
sx={{
|
||||
opacity: server.isLoading ? 0 : 1,
|
||||
transition: "opacity 200ms",
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<Grid item xl={5} md={6} sx={{ marginBottom: "1em" }}>
|
||||
<Grid sx={{ marginBottom: "1em" }}>
|
||||
<Typography variant="h3" color="textPrimary">
|
||||
Login
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid sx={{ width: "100%" }} item xl={5} md={6}>
|
||||
<Grid sx={{ width: "100%" }}>
|
||||
<FormControl
|
||||
sx={{ width: "100%" }}
|
||||
variant="outlined"
|
||||
@@ -464,7 +450,7 @@ export const UserLoginManual = () => {
|
||||
/>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
<Grid sx={{ width: "100%" }} item xl={5} md={6}>
|
||||
<Grid sx={{ width: "100%" }}>
|
||||
<FormGroup>
|
||||
<FormControl
|
||||
sx={{ width: "100%" }}
|
||||
@@ -517,7 +503,7 @@ export const UserLoginManual = () => {
|
||||
/>
|
||||
</FormGroup>
|
||||
</Grid>
|
||||
<Grid item xl={5} md={6} sx={{ width: "100%" }}>
|
||||
<Grid sx={{ width: "100%" }}>
|
||||
<LoadingButton
|
||||
variant="contained"
|
||||
endIcon={<MdiChevronRight />}
|
||||
@@ -530,7 +516,7 @@ export const UserLoginManual = () => {
|
||||
Login
|
||||
</LoadingButton>
|
||||
</Grid>
|
||||
<Grid item xl={15} md={6} sx={{ width: "100%" }}>
|
||||
<Grid sx={{ width: "100%" }}>
|
||||
<Typography variant="subtitle2">
|
||||
{server.isSuccess &&
|
||||
server.data.LoginDisclaimer}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
import { EventEmitter as event } from "../../../eventEmitter.js";
|
||||
import { setServer } from "../../../utils/storage/servers.js";
|
||||
@@ -21,9 +20,6 @@ import { mdiChevronRight } from "@mdi/js";
|
||||
|
||||
import { useSnackbar } from "notistack";
|
||||
|
||||
// Svgs
|
||||
import { ReactComponent as JellyplayerLogo } from "../../../assets/logo.svg";
|
||||
|
||||
// SCSS
|
||||
import "./server.module.scss";
|
||||
|
||||
|
||||
Reference in new issue
Block a user