ui: implement new appBar #284
This commit is contained in:
6 files changed
+283
-324
No files matched your search
@@ -1,11 +1,20 @@
|
|||||||
|
|
||||||
.appBar {
|
.appBar {
|
||||||
transition: background-color $transition-time-fast,
|
transition: background-color $transition-time-fast,
|
||||||
backdrop-filter $transition-time-fast,
|
backdrop-filter $transition-time-fast,
|
||||||
box-shadow $transition-time-default !important;
|
box-shadow $transition-time-default !important;
|
||||||
&.backdropVisible {
|
padding: 0.8em ($page-margin - 1.7em);
|
||||||
background-color: rgb(0 0 0 / 0.6) !important;
|
.flex {
|
||||||
backdrop-filter: blur(10px);
|
transition: $transition-time-fast;
|
||||||
|
border-radius: 1000px;
|
||||||
|
}
|
||||||
|
&.elevated{
|
||||||
|
.flex {
|
||||||
|
padding: 0.5em;
|
||||||
|
background: rgb(0 0 0 / 0.4);
|
||||||
|
backdrop-filter: blur(40px);
|
||||||
|
box-shadow: 0 0 15px rgb(0 0 0 / 0.2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&-avatar {
|
&-avatar {
|
||||||
background: rgb(255 255 255 / 0.1) !important;
|
background: rgb(255 255 255 / 0.1) !important;
|
||||||
@@ -30,8 +39,8 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
transform: scaleX(0);
|
transform: scaleX(0);
|
||||||
transition: transform $transition-time-fast,
|
transition: transform $transition-time-fast,
|
||||||
background $transition-time-fast,
|
background $transition-time-fast,
|
||||||
opacity $transition-time-fast;
|
opacity $transition-time-fast;
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
@@ -50,78 +59,44 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-library {
|
}
|
||||||
|
|
||||||
|
.library-drawer{
|
||||||
|
.library-drawer-item{
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 20rem;
|
overflow: hidden;
|
||||||
text-decoration: none;
|
border-radius: 1000px;
|
||||||
&::after {
|
> div::before{
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 5px;
|
top: 0;
|
||||||
background: rgb(0 0 0 / 0.3);
|
left: 0;
|
||||||
opacity: 0;
|
right: 0;
|
||||||
transition: opacity $transition-time-fast;
|
bottom: 0;
|
||||||
border-radius: 5px;
|
background: transparent;
|
||||||
|
transition: $transition-time-default;
|
||||||
|
z-index: -1;
|
||||||
|
border-radius: 100px;
|
||||||
}
|
}
|
||||||
> img {
|
}
|
||||||
border: 0px solid white;
|
.active.library-drawer-item {
|
||||||
width: inherit;
|
.material-symbols-rounded{
|
||||||
object-fit: cover;
|
--fill: 1;
|
||||||
height: 100%;
|
|
||||||
border-radius: 10px;
|
|
||||||
transition: border $transition-time-fast;
|
|
||||||
}
|
}
|
||||||
&-icon {
|
&> div::before {
|
||||||
height: 100%;
|
background: $clr-accent-default;
|
||||||
width: inherit;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
color: white !important;
|
|
||||||
background: rgb(255 255 255 / 0.1);
|
|
||||||
border: 0px solid white;
|
|
||||||
border-radius: 10px;
|
|
||||||
transition: border $transition-time-fast;
|
|
||||||
.material-symbols-rounded {
|
|
||||||
font-size: 3em;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
&.active {
|
}
|
||||||
&::after {
|
// Magic scrollbar
|
||||||
opacity: 1;
|
&::-webkit-scrollbar {
|
||||||
}
|
&-thumb {
|
||||||
> img {
|
height: 150px;
|
||||||
border: 5px solid white;
|
max-height: 33%;
|
||||||
}
|
|
||||||
.material-symbols-rounded {
|
|
||||||
font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 25,
|
|
||||||
"opsz" 40;
|
|
||||||
}
|
|
||||||
.appBar-library-icon {
|
|
||||||
border: 5px solid white;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
&-scrollContainer {
|
&-track {
|
||||||
display: flex;
|
margin-top: 15px;
|
||||||
max-width: 35vw;
|
margin-bottom: 15px;
|
||||||
overflow: auto;
|
background: transparent !important;
|
||||||
gap: 1em;
|
|
||||||
height: inherit;
|
|
||||||
padding: 15px;
|
|
||||||
|
|
||||||
// Magic scrollbar
|
|
||||||
&::-webkit-scrollbar {
|
|
||||||
&-thumb {
|
|
||||||
width: 150px;
|
|
||||||
max-width: 33%;
|
|
||||||
}
|
|
||||||
&-track {
|
|
||||||
margin-left: 25px;
|
|
||||||
margin-right: 25px;
|
|
||||||
background: transparent !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+190
-220
@@ -18,7 +18,13 @@ import useScrollTrigger from "@mui/material/useScrollTrigger";
|
|||||||
|
|
||||||
import { red } from "@mui/material/colors";
|
import { red } from "@mui/material/colors";
|
||||||
|
|
||||||
import { Link, NavLink, useLocation, useNavigate } from "react-router-dom";
|
import {
|
||||||
|
NavLink as NavLinkBase,
|
||||||
|
Link as RouterLink,
|
||||||
|
type LinkProps as RouterLinkProps,
|
||||||
|
useLocation,
|
||||||
|
useNavigate,
|
||||||
|
} from "react-router-dom";
|
||||||
|
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||||
@@ -35,27 +41,63 @@ import { useApi } from "../../utils/store/api";
|
|||||||
|
|
||||||
import { getTypeIcon } from "../utils/iconsCollection";
|
import { getTypeIcon } from "../utils/iconsCollection";
|
||||||
|
|
||||||
import { Divider } from "@mui/material";
|
|
||||||
import logo from "../../assets/icon.svg";
|
|
||||||
import {
|
import {
|
||||||
|
Divider,
|
||||||
|
Drawer,
|
||||||
|
List,
|
||||||
|
ListItem,
|
||||||
|
ListItemButton,
|
||||||
|
ListItemText,
|
||||||
|
} from "@mui/material";
|
||||||
|
import logo from "../../assets/icon.svg";
|
||||||
|
import useSettingsStore, {
|
||||||
setSettingsDialogOpen,
|
setSettingsDialogOpen,
|
||||||
setSettingsTabValue,
|
setSettingsTabValue,
|
||||||
} from "../../utils/store/settings";
|
} from "../../utils/store/settings";
|
||||||
|
|
||||||
const forwardRefNavLink = React.forwardRef({
|
interface ListItemLinkProps {
|
||||||
displayName: "NavLink",
|
icon?: React.ReactElement;
|
||||||
render: (props, ref) => (
|
primary: string;
|
||||||
<NavLink
|
to: string;
|
||||||
ref={ref}
|
}
|
||||||
to={props.to}
|
|
||||||
className={({ isActive }) =>
|
const NavLink = React.forwardRef((props, ref) => (
|
||||||
`${props.className} ${isActive ? props.activeClassName : ""}`
|
<NavLinkBase
|
||||||
}
|
ref={ref}
|
||||||
>
|
{...props}
|
||||||
{props.children}
|
style={{ textDecoration: "none" }}
|
||||||
</NavLink>
|
className={({ isActive }) =>
|
||||||
),
|
`${props.className} ${isActive ? props.activeClassName : ""}`
|
||||||
});
|
}
|
||||||
|
/>
|
||||||
|
));
|
||||||
|
|
||||||
|
function ListItemLink(props: ListItemLinkProps) {
|
||||||
|
const { icon, primary, to } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<li>
|
||||||
|
<ListItem
|
||||||
|
component={NavLink}
|
||||||
|
activeClassName="active"
|
||||||
|
className="library-drawer-item"
|
||||||
|
to={to}
|
||||||
|
>
|
||||||
|
<ListItemButton
|
||||||
|
style={{
|
||||||
|
borderRadius: "100px",
|
||||||
|
gap: "0.85em",
|
||||||
|
color: "white",
|
||||||
|
textDecoration: "none",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className="material-symbols-rounded">{icon}</div>
|
||||||
|
<ListItemText primary={primary} />
|
||||||
|
</ListItemButton>
|
||||||
|
</ListItem>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export const AppBar = () => {
|
export const AppBar = () => {
|
||||||
const [api] = useApi((state) => [state.api]);
|
const [api] = useApi((state) => [state.api]);
|
||||||
@@ -108,11 +150,8 @@ export const AppBar = () => {
|
|||||||
|
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const [setDrawerOpen] = useDrawerStore((state) => [state.setOpen]);
|
const [tabValue] = useSettingsStore((state) => [state.tabValue]);
|
||||||
|
|
||||||
const handleDrawerOpen = () => {
|
|
||||||
setDrawerOpen(true);
|
|
||||||
};
|
|
||||||
const handleLogout = async () => {
|
const handleLogout = async () => {
|
||||||
console.log("Logging out user...");
|
console.log("Logging out user...");
|
||||||
await api.logout();
|
await api.logout();
|
||||||
@@ -124,19 +163,6 @@ export const AppBar = () => {
|
|||||||
navigate("/login/index");
|
navigate("/login/index");
|
||||||
};
|
};
|
||||||
|
|
||||||
const [librariesPopper, setLibrariesPopper] = useState(false);
|
|
||||||
const librariesText = useRef(null);
|
|
||||||
|
|
||||||
const handlePopper = (event) => {
|
|
||||||
if (librariesPopper) {
|
|
||||||
setLibrariesPopper(null);
|
|
||||||
} else {
|
|
||||||
setLibrariesPopper(event.currentTarget);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const [isBrowsingLibrary, setIsBrowsingLibrary] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
location.pathname.includes("login") ||
|
location.pathname.includes("login") ||
|
||||||
@@ -156,202 +182,53 @@ export const AppBar = () => {
|
|||||||
} else {
|
} else {
|
||||||
setBackButtonVisible(true);
|
setBackButtonVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (location.pathname.includes("library")) {
|
|
||||||
setIsBrowsingLibrary(true);
|
|
||||||
} else {
|
|
||||||
setIsBrowsingLibrary(false);
|
|
||||||
}
|
|
||||||
}, [location]);
|
}, [location]);
|
||||||
|
|
||||||
|
const [showDrawer, setShowDrawer] = useState(false);
|
||||||
|
|
||||||
if (!display) {
|
if (!display) {
|
||||||
return <></>;
|
return <></>;
|
||||||
}
|
}
|
||||||
if (display) {
|
if (display) {
|
||||||
return (
|
return (
|
||||||
<MuiAppBar
|
<>
|
||||||
style={{
|
<MuiAppBar
|
||||||
backgroundColor: "transparent",
|
style={{
|
||||||
paddingRight: "0 !important",
|
backgroundColor: "transparent",
|
||||||
}}
|
paddingRight: "0 !important",
|
||||||
className={trigger ? "appBar backdropVisible" : "appBar"}
|
|
||||||
elevation={trigger ? 4 : 0}
|
|
||||||
color="transparent"
|
|
||||||
>
|
|
||||||
<Toolbar
|
|
||||||
sx={{
|
|
||||||
display: "grid",
|
|
||||||
gap: "0.6em",
|
|
||||||
gridTemplateColumns: "30% 1fr 30%",
|
|
||||||
}}
|
}}
|
||||||
|
className={
|
||||||
|
trigger
|
||||||
|
? "appBar flex flex-row flex-justify-spaced-between elevated"
|
||||||
|
: "appBar flex flex-row flex-justify-spaced-between"
|
||||||
|
}
|
||||||
|
elevation={0}
|
||||||
|
color="transparent"
|
||||||
>
|
>
|
||||||
<IconButton
|
<div className="flex flex-row" style={{ gap: "0.6em" }}>
|
||||||
onClick={() => navigate(-1)}
|
<IconButton onClick={() => setShowDrawer(true)}>
|
||||||
disabled={!backButtonVisible}
|
<div className="material-symbols-rounded">menu</div>
|
||||||
style={{
|
</IconButton>
|
||||||
justifySelf: "left",
|
<IconButton
|
||||||
}}
|
disabled={!backButtonVisible}
|
||||||
>
|
onClick={() => navigate(-1)}
|
||||||
<div className="material-symbols-rounded">arrow_back</div>
|
|
||||||
</IconButton>
|
|
||||||
|
|
||||||
<div
|
|
||||||
className="flex flex-row flex-center"
|
|
||||||
style={{
|
|
||||||
gap: "2.6em",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<NavLink to="/home">
|
|
||||||
{({ isActive }) =>
|
|
||||||
isActive ? (
|
|
||||||
<Button
|
|
||||||
style={{
|
|
||||||
textTransform: "none",
|
|
||||||
}}
|
|
||||||
size="large"
|
|
||||||
className="appBar-text active"
|
|
||||||
>
|
|
||||||
<Typography variant="subtitle1" fontWeight={600}>
|
|
||||||
Home
|
|
||||||
</Typography>
|
|
||||||
</Button>
|
|
||||||
) : (
|
|
||||||
<Button
|
|
||||||
style={{
|
|
||||||
textTransform: "none",
|
|
||||||
}}
|
|
||||||
className="appBar-text"
|
|
||||||
size="large"
|
|
||||||
color="white"
|
|
||||||
>
|
|
||||||
<Typography variant="subtitle1" fontWeight={600}>
|
|
||||||
Home
|
|
||||||
</Typography>
|
|
||||||
</Button>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</NavLink>
|
|
||||||
<Button
|
|
||||||
variant="text"
|
|
||||||
// disableRipple
|
|
||||||
disableElevation
|
|
||||||
onClick={handlePopper}
|
|
||||||
style={{ textTransform: "none" }}
|
|
||||||
size="large"
|
|
||||||
disableFocusRipple={false}
|
|
||||||
color={isBrowsingLibrary ? "primary" : "white"}
|
|
||||||
className={
|
|
||||||
isBrowsingLibrary ? "appBar-text active" : "appBar-text"
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<Typography variant="subtitle1" fontWeight={600}>
|
<div className="material-symbols-rounded">arrow_back</div>
|
||||||
Libraries
|
</IconButton>
|
||||||
</Typography>
|
<IconButton onClick={() => navigate("/home")}>
|
||||||
</Button>
|
<div
|
||||||
{/* <Typography
|
className={
|
||||||
variant="subtitle1"
|
location.pathname === "/home"
|
||||||
fontWeight={600}
|
? "material-symbols-rounded fill"
|
||||||
onMouseEnter={popoverEnter}
|
: "material-symbols-rounded"
|
||||||
onFocus={popoverEnter}
|
}
|
||||||
tabIndex={0}
|
>
|
||||||
className={
|
home
|
||||||
isBrowsingLibrary
|
</div>
|
||||||
? "appBar-text active"
|
</IconButton>
|
||||||
: "appBar-text"
|
|
||||||
}
|
|
||||||
// onMouseLeave={popoverLeave}
|
|
||||||
></Typography> */}
|
|
||||||
|
|
||||||
<Popper
|
|
||||||
open={Boolean(librariesPopper)}
|
|
||||||
anchorEl={librariesPopper}
|
|
||||||
placement="bottom"
|
|
||||||
disablePortal
|
|
||||||
modifiers={[
|
|
||||||
{
|
|
||||||
name: "flip",
|
|
||||||
enabled: true,
|
|
||||||
options: {
|
|
||||||
altBoundary: true,
|
|
||||||
rootBoundary: "document",
|
|
||||||
padding: 8,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "preventOverflow",
|
|
||||||
enabled: true,
|
|
||||||
options: {
|
|
||||||
altAxis: true,
|
|
||||||
altBoundary: true,
|
|
||||||
tether: true,
|
|
||||||
rootBoundary: "document",
|
|
||||||
padding: 8,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
transition
|
|
||||||
>
|
|
||||||
{({ TransitionProps }) => (
|
|
||||||
<Grow
|
|
||||||
{...TransitionProps}
|
|
||||||
style={{
|
|
||||||
transformOrigin: "50% 0 0",
|
|
||||||
}}
|
|
||||||
timeout={250}
|
|
||||||
>
|
|
||||||
<Paper
|
|
||||||
sx={{
|
|
||||||
mt: "1.1em",
|
|
||||||
maxHeight: "72em",
|
|
||||||
}}
|
|
||||||
style={{
|
|
||||||
boxShadow:
|
|
||||||
"0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12)",
|
|
||||||
overflow: "hidden",
|
|
||||||
borderRadius: "25px",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<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
|
|
||||||
alt={library.Name}
|
|
||||||
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>
|
|
||||||
)}
|
|
||||||
</Popper>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div className="flex flex-row" style={{ gap: "0.6em" }}>
|
||||||
className="flex flex-row"
|
|
||||||
style={{ justifySelf: "right", gap: "0.6em" }}
|
|
||||||
>
|
|
||||||
<IconButton onClick={() => navigate("/search")}>
|
<IconButton onClick={() => navigate("/search")}>
|
||||||
<div className="material-symbols-rounded">search</div>
|
<div className="material-symbols-rounded">search</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
@@ -423,8 +300,101 @@ export const AppBar = () => {
|
|||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
</div>
|
</div>
|
||||||
</Toolbar>
|
</MuiAppBar>
|
||||||
</MuiAppBar>
|
<Drawer
|
||||||
|
open={showDrawer}
|
||||||
|
PaperProps={{
|
||||||
|
className: "glass library-drawer",
|
||||||
|
style: {
|
||||||
|
width: "20em",
|
||||||
|
margin: "1.4em",
|
||||||
|
height: "calc(100vh - 2.8em)",
|
||||||
|
borderRadius: "20px",
|
||||||
|
overflowX: "hidden",
|
||||||
|
overflowY: "auto",
|
||||||
|
border: "1.2px solid rgb(255 255 255 / 0.2)",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
className="library-drawer"
|
||||||
|
onClose={() => setShowDrawer(false)}
|
||||||
|
>
|
||||||
|
<List>
|
||||||
|
<ListItem>
|
||||||
|
<ListItemButton
|
||||||
|
onClick={() => setShowDrawer(false)}
|
||||||
|
style={{
|
||||||
|
borderRadius: "100px",
|
||||||
|
gap: "0.85em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span className="material-symbols-rounded">menu_open</span>
|
||||||
|
Close
|
||||||
|
</ListItemButton>
|
||||||
|
</ListItem>
|
||||||
|
</List>
|
||||||
|
<Divider variant="middle" />
|
||||||
|
<List>
|
||||||
|
<ListItemLink to="/home" icon="home" primary="Home" />
|
||||||
|
{libraries.isSuccess &&
|
||||||
|
libraries.data.Items?.map((library, index) => (
|
||||||
|
<ListItemLink
|
||||||
|
key={library.Id}
|
||||||
|
to={`/library/${library.Id}`}
|
||||||
|
icon={getTypeIcon(library.CollectionType)}
|
||||||
|
primary={library.Name}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</List>
|
||||||
|
<Divider variant="middle" />
|
||||||
|
<List>
|
||||||
|
<ListItem>
|
||||||
|
<ListItemButton
|
||||||
|
onClick={() => {
|
||||||
|
setSettingsDialogOpen(true);
|
||||||
|
setSettingsTabValue(1);
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
borderRadius: "100px",
|
||||||
|
gap: "0.85em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span className="material-symbols-rounded">settings</span>
|
||||||
|
Settings
|
||||||
|
</ListItemButton>
|
||||||
|
</ListItem>
|
||||||
|
<ListItem>
|
||||||
|
<ListItemButton
|
||||||
|
onClick={() => {
|
||||||
|
setSettingsDialogOpen(true);
|
||||||
|
setSettingsTabValue(2);
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
borderRadius: "100px",
|
||||||
|
gap: "0.85em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span className="material-symbols-rounded">dns</span>
|
||||||
|
Change Server
|
||||||
|
</ListItemButton>
|
||||||
|
</ListItem>
|
||||||
|
<ListItem>
|
||||||
|
<ListItemButton
|
||||||
|
onClick={() => {
|
||||||
|
setSettingsDialogOpen(true);
|
||||||
|
setSettingsTabValue(10);
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
borderRadius: "100px",
|
||||||
|
gap: "0.85em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span className="material-symbols-rounded">info</span>
|
||||||
|
About
|
||||||
|
</ListItemButton>
|
||||||
|
</ListItem>
|
||||||
|
</List>
|
||||||
|
</Drawer>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -17,6 +17,7 @@ import {
|
|||||||
SortOrder,
|
SortOrder,
|
||||||
type UserItemDataDto,
|
type UserItemDataDto,
|
||||||
} from "@jellyfin/sdk/lib/generated-client";
|
} from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
import { getDlnaApi } from "@jellyfin/sdk/lib/utils/api/dlna-api";
|
||||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||||
import { getPlaylistsApi } from "@jellyfin/sdk/lib/utils/api/playlists-api";
|
import { getPlaylistsApi } from "@jellyfin/sdk/lib/utils/api/playlists-api";
|
||||||
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||||
@@ -135,6 +136,8 @@ const PlayButton = ({
|
|||||||
mutationFn: async () => {
|
mutationFn: async () => {
|
||||||
setPlaybackDataLoading(true);
|
setPlaybackDataLoading(true);
|
||||||
let result: any;
|
let result: any;
|
||||||
|
const deviceProfile = await getDlnaApi(api).getDefaultProfile();
|
||||||
|
console.log(deviceProfile);
|
||||||
if (playlistItem) {
|
if (playlistItem) {
|
||||||
result = await getPlaylistsApi(api).getPlaylistItems({
|
result = await getPlaylistsApi(api).getPlaylistItems({
|
||||||
userId: userId,
|
userId: userId,
|
||||||
@@ -246,31 +249,32 @@ const PlayButton = ({
|
|||||||
enableSubtitles = false;
|
enableSubtitles = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
playItem(
|
// playItem(
|
||||||
itemName,
|
// itemName,
|
||||||
episodeTitle,
|
// episodeTitle,
|
||||||
currentVideoTrack,
|
// currentVideoTrack,
|
||||||
currentAudioTrack,
|
// currentAudioTrack,
|
||||||
selectedSubtitleTrack,
|
// selectedSubtitleTrack,
|
||||||
result.Items[0].Container,
|
// result.Items[0].Container,
|
||||||
enableSubtitles,
|
// enableSubtitles,
|
||||||
`${api.basePath}/Videos/${result.Items[0].Id}/stream.${result.Items[0].Container}?Static=true&mediaSourceId=${result.Items[0].Id}&deviceId=${api.deviceInfo.id}&api_key=${api.accessToken}&Tag=${result.Items[0].MediaSources[0].ETag}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`,
|
// `${api.basePath}/Videos/${result.Items[0].Id}/stream.${result.Items[0].Container}?Static=true&mediaSourceId=${result.Items[0].Id}&deviceId=${api.deviceInfo.id}&api_key=${api.accessToken}&Tag=${result.Items[0].MediaSources[0].ETag}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`,
|
||||||
userId,
|
// userId,
|
||||||
result?.Items[0].UserData?.PlaybackPositionTicks,
|
// result?.Items[0].UserData?.PlaybackPositionTicks,
|
||||||
result.Items[0].RunTimeTicks,
|
// result.Items[0].RunTimeTicks,
|
||||||
result.Items[0],
|
// result.Items[0],
|
||||||
queue,
|
// queue,
|
||||||
0,
|
// 0,
|
||||||
subtitles,
|
// subtitles,
|
||||||
result?.Items[0].MediaSources[0].Id,
|
// result?.Items[0].MediaSources[0].Id,
|
||||||
);
|
// );
|
||||||
navigate("/player");
|
// navigate("/player");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSettled: () => {
|
onSettled: () => {
|
||||||
setPlaybackDataLoading(false);
|
setPlaybackDataLoading(false);
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
|
console.error(error);
|
||||||
enqueueSnackbar(`${error}`, {
|
enqueueSnackbar(`${error}`, {
|
||||||
variant: "error",
|
variant: "error",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import { createApi, useApi } from "../../utils/store/api";
|
|||||||
import { useCentralStore } from "../../utils/store/central";
|
import { useCentralStore } from "../../utils/store/central";
|
||||||
import "./settings.module.scss";
|
import "./settings.module.scss";
|
||||||
|
|
||||||
import { RecommendedServerInfo } from "@jellyfin/sdk";
|
import type { RecommendedServerInfo } from "@jellyfin/sdk";
|
||||||
import { LoadingButton } from "@mui/lab";
|
import { LoadingButton } from "@mui/lab";
|
||||||
import { red, yellow } from "@mui/material/colors";
|
import { red, yellow } from "@mui/material/colors";
|
||||||
import { relaunch } from "@tauri-apps/api/process";
|
import { relaunch } from "@tauri-apps/api/process";
|
||||||
@@ -194,7 +194,7 @@ const Settings = () => {
|
|||||||
fullWidth
|
fullWidth
|
||||||
maxWidth="md"
|
maxWidth="md"
|
||||||
PaperProps={{
|
PaperProps={{
|
||||||
className: "settings",
|
className: "settings glass",
|
||||||
}}
|
}}
|
||||||
onClose={() => setSettingsDialogOpen(false)}
|
onClose={() => setSettingsDialogOpen(false)}
|
||||||
>
|
>
|
||||||
@@ -205,7 +205,7 @@ const Settings = () => {
|
|||||||
setSettingsTabValue(newValue);
|
setSettingsTabValue(newValue);
|
||||||
}}
|
}}
|
||||||
style={{
|
style={{
|
||||||
borderRight: "1.2px solid rgb(255 255 255 / 0.1)",
|
background: "rgb(0 0 0 / 0.6)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Tab
|
<Tab
|
||||||
@@ -679,8 +679,8 @@ const Settings = () => {
|
|||||||
{updateInfo.isFetching
|
{updateInfo.isFetching
|
||||||
? "Checking for new updates..."
|
? "Checking for new updates..."
|
||||||
: updateInfo.data?.shouldUpdate
|
: updateInfo.data?.shouldUpdate
|
||||||
? updateInfo.data.manifest?.version
|
? updateInfo.data.manifest?.version
|
||||||
: "No update found."}
|
: "No update found."}
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
@@ -708,8 +708,8 @@ const Settings = () => {
|
|||||||
{updateInfo.isFetching
|
{updateInfo.isFetching
|
||||||
? "Checking for Update..."
|
? "Checking for Update..."
|
||||||
: updateInfo.data?.shouldUpdate
|
: updateInfo.data?.shouldUpdate
|
||||||
? "Update"
|
? "Update"
|
||||||
: "No Update Found"}
|
: "No Update Found"}
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
</div>
|
</div>
|
||||||
{systemInfo.isSuccess ? (
|
{systemInfo.isSuccess ? (
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ h1 {
|
|||||||
.flex {
|
.flex {
|
||||||
display: flex;
|
display: flex;
|
||||||
&-row {
|
&-row {
|
||||||
flex-direction: row;
|
flex-direction: row !important;
|
||||||
}
|
}
|
||||||
&-column {
|
&-column {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -288,4 +288,9 @@ h1 {
|
|||||||
|
|
||||||
.fullWidth {
|
.fullWidth {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.glass {
|
||||||
|
background: rgb(0 0 0 / 0.4) !important;
|
||||||
|
backdrop-filter: blur(40px);
|
||||||
}
|
}
|
||||||
+10
-5
@@ -55,8 +55,6 @@ export const theme = createTheme({
|
|||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
paper: {
|
paper: {
|
||||||
borderRadius: "10px",
|
borderRadius: "10px",
|
||||||
background: "hsl(256, 100%, 2%, 40%)",
|
|
||||||
backdropFilter: "blur(20px)",
|
|
||||||
border: "1px solid rgb(255 255 255 / 0.1)",
|
border: "1px solid rgb(255 255 255 / 0.1)",
|
||||||
},
|
},
|
||||||
list: {
|
list: {
|
||||||
@@ -65,6 +63,11 @@ export const theme = createTheme({
|
|||||||
},
|
},
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
disableScrollLock: true,
|
disableScrollLock: true,
|
||||||
|
slotProps: {
|
||||||
|
paper: {
|
||||||
|
className: "glass",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
MuiMenuItem: {
|
MuiMenuItem: {
|
||||||
@@ -79,9 +82,11 @@ export const theme = createTheme({
|
|||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
paper: {
|
paper: {
|
||||||
borderRadius: "20px",
|
borderRadius: "20px",
|
||||||
background: "rgb(0 0 0 / 0.5)",
|
},
|
||||||
backdropFilter: "blur(10px)",
|
},
|
||||||
border: "1px solid rgb(255 255 255 / 0.2)",
|
defaultProps: {
|
||||||
|
PaperProps: {
|
||||||
|
className: "glass",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user