Fix few things
This commit is contained in:
11 files changed
+34
-109
No files matched your search
+5
-1
@@ -266,7 +266,11 @@ function App() {
|
|||||||
await delUser();
|
await delUser();
|
||||||
await relaunch();
|
await relaunch();
|
||||||
};
|
};
|
||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
useEffect(() => {
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
}, [location.pathname]);
|
||||||
|
|
||||||
if (!window.api) {
|
if (!window.api) {
|
||||||
serverAvailable().then((available) => {
|
serverAvailable().then((available) => {
|
||||||
@@ -515,7 +519,7 @@ function App() {
|
|||||||
</Route>
|
</Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
</div>
|
</div>
|
||||||
<ReactQueryDevtools />
|
{/* <ReactQueryDevtools /> */}
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</SnackbarProvider>
|
</SnackbarProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -123,7 +123,6 @@ const PlayButton = ({
|
|||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
onSuccess: (item) => {
|
onSuccess: (item) => {
|
||||||
console.log(item);
|
|
||||||
if (audio) {
|
if (audio) {
|
||||||
setAudioTracks(item.Items);
|
setAudioTracks(item.Items);
|
||||||
setAudioUrl(
|
setAudioUrl(
|
||||||
|
|||||||
@@ -176,9 +176,6 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
|||||||
justifySelf: "start",
|
justifySelf: "start",
|
||||||
}}
|
}}
|
||||||
fontWeight={400}
|
fontWeight={400}
|
||||||
onClick={() => {
|
|
||||||
console.log("Hvnrjn");
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
Name
|
Name
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState, useRef } from "react";
|
||||||
import TextField from "@mui/material/TextField";
|
import TextField from "@mui/material/TextField";
|
||||||
import MenuItem from "@mui/material/MenuItem";
|
import MenuItem from "@mui/material/MenuItem";
|
||||||
import Chip from "@mui/material/Chip";
|
import Chip from "@mui/material/Chip";
|
||||||
@@ -64,6 +64,8 @@ const Hero = ({
|
|||||||
albumBy,
|
albumBy,
|
||||||
audioPlayButton = false,
|
audioPlayButton = false,
|
||||||
}) => {
|
}) => {
|
||||||
|
const backgroundRef = useRef(null);
|
||||||
|
|
||||||
const filterMediaStreamVideo = (source) => {
|
const filterMediaStreamVideo = (source) => {
|
||||||
if (source.Type == MediaStreamType.Video) {
|
if (source.Type == MediaStreamType.Video) {
|
||||||
return true;
|
return true;
|
||||||
@@ -108,7 +110,7 @@ const Hero = ({
|
|||||||
marginBottom: "2em",
|
marginBottom: "2em",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="hero-backdrop">
|
<div className="hero-backdrop" ref={backgroundRef}>
|
||||||
{!!item.ImageBlurHashes.Backdrop && (
|
{!!item.ImageBlurHashes.Backdrop && (
|
||||||
<>
|
<>
|
||||||
{Object.keys(item.ImageBlurHashes.Backdrop)
|
{Object.keys(item.ImageBlurHashes.Backdrop)
|
||||||
@@ -591,7 +593,7 @@ const Hero = ({
|
|||||||
Directed by
|
Directed by
|
||||||
</Typography>
|
</Typography>
|
||||||
<div className="hero-text-container">
|
<div className="hero-text-container">
|
||||||
{directors.map((director) => (
|
{directors.map((director, index) => (
|
||||||
<>
|
<>
|
||||||
<TextLink
|
<TextLink
|
||||||
text={director.Name}
|
text={director.Name}
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ const MusicTrack = ({ item, queryKey, userId }) => {
|
|||||||
: item.Id,
|
: item.Id,
|
||||||
"Primary",
|
"Primary",
|
||||||
{
|
{
|
||||||
quality: 85,
|
quality: 70,
|
||||||
fillHeight: 462,
|
fillHeight: 128,
|
||||||
fillWidth: 462,
|
fillWidth: 128,
|
||||||
},
|
},
|
||||||
)}
|
)}
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
@@ -172,9 +172,10 @@ const AudioPlayer = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AnimatePresence wait>
|
<AnimatePresence>
|
||||||
{display && (
|
{display && (
|
||||||
<motion.div
|
<motion.div
|
||||||
|
key={display}
|
||||||
initial={{
|
initial={{
|
||||||
transform: "translateY(100%)",
|
transform: "translateY(100%)",
|
||||||
}}
|
}}
|
||||||
@@ -187,6 +188,10 @@ const AudioPlayer = () => {
|
|||||||
13,
|
13,
|
||||||
)} - 10px)`,
|
)} - 10px)`,
|
||||||
}}
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 0.1,
|
||||||
|
ease: "easeInOut",
|
||||||
|
}}
|
||||||
className="audio-player"
|
className="audio-player"
|
||||||
>
|
>
|
||||||
<motion.div
|
<motion.div
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ const queryClient = new QueryClient({
|
|||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
queries: {
|
queries: {
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
cacheTime: 300000,
|
cacheTime: 120000,
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ const MusicAlbumTitlePage = () => {
|
|||||||
let result = await getLibraryApi(window.api).getSimilarAlbums({
|
let result = await getLibraryApi(window.api).getSimilarAlbums({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: item.data.Id,
|
itemId: item.data.Id,
|
||||||
|
limit: 16,
|
||||||
});
|
});
|
||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
@@ -232,9 +233,6 @@ const MusicAlbumTitlePage = () => {
|
|||||||
justifySelf: "start",
|
justifySelf: "start",
|
||||||
}}
|
}}
|
||||||
fontWeight={400}
|
fontWeight={400}
|
||||||
onClick={() => {
|
|
||||||
console.log("Hvnrjn");
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
Name
|
Name
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -132,43 +132,6 @@ const ArtistTitlePage = () => {
|
|||||||
refetchOnWindowFocus: true,
|
refetchOnWindowFocus: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const similarItems = useQuery({
|
|
||||||
queryKey: ["item", id, "similarItem"],
|
|
||||||
queryFn: async () => {
|
|
||||||
let result;
|
|
||||||
if (item.data.Type == "Movie") {
|
|
||||||
result = await getLibraryApi(window.api).getSimilarMovies({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.data.Id,
|
|
||||||
});
|
|
||||||
} else if (item.data.Type == "Series") {
|
|
||||||
result = await getLibraryApi(window.api).getSimilarShows({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.data.Id,
|
|
||||||
});
|
|
||||||
} else if (item.data.Type == "MusicAlbum") {
|
|
||||||
result = await getLibraryApi(window.api).getSimilarAlbums({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.data.Id,
|
|
||||||
});
|
|
||||||
} else if (item.data.Type == "MusicArtist") {
|
|
||||||
result = await getLibraryApi(window.api).getSimilarArtists({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.data.Id,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
result = await getLibraryApi(window.api).getSimilarItems({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.data.Id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return result.data;
|
|
||||||
},
|
|
||||||
enabled: item.isSuccess,
|
|
||||||
networkMode: "always",
|
|
||||||
refetchOnWindowFocus: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
const artistDiscography = useQuery({
|
const artistDiscography = useQuery({
|
||||||
queryKey: ["item", id, "artist", "discography"],
|
queryKey: ["item", id, "artist", "discography"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
@@ -266,7 +229,7 @@ const ArtistTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading || similarItems.isLoading) {
|
if (item.isLoading) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@@ -281,7 +244,7 @@ const ArtistTitlePage = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (item.isSuccess && similarItems.isSuccess) {
|
if (item.isSuccess) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="scrollY"
|
className="scrollY"
|
||||||
@@ -489,7 +452,7 @@ const ArtistTitlePage = () => {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (item.isError || similarItems.isError) {
|
if (item.isError) {
|
||||||
return <ErrorNotice />;
|
return <ErrorNotice />;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -101,33 +101,11 @@ const BoxSetTitlePage = () => {
|
|||||||
const similarItems = useQuery({
|
const similarItems = useQuery({
|
||||||
queryKey: ["item", id, "similarItem"],
|
queryKey: ["item", id, "similarItem"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let result;
|
const result = await getLibraryApi(window.api).getSimilarItems({
|
||||||
if (item.data.Type == "Movie") {
|
|
||||||
result = await getLibraryApi(window.api).getSimilarMovies({
|
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: item.data.Id,
|
itemId: item.data.Id,
|
||||||
|
limit: 16,
|
||||||
});
|
});
|
||||||
} else if (item.data.Type == "Series") {
|
|
||||||
result = await getLibraryApi(window.api).getSimilarShows({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.data.Id,
|
|
||||||
});
|
|
||||||
} else if (item.data.Type == "MusicAlbum") {
|
|
||||||
result = await getLibraryApi(window.api).getSimilarAlbums({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.data.Id,
|
|
||||||
});
|
|
||||||
} else if (item.data.Type == "MusicArtist") {
|
|
||||||
result = await getLibraryApi(window.api).getSimilarArtists({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.data.Id,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
result = await getLibraryApi(window.api).getSimilarItems({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.data.Id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
enabled: item.isSuccess,
|
enabled: item.isSuccess,
|
||||||
@@ -240,39 +218,13 @@ const BoxSetTitlePage = () => {
|
|||||||
}
|
}
|
||||||
imageType={"Primary"}
|
imageType={"Primary"}
|
||||||
cardCaption={
|
cardCaption={
|
||||||
similar.Type ==
|
|
||||||
BaseItemKind.Episode
|
|
||||||
? `S${similar.ParentIndexNumber}:E${similar.IndexNumber} - ${similar.Name}`
|
|
||||||
: similar.Type ==
|
|
||||||
BaseItemKind.Series
|
|
||||||
? `${
|
|
||||||
similar.ProductionYear
|
similar.ProductionYear
|
||||||
} - ${
|
|
||||||
!!similar.EndDate
|
|
||||||
? new Date(
|
|
||||||
similar.EndDate,
|
|
||||||
).toLocaleString(
|
|
||||||
[],
|
|
||||||
{
|
|
||||||
year: "numeric",
|
|
||||||
},
|
|
||||||
)
|
|
||||||
: "Present"
|
|
||||||
}`
|
|
||||||
: similar.ProductionYear
|
|
||||||
}
|
|
||||||
cardType={
|
|
||||||
similar.Type ==
|
|
||||||
BaseItemKind.MusicAlbum ||
|
|
||||||
similar.Type ==
|
|
||||||
BaseItemKind.Audio
|
|
||||||
? "square"
|
|
||||||
: "portrait"
|
|
||||||
}
|
}
|
||||||
|
cardType={"portrait"}
|
||||||
queryKey={[
|
queryKey={[
|
||||||
"item",
|
"item",
|
||||||
id,
|
id,
|
||||||
"similarItem",
|
`collection`,
|
||||||
]}
|
]}
|
||||||
userId={user.data.Id}
|
userId={user.data.Id}
|
||||||
imageBlurhash={
|
imageBlurhash={
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect, useRef } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
@@ -139,6 +139,7 @@ const ItemDetail = () => {
|
|||||||
result = await getLibraryApi(window.api).getSimilarMovies({
|
result = await getLibraryApi(window.api).getSimilarMovies({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: item.data.Id,
|
itemId: item.data.Id,
|
||||||
|
limit: 16,
|
||||||
});
|
});
|
||||||
} else if (item.data.Type == "Series") {
|
} else if (item.data.Type == "Series") {
|
||||||
result = await getLibraryApi(window.api).getSimilarShows({
|
result = await getLibraryApi(window.api).getSimilarShows({
|
||||||
@@ -566,6 +567,8 @@ const ItemDetail = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
|
const backdropRef = useRef(null);
|
||||||
|
|
||||||
if (item.isLoading || similarItems.isLoading) {
|
if (item.isLoading || similarItems.isLoading) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -591,6 +594,7 @@ const ItemDetail = () => {
|
|||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
gap: "0.5em",
|
gap: "0.5em",
|
||||||
}}
|
}}
|
||||||
|
ref={backdropRef}
|
||||||
>
|
>
|
||||||
<Hero
|
<Hero
|
||||||
item={item.data}
|
item={item.data}
|
||||||
@@ -601,6 +605,7 @@ const ItemDetail = () => {
|
|||||||
videoTracks={videoTracks}
|
videoTracks={videoTracks}
|
||||||
audioTracks={audioTracks}
|
audioTracks={audioTracks}
|
||||||
subtitleTracks={subtitleTracks}
|
subtitleTracks={subtitleTracks}
|
||||||
|
backdropRef={backdropRef}
|
||||||
/>
|
/>
|
||||||
{item.data.People.length > 0 && (
|
{item.data.People.length > 0 && (
|
||||||
<CardScroller
|
<CardScroller
|
||||||
|
|||||||
Reference in new issue
Block a user