This reverts commit 38dde2a63d, reversing
changes made to 8aef2fc22d.
This commit is contained in:
Prayag Prajapati committed 2023-06-10 11:25:29 +05:30
1 parent 38dde2a63d
commit d9644f325c
10 files changed
+225 -287

No files matched your search

+7 -49
View File
@@ -40,7 +40,7 @@ import DialogContentText from "@mui/material/DialogContentText";
import DialogTitle from "@mui/material/DialogTitle"; import DialogTitle from "@mui/material/DialogTitle";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import Box from "@mui/material/Box"; import Box from "@mui/material/Box";
import Stack from "@mui/material/Stack"; import CircularProgress from "@mui/material/CircularProgress";
// Routes // Routes
import { ServerSetup, ServerList } from "./routes/setup/server"; import { ServerSetup, ServerList } from "./routes/setup/server";
@@ -72,9 +72,6 @@ import { delServer, getServer } from "./utils/storage/servers.js";
import { delUser, getUser } from "./utils/storage/user.js"; import { delUser, getUser } from "./utils/storage/user.js";
import axios from "axios"; import axios from "axios";
import { Blurhash } from "react-blurhash";
import zIndex from "@mui/material/styles/zIndex.js";
import { useBackdropStore } from "./utils/store/backdrop.js";
const jellyfin = new Jellyfin({ const jellyfin = new Jellyfin({
clientInfo: { clientInfo: {
@@ -124,9 +121,6 @@ const AnimationWrapper = () => {
transition={{ transition={{
duration: 0.35, duration: 0.35,
}} }}
style={{
width: "100%",
}}
> >
<Outlet /> <Outlet />
</motion.div> </motion.div>
@@ -284,33 +278,9 @@ function App() {
appWindow.setFullscreen(false); appWindow.setFullscreen(false);
}, [location]); }, [location]);
const [hash] = useBackdropStore((state) => [state.hash]);
return ( return (
<SnackbarProvider maxSnack={5}> <SnackbarProvider maxSnack={5}>
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Box
className="appBackdrop"
sx={{
position: "fixed",
top: 0,
left: 0,
right: 0,
bottom: 0,
zIndex: "-1",
opacity: 0.25,
}}
>
<Blurhash
hash={hash}
width={1920}
height={1080}
style={{
width: "100%",
height: "100%",
}}
/>
</Box>
<Kon resetDelay={1000} action={sixtyNine}></Kon> <Kon resetDelay={1000} action={sixtyNine}></Kon>
<Dialog <Dialog
open={easterEgg} open={easterEgg}
@@ -353,23 +323,11 @@ function App() {
</Button> </Button>
</DialogActions> </DialogActions>
</Dialog> </Dialog>
<AnimatePresence>
<div style={{ display: "flex" }}>
<CssBaseline /> <CssBaseline />
<AppBar />
<Box className="scrollContainer">
<Stack
direction="row"
width="100vw"
height="100%"
sx={{
overflow: "hidden",
position: "absolute",
top: 0,
right: 0,
bottom: 0,
left: 0,
}}
>
<SideMenu /> <SideMenu />
<AppBar />
<Routes <Routes
key={location.pathname} key={location.pathname}
location={location} location={location}
@@ -437,9 +395,9 @@ function App() {
/> />
</Route> </Route>
</Routes> </Routes>
</Stack> </div>
</Box> </AnimatePresence>
<ReactQueryDevtools position="bottom-right" /> <ReactQueryDevtools />
</ThemeProvider> </ThemeProvider>
</SnackbarProvider> </SnackbarProvider>
); );
+1 -1
View File
@@ -87,11 +87,11 @@ export const AppBar = () => {
return ( return (
<MuiAppBar <MuiAppBar
sx={{ sx={{
width: `calc(100vw - ${theme.spacing(7)})`,
backgroundColor: "transparent", backgroundColor: "transparent",
}} }}
className={trigger ? "appBar backdropVisible" : "appBar"} className={trigger ? "appBar backdropVisible" : "appBar"}
elevation={0} elevation={0}
position="static"
> >
<Toolbar sx={{ justifyContent: "space-between" }}> <Toolbar sx={{ justifyContent: "space-between" }}>
<Box <Box
+25 -4
View File
@@ -113,18 +113,39 @@ export const SideMenu = ({}) => {
open={false} open={false}
PaperProps={{ PaperProps={{
sx: { sx: {
backgroundColor: "transparent", backgroundColor: "inherit",
border: "none", border: "none",
width: `calc(${theme.spacing(7)} + 10px)`, width: `calc(${theme.spacing(7)} + 10px)`,
height: "100%", height: "100vh",
position: "inherit", // display: visible ? "block" : "none",
}, },
}} }}
sx={{ sx={{
width: `calc(${theme.spacing(7)} + 10px)`, width: `calc(${theme.spacing(7)} + 10px)`,
background: "transparent", background: theme.palette.background.paper,
}} }}
> >
<DrawerHeader
className="Mui-DrawerHeader"
sx={{
justifyContent: "center",
}}
>
{/* <div>
<Avatar src={""}/>
<Typography variant="h3">
{user["Name"]}
</Typography>
</div> */}
<IconButton
color="inherit"
aria-label="open drawer"
onClick={handleDrawerOpen}
>
<MdiMenu />
</IconButton>
</DrawerHeader>
<Divider />
{libraries.isLoading ? ( {libraries.isLoading ? (
<> <>
<Skeleton <Skeleton
+3
View File
@@ -38,6 +38,9 @@ const About = () => {
className="scrollY" className="scrollY"
sx={{ sx={{
flexGrow: 1, flexGrow: 1,
pt: 11,
px: 3,
pb: 3,
position: "relative", position: "relative",
}} }}
> >
+3
View File
@@ -204,6 +204,9 @@ const Home = () => {
className="scrollY" className="scrollY"
sx={{ sx={{
flexGrow: 1, flexGrow: 1,
pt: 11,
px: 3,
pb: 3,
position: "relative", position: "relative",
}} }}
> >
+101 -137
View File
@@ -66,7 +66,6 @@ import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
import { ArtistAlbum } from "../../components/layouts/artist/artistAlbum"; import { ArtistAlbum } from "../../components/layouts/artist/artistAlbum";
import { MdiMusic } from "../../components/icons/mdiMusic"; import { MdiMusic } from "../../components/icons/mdiMusic";
import { usePlaybackStore } from "../../utils/store/playback"; import { usePlaybackStore } from "../../utils/store/playback";
import { useBackdropStore } from "../../utils/store/backdrop";
function TabPanel(props) { function TabPanel(props) {
const { children, value, index, ...other } = props; const { children, value, index, ...other } = props;
@@ -519,12 +518,8 @@ const ItemDetail = () => {
state.setDuration, state.setDuration,
state.setItemId, state.setItemId,
state.setItemName, state.setItemName,
state.setItemName,
,
]); ]);
const [setHash] = useBackdropStore((state) => [state.setHash]);
const [directors, setDirectors] = useState([]); const [directors, setDirectors] = useState([]);
const [writers, setWriters] = useState([]); const [writers, setWriters] = useState([]);
useEffect(() => { useEffect(() => {
@@ -537,31 +532,9 @@ const ItemDetail = () => {
(itm) => itm.Type == "Writer", (itm) => itm.Type == "Writer",
); );
setWriters(writeTp); setWriters(writeTp);
if (!!item.data.ParentBackdropImageTags) {
setHash(
item.data.ImageBlurHashes.Backdrop[
item.data.ParentBackdropImageTags[0]
],
);
} else if (item.data.BackdropImageTags.length != 0) {
setHash(
item.data.ImageBlurHashes.Backdrop[
item.data.BackdropImageTags[0]
],
);
} else {
setHash("LGJCbc|t1s1}1{JU|y,uAo=3,s$Q");
}
} }
}, [item.isSuccess]); }, [item.isSuccess]);
const [crew, setCrew] = useState([]);
useEffect(() => {
setCrew(directors.concat(...writers));
}, [writers, directors]);
if (item.isLoading || similarItems.isLoading) { if (item.isLoading || similarItems.isLoading) {
return ( return (
<Box <Box
@@ -580,12 +553,54 @@ const ItemDetail = () => {
if (item.isSuccess && similarItems.isSuccess) { if (item.isSuccess && similarItems.isSuccess) {
return ( return (
<> <>
<Box className="item-detail-backdrop">
{item.data.BackdropImageTags.length != 0 && (
<Blurhash
hash={
item.data.ImageBlurHashes.Backdrop[
item.data.BackdropImageTags[0]
]
}
width="100%"
height="100%"
resolutionX={14}
resolutionY={22}
style={{
aspectRatio: "0.666",
}}
punch={1}
className="item-detail-image-blurhash"
/>
)}
{!!item.data.ParentBackdropImageTags &&
item.data.ParentBackdropImageTags.length != 0 && (
<Blurhash
hash={
item.data.ImageBlurHashes.Backdrop[
item.data
.ParentBackdropImageTags[0]
]
}
width="100%"
height="100%"
resolutionX={14}
resolutionY={22}
style={{
aspectRatio: "0.666",
}}
punch={1}
className="item-detail-image-blurhash"
/>
)}
</Box>
<Box <Box
recomponent="main" recomponent="main"
className="scrollY" className="scrollY"
sx={{ sx={{
display: "flex", display: "flex",
display: "flex", pt: 11,
px: 3,
pb: 3,
position: "relative", position: "relative",
flexFlow: "column", flexFlow: "column",
}} }}
@@ -593,9 +608,15 @@ const ItemDetail = () => {
<Box <Box
className="item-detail-header" className="item-detail-header"
mb={2} mb={2}
paddingTop={5} paddingTop={
item.data.Type.includes("Music") ||
item.data.Type === BaseItemKind.Episode ||
!!item.data.PrimaryImageAspectRatio
? 10
: 0
}
> >
{/* <Box className="item-detail-header-backdrop"> <Box className="item-detail-header-backdrop">
{item.data.Type != BaseItemKind.MusicAlbum && {item.data.Type != BaseItemKind.MusicAlbum &&
item.data.Type != BaseItemKind.Episode item.data.Type != BaseItemKind.Episode
? item.data.BackdropImageTags.length != ? item.data.BackdropImageTags.length !=
@@ -670,7 +691,7 @@ const ItemDetail = () => {
> >
{TypeIconCollectionCard[item.data.Type]} {TypeIconCollectionCard[item.data.Type]}
</Box> </Box>
</Box> */} </Box>
<Box <Box
className="item-detail-info-container" className="item-detail-info-container"
@@ -682,7 +703,7 @@ const ItemDetail = () => {
item.data.Type === item.data.Type ===
BaseItemKind.Episode BaseItemKind.Episode
? "center !important" ? "center !important"
: "flex-start", : "flex-end",
justifyContent: "flex-start", justifyContent: "flex-start",
width: "100%", width: "100%",
}} }}
@@ -767,12 +788,6 @@ const ItemDetail = () => {
} }
</div> </div>
</Box> </Box>
<Stack
direction="column"
alignItems="flex-start"
gap={2}
mt={2}
>
<Box <Box
sx={{ sx={{
display: "flex", display: "flex",
@@ -786,9 +801,7 @@ const ItemDetail = () => {
{item.data.Type === {item.data.Type ===
BaseItemKind.Episode && ( BaseItemKind.Episode && (
<Link <Link
component={ component={RouterLink}
RouterLink
}
to={`/item/${item.data.SeriesId}`} to={`/item/${item.data.SeriesId}`}
variant="h3" variant="h3"
textOverflow="ellipsis" textOverflow="ellipsis"
@@ -805,8 +818,7 @@ const ItemDetail = () => {
src={`${window.api.basePath}/Items/${item.data.SeriesId}/Images/Logo?cropWhitespace=True&quality=80&tag=${item.data.ParentLogoImageTag}`} src={`${window.api.basePath}/Items/${item.data.SeriesId}/Images/Logo?cropWhitespace=True&quality=80&tag=${item.data.ParentLogoImageTag}`}
/> />
) : ( ) : (
item.data item.data.SeriesName
.SeriesName
)} )}
</Link> </Link>
)} )}
@@ -817,9 +829,7 @@ const ItemDetail = () => {
textOverflow="ellipsis" textOverflow="ellipsis"
whiteSpace="nowrap" whiteSpace="nowrap"
width="100%" width="100%"
sx={{ sx={{ opacity: 0.7 }}
opacity: 0.7,
}}
> >
{`S${item.data.ParentIndexNumber}:E${item.data.IndexNumber} - ${item.data.Name}`} {`S${item.data.ParentIndexNumber}:E${item.data.IndexNumber} - ${item.data.Name}`}
</Typography> </Typography>
@@ -830,8 +840,7 @@ const ItemDetail = () => {
whiteSpace="nowrap" whiteSpace="nowrap"
width="100%" width="100%"
> >
{!!item.data {!!item.data.ImageTags
.ImageTags
.Logo ? ( .Logo ? (
<img <img
className="item-detail-title-logo" className="item-detail-title-logo"
@@ -844,9 +853,7 @@ const ItemDetail = () => {
)} )}
<Typography <Typography
variant="h6" variant="h6"
sx={{ sx={{ opacity: 0.7 }}
opacity: 0.7,
}}
> >
{item.data.OriginalTitle} {item.data.OriginalTitle}
</Typography> </Typography>
@@ -905,14 +912,10 @@ const ItemDetail = () => {
width: "100%", width: "100%",
}} }}
> >
{item.data.Type != {item.data.Type != "MusicArtist" &&
"MusicArtist" && item.data.ProductionYear && (
item.data
.ProductionYear && (
<Typography <Typography
sx={{ sx={{ flexGrow: 0 }}
flexGrow: 0,
}}
variant="subtitle1" variant="subtitle1"
> >
{ {
@@ -928,8 +931,7 @@ const ItemDetail = () => {
label={ label={
!!item.data !!item.data
.OfficialRating .OfficialRating
? item ? item.data
.data
.OfficialRating .OfficialRating
: "Not Rated" : "Not Rated"
} }
@@ -960,14 +962,12 @@ const ItemDetail = () => {
.data .data
.CommunityRating * .CommunityRating *
10, 10,
) / ) / 10}
10}
</Typography> </Typography>
</> </>
) : ( ) : (
<Typography variant="subtitle1"> <Typography variant="subtitle1">
No No Community
Community
Rating Rating
</Typography> </Typography>
)} )}
@@ -991,55 +991,13 @@ const ItemDetail = () => {
)} )}
</Stack> </Stack>
</Box> </Box>
<Box
className="item-detail-tagline"
sx={{ width: "100%" }}
>
<Typography
variant="h5"
fontStyle="italic"
sx={{ opacity: 0.7 }}
>
{item.data.Taglines[0]}
</Typography>
</Box>
{item.data.Genres.length != 0 && (
<Stack direction="row" gap={1}>
{item.data.Genres.map(
(genre, index) => {
return (
<Chip
key={
index
}
variant="filled"
label={
genre
}
/>
);
},
)}
</Stack>
)}
{!!item.data.Overview && (
<Box>
<Typography
variant="body1"
sx={{
opacity: 0.8,
}}
mb={2}
>
{item.data.Overview}
</Typography>
</Box>
)}
<Stack <Stack
direction="row" direction="row"
gap={1} gap={1}
alignItems="center" alignItems="center"
justifyContent="center" justifyContent="center"
ml="auto"
mr={2}
> >
{item.data.Type != "Person" && {item.data.Type != "Person" &&
!item.data.Type.includes( !item.data.Type.includes(
@@ -1088,20 +1046,6 @@ const ItemDetail = () => {
.data .data
.RunTimeTicks, .RunTimeTicks,
); );
if (
subtitleTracks.length !=
0
) {
// setSubtitleTracks(
// {
// kind: "subtitles",
// src: `http://localhost:8096/Videos/e2d0ae00-f458-d4d4-7e09-1768ca0f485c/e2d0ae00f458d4d47e091768ca0f485c/Subtitles/0/0/Stream.vtt?api_key=${window.api.accessToken}`,
// srcLang: "en",
// default: true,
// },
// );
setSubtitleTracks();
}
} }
navigate( navigate(
`/player`, `/player`,
@@ -1111,8 +1055,7 @@ const ItemDetail = () => {
{!!item.data {!!item.data
.UserData .UserData
.PlayedPercentage && .PlayedPercentage &&
item.data item.data.UserData
.UserData
.PlayedPercentage > .PlayedPercentage >
0 0
? "Resume" ? "Resume"
@@ -1162,25 +1105,34 @@ const ItemDetail = () => {
</> </>
)} )}
<IconButton onClick={handleLiking}> <IconButton onClick={handleLiking}>
{item.data.UserData {item.data.UserData.IsFavorite ? (
.IsFavorite ? (
<MdiHeart <MdiHeart
sx={{ sx={{ color: pink[700] }}
color: pink[700],
}}
/> />
) : ( ) : (
<MdiHeartOutline /> <MdiHeartOutline />
)} )}
</IconButton> </IconButton>
</Stack> </Stack>
</Stack> </Box>
<Box
className="item-detail-tagline"
sx={{ width: "100%" }}
>
<Typography
variant="h5"
fontStyle="italic"
sx={{ opacity: 0.8 }}
>
{item.data.Taglines[0]}
</Typography>
</Box> </Box>
</Box> </Box>
<TableContainer> <TableContainer>
<Table> <Table>
<TableBody> <TableBody>
{/* {item.data.Genres != 0 && ( {item.data.Genres != 0 && (
<TableRow <TableRow
sx={{ sx={{
"& td, & th": { "& td, & th": {
@@ -1228,7 +1180,7 @@ const ItemDetail = () => {
</Stack> </Stack>
</TableCell> </TableCell>
</TableRow> </TableRow>
)} */} )}
{item.data.ExternalUrls.length != 0 && ( {item.data.ExternalUrls.length != 0 && (
<TableRow <TableRow
@@ -1764,6 +1716,20 @@ const ItemDetail = () => {
</TableBody> </TableBody>
</Table> </Table>
</TableContainer> </TableContainer>
{!!item.data.Overview && (
<Box mt={3}>
<Typography variant="h5" mb={1}>
Overview
</Typography>
<Typography
variant="body1"
sx={{ opacity: 0.8 }}
mb={2}
>
{item.data.Overview}
</Typography>
</Box>
)}
{item.data.Type == BaseItemKind.MusicAlbum && ( {item.data.Type == BaseItemKind.MusicAlbum && (
<TableContainer <TableContainer
@@ -2718,9 +2684,7 @@ const ItemDetail = () => {
label={ label={
episodes.isLoading ? ( episodes.isLoading ? (
<CircularProgress <CircularProgress
sx={{ sx={{ p: 1.5 }}
p: 1.5,
}}
/> />
) : ( ) : (
episodes.data episodes.data
@@ -2789,7 +2753,7 @@ const ItemDetail = () => {
duration: 0.35, duration: 0.35,
delay: delay:
mindex * mindex *
0.03, 0.1,
}} }}
> >
<EpisodeCard <EpisodeCard
@@ -3197,7 +3161,7 @@ const ItemDetail = () => {
variant: "h5", variant: "h5",
fontSize: "1.8em", fontSize: "1.8em",
}} }}
displayCards={12} displayCards={8}
title="Cast" title="Cast"
disableDecoration disableDecoration
boxProps={{ boxProps={{
+6 -6
View File
@@ -17,7 +17,7 @@
display: flex; display: flex;
gap: 1em; gap: 1em;
justify-content: flex-start; justify-content: flex-start;
align-items: flex-start; align-items: flex-end;
position: relative; position: relative;
flex-wrap: wrap; flex-wrap: wrap;
&-backdrop { &-backdrop {
@@ -30,11 +30,11 @@
left: -24px; left: -24px;
z-index: -2; z-index: -2;
filter: brightness(0.6); filter: brightness(0.6);
mask-image: linear-gradient(to bottom, black 75%, transparent); mask-image: linear-gradient(0deg, transparent, black 75%);
-webkit-mask-image: linear-gradient( -webkit-mask-image: linear-gradient(
to bottom, 0deg,
black 75%, transparent,
transparent black 75%
); );
} }
} }
@@ -49,7 +49,7 @@
z-index: -1; z-index: -1;
} }
&-container { &-container {
width: 20%; width: 15%;
flex-shrink: 0; flex-shrink: 0;
position: relative; position: relative;
border-radius: $border-radius-default; border-radius: $border-radius-default;
+70 -65
View File
@@ -452,11 +452,21 @@ const LibraryView = () => {
<Box <Box
sx={{ sx={{
display: "flex", display: "flex",
flexDirection: "column", }}
>
<Box
component="main"
className="scrollY"
sx={{
flexGrow: 1,
pt: 19,
px: 3,
pb: 3,
position: "relative",
}} }}
> >
<AppBar <AppBar
position="static" position="fixed"
elevation={trigger ? 1 : 0} elevation={trigger ? 1 : 0}
sx={{ sx={{
width: `calc(100vw - ${theme.spacing(7)} - 10px)`, width: `calc(100vw - ${theme.spacing(7)} - 10px)`,
@@ -472,7 +482,9 @@ const LibraryView = () => {
> >
<Divider <Divider
sx={{ sx={{
transform: trigger ? "scaleX(1)" : "scaleX(0)", transform: trigger
? "scaleX(1)"
: "scaleX(0)",
transition: "transform 150ms", transition: "transform 150ms",
transformOrigin: "left", transformOrigin: "left",
transitionDelay: "50ms", transitionDelay: "50ms",
@@ -520,7 +532,8 @@ const LibraryView = () => {
> >
{currentLib.isSuccess && {currentLib.isSuccess &&
allowedFilterViews.includes( allowedFilterViews.includes(
currentLib.data.Items[0].CollectionType, currentLib.data.Items[0]
.CollectionType,
) && ( ) && (
<> <>
<Button <Button
@@ -532,12 +545,16 @@ const LibraryView = () => {
} }
aria-haspopup="true" aria-haspopup="true"
aria-expanded={ aria-expanded={
open ? "true" : undefined open
? "true"
: undefined
} }
startIcon={ startIcon={
<MdiFilterOutline /> <MdiFilterOutline />
} }
endIcon={<MdiChevronDown />} endIcon={
<MdiChevronDown />
}
onClick={openFiltersMenu} onClick={openFiltersMenu}
color="white" color="white"
// sx={{ p: 1 }} // sx={{ p: 1 }}
@@ -551,7 +568,9 @@ const LibraryView = () => {
filterButtonAnchorEl filterButtonAnchorEl
} }
open={filterMenuOpen} open={filterMenuOpen}
onClose={closeFiltersMenu} onClose={
closeFiltersMenu
}
MenuListProps={{ MenuListProps={{
"aria-labelledby": "aria-labelledby":
"basic-button", "basic-button",
@@ -559,11 +578,13 @@ const LibraryView = () => {
}} }}
anchorOrigin={{ anchorOrigin={{
vertical: "bottom", vertical: "bottom",
horizontal: "center", horizontal:
"center",
}} }}
transformOrigin={{ transformOrigin={{
vertical: "top", vertical: "top",
horizontal: "center", horizontal:
"center",
}} }}
sx={{ sx={{
maxHeight: "55%", maxHeight: "55%",
@@ -636,7 +657,8 @@ const LibraryView = () => {
</AccordionDetails> </AccordionDetails>
</Accordion> </Accordion>
{!onlyStatusFilterViews.includes( {!onlyStatusFilterViews.includes(
currentLib.data.Items[0] currentLib.data
.Items[0]
.CollectionType, .CollectionType,
) && ( ) && (
<Accordion> <Accordion>
@@ -707,7 +729,8 @@ const LibraryView = () => {
</Accordion> </Accordion>
)} )}
{!onlyStatusFilterViews.includes( {!onlyStatusFilterViews.includes(
currentLib.data.Items[0] currentLib.data
.Items[0]
.CollectionType, .CollectionType,
) && ( ) && (
<Accordion> <Accordion>
@@ -724,7 +747,8 @@ const LibraryView = () => {
}} }}
noWrap noWrap
> >
Video Type Video
Type
</Typography> </Typography>
</AccordionSummary> </AccordionSummary>
<Divider /> <Divider />
@@ -780,7 +804,9 @@ const LibraryView = () => {
</Menu> </Menu>
</> </>
)} )}
{!disabledSortViews.includes(currentViewType) && ( {!disabledSortViews.includes(
currentViewType,
) && (
<> <>
{sortByData != undefined && {sortByData != undefined &&
sortBy != undefined && ( sortBy != undefined && (
@@ -846,31 +872,33 @@ const LibraryView = () => {
value={currentViewType} value={currentViewType}
size="small" size="small"
variant="filled" variant="filled"
onChange={handleCurrentViewType} onChange={
handleCurrentViewType
}
> >
{viewType.map((item, index) => { {viewType.map(
(item, index) => {
return ( return (
<MenuItem <MenuItem
key={item.value} key={
value={item.value} item.value
}
value={
item.value
}
> >
{item.title} {
item.title
}
</MenuItem> </MenuItem>
); );
})} },
)}
</TextField> </TextField>
)} )}
</Stack> </Stack>
</Toolbar> </Toolbar>
</AppBar> </AppBar>
<Box
sx={{
flexGrow: 1,
position: "relative",
overflowY: "auto",
}}
>
<Box component="main" className="scrollY">
{items.isLoading || items.isFetching ? ( {items.isLoading || items.isFetching ? (
<Box <Box
sx={{ sx={{
@@ -898,10 +926,7 @@ const LibraryView = () => {
) : items.data.TotalRecordCount == 0 ? ( ) : items.data.TotalRecordCount == 0 ? (
<EmptyNotice /> <EmptyNotice />
) : currentViewType != BaseItemKind.Audio ? ( ) : currentViewType != BaseItemKind.Audio ? (
<Grid2 <Grid2 container columns={{ xs: 2, sm: 4, md: 8 }}>
container
columns={{ xs: 2, sm: 4, md: 8 }}
>
{items.data.Items.map((item, index) => { {items.data.Items.map((item, index) => {
return ( return (
<Grid2 <Grid2
@@ -928,8 +953,7 @@ const LibraryView = () => {
itemName={item.Name} itemName={item.Name}
itemId={item.Id} itemId={item.Id}
imageTags={ imageTags={
!!item.ImageTags !!item.ImageTags.Primary
.Primary
} }
subText={ subText={
item.Type.includes( item.Type.includes(
@@ -952,8 +976,7 @@ const LibraryView = () => {
"MusicAlbum" || "MusicAlbum" ||
item.Type == item.Type ==
"MusicGenre" || "MusicGenre" ||
item.Type == item.Type == "Playlist"
"Playlist"
? "square" ? "square"
: "portait" : "portait"
} }
@@ -971,8 +994,7 @@ const LibraryView = () => {
item.ImageBlurHashes == item.ImageBlurHashes ==
{} {}
? "" ? ""
: !!item : !!item.ImageTags
.ImageTags
.Primary .Primary
? !!item ? !!item
.ImageBlurHashes .ImageBlurHashes
@@ -989,8 +1011,7 @@ const LibraryView = () => {
} }
currentUser={user.data} currentUser={user.data}
favourite={ favourite={
item.UserData item.UserData?.IsFavorite
?.IsFavorite
} }
></Card> ></Card>
</Grid2> </Grid2>
@@ -1001,26 +1022,19 @@ const LibraryView = () => {
<TableContainer> <TableContainer>
<Table> <Table>
<TableBody> <TableBody>
{items.data.Items.map( {items.data.Items.map((item, index) => {
(item, index) => {
return ( return (
<TableRow <TableRow
component={ component={motion.div}
motion.div
}
key={item.Id} key={item.Id}
sx={{ sx={{
"& td,& th": "& td,& th": {
{
borderBottom: borderBottom:
"1px solid rgb(255 255 255 / 0.1)", "1px solid rgb(255 255 255 / 0.1)",
}, },
"&:last-child td, &:last-child th": "&:last-child td, &:last-child th":
{ { border: 0 },
border: 0, "&:hover": {
},
"&:hover":
{
background: background:
"rgb(255 255 255 / 0.05)", "rgb(255 255 255 / 0.05)",
}, },
@@ -1036,9 +1050,7 @@ const LibraryView = () => {
transition={{ transition={{
duration: 0.25, duration: 0.25,
ease: "easeInOut", ease: "easeInOut",
delay: delay: 0.02 * index,
0.02 *
index,
}} }}
> >
<TableCell width="4.5em"> <TableCell width="4.5em">
@@ -1058,9 +1070,7 @@ const LibraryView = () => {
</TableCell> </TableCell>
<TableCell> <TableCell>
<Typography variant="h6"> <Typography variant="h6">
{ {item.Name}
item.Name
}
</Typography> </Typography>
<Stack <Stack
direction="row" direction="row"
@@ -1114,8 +1124,7 @@ const LibraryView = () => {
); );
}} }}
> >
{item {item.UserData
.UserData
.IsFavorite ? ( .IsFavorite ? (
<MdiHeart /> <MdiHeart />
) : ( ) : (
@@ -1125,17 +1134,14 @@ const LibraryView = () => {
</TableCell> </TableCell>
</TableRow> </TableRow>
); );
}, })}
)}
</TableBody> </TableBody>
</Table> </Table>
</TableContainer> </TableContainer>
)} )}
{!items.isFetching && {!items.isFetching &&
!disablePaginationViews.includes( !disablePaginationViews.includes(currentViewType) &&
currentViewType,
) &&
items.isSuccess && items.isSuccess &&
items.data.TotalRecordCount > maxDisplayItems && ( items.data.TotalRecordCount > maxDisplayItems && (
<Stack <Stack
@@ -1174,7 +1180,6 @@ const LibraryView = () => {
{items.isError && <ErrorNotice />} {items.isError && <ErrorNotice />}
</Box> </Box>
</Box> </Box>
</Box>
); );
}; };
+9 -17
View File
@@ -41,18 +41,14 @@ body {
overflow-y: overlay; overflow-y: overlay;
} }
#root { #root,
display: flex;
flex-direction: column;
height: 100vh;
width: 100vw;
}
.root-page { .root-page {
height: fit-content;
width: 100%;
position: relative;
overflow-y: hidden;
overflow-x: hidden; overflow-x: hidden;
height: 100%; min-height: 100vh;
margin-bottom: 12vh;
overflow-y: auto;
} }
.centered { .centered {
@@ -100,17 +96,13 @@ h1 {
color: white !important; color: white !important;
} }
.scrollContainer {
position: relative;
flex-grow: 1;
}
.scrollY { .scrollY {
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: visible;
height: fit-content;
width: inherit; width: inherit;
box-sizing: border-box; box-sizing: border-box;
padding: 1.5em; min-height: 100vh;
} }
.empty { .empty {
-8
View File
@@ -1,8 +0,0 @@
/** @format */
import { create } from "zustand";
export const useBackdropStore = create((set) => ({
hash: "LGJCbc|t1s1}1{JU|y,uAo=3,s$Q",
setHash: (ahash) => set((state) => ({ hash: ahash })),
}));