diff --git a/src-tauri/capabilities/main.json b/src-tauri/capabilities/main.json
index 5cade4f..9c1089a 100644
--- a/src-tauri/capabilities/main.json
+++ b/src-tauri/capabilities/main.json
@@ -18,6 +18,7 @@
"notification:default",
"core:webview:allow-internal-toggle-devtools",
"core:window:allow-start-dragging",
+ "core:window:allow-start-resize-dragging",
"core:window:allow-minimize",
"core:window:allow-maximize",
"core:window:allow-unmaximize",
diff --git a/src-tauri/gen/schemas/capabilities.json b/src-tauri/gen/schemas/capabilities.json
index b39b89a..255252f 100644
--- a/src-tauri/gen/schemas/capabilities.json
+++ b/src-tauri/gen/schemas/capabilities.json
@@ -1 +1 @@
-{"desktop-capability":{"identifier":"desktop-capability","description":"","local":true,"windows":["main"],"permissions":["window-state:default","global-shortcut:default","global-shortcut:allow-is-registered","global-shortcut:allow-register","global-shortcut:allow-unregister","shell:default"],"platforms":["macOS","windows","linux"]},"main-capabilities":{"identifier":"main-capabilities","description":"Capability for desktop window","local":true,"windows":["main"],"permissions":["store:allow-get","store:allow-set","store:allow-save","store:allow-clear","store:allow-delete","store:allow-keys","store:allow-load","updater:allow-check","updater:allow-download-and-install","updater:allow-download","updater:allow-install","notification:default","core:webview:allow-internal-toggle-devtools","core:window:allow-start-dragging","core:window:allow-minimize","core:window:allow-maximize","core:window:allow-unmaximize","core:window:allow-toggle-maximize","core:window:allow-close","core:window:allow-is-maximized","dialog:default","upload:allow-download","clipboard-manager:allow-write-text","shell:default","shell:allow-open"]},"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["core:path:default","core:event:default","core:window:default","core:app:default","core:resources:default","core:menu:default","core:tray:default","core:window:allow-set-fullscreen","shell:default"]}}
\ No newline at end of file
+{"desktop-capability":{"identifier":"desktop-capability","description":"","local":true,"windows":["main"],"permissions":["window-state:default","global-shortcut:default","global-shortcut:allow-is-registered","global-shortcut:allow-register","global-shortcut:allow-unregister","shell:default"],"platforms":["macOS","windows","linux"]},"main-capabilities":{"identifier":"main-capabilities","description":"Capability for desktop window","local":true,"windows":["main"],"permissions":["store:allow-get","store:allow-set","store:allow-save","store:allow-clear","store:allow-delete","store:allow-keys","store:allow-load","updater:allow-check","updater:allow-download-and-install","updater:allow-download","updater:allow-install","notification:default","core:webview:allow-internal-toggle-devtools","core:window:allow-start-dragging","core:window:allow-start-resize-dragging","core:window:allow-minimize","core:window:allow-maximize","core:window:allow-unmaximize","core:window:allow-toggle-maximize","core:window:allow-close","core:window:allow-is-maximized","dialog:default","upload:allow-download","clipboard-manager:allow-write-text","shell:default","shell:allow-open"]},"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["core:path:default","core:event:default","core:window:default","core:app:default","core:resources:default","core:menu:default","core:tray:default","core:window:allow-set-fullscreen","shell:default"]}}
\ No newline at end of file
diff --git a/src/components/card/card.tsx b/src/components/card/card.tsx
index acf9121..874684b 100644
--- a/src/components/card/card.tsx
+++ b/src/components/card/card.tsx
@@ -6,7 +6,7 @@ import {
type ImageType,
} from "@jellyfin/sdk/lib/generated-client";
import { useNavigate } from "@tanstack/react-router";
-import React, { memo, type Ref, useCallback, useState } from "react";
+import React, { memo, type Ref, useCallback } from "react";
import { ErrorBoundary } from "react-error-boundary";
import { useInView } from "react-intersection-observer";
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
@@ -110,6 +110,7 @@ const CardContent = ({
{image && (
{imageUrl ? (
-
+
) : (
diff --git a/src/components/carouselSlide/index.tsx b/src/components/carouselSlide/index.tsx
index f9cc708..efa0d6c 100644
--- a/src/components/carouselSlide/index.tsx
+++ b/src/components/carouselSlide/index.tsx
@@ -102,6 +102,7 @@ const CarouselSlide = ({ item }: { item: BaseItemDto }) => {
className={`hero-carousel-background-image${heroArtwork.isPortrait ? " is-poster" : ""}`}
src={heroArtwork.url}
loading="eager"
+ decoding="async"
/>
) : (
diff --git a/src/components/listItemLink/index.tsx b/src/components/listItemLink/index.tsx
index be2f5dd..706ccbf 100644
--- a/src/components/listItemLink/index.tsx
+++ b/src/components/listItemLink/index.tsx
@@ -4,7 +4,7 @@ import {
type ListItemProps,
ListItemText,
} from "@mui/material";
-import { createLink, Link } from "@tanstack/react-router";
+import { createLink } from "@tanstack/react-router";
import React, { forwardRef, type ReactNode } from "react";
interface MUIListItemLinkProps extends ListItemProps<"a"> {
diff --git a/src/components/nProgress/index.tsx b/src/components/nProgress/index.tsx
index a4ac740..6b3a1d7 100644
--- a/src/components/nProgress/index.tsx
+++ b/src/components/nProgress/index.tsx
@@ -3,7 +3,6 @@ import { useNProgress } from "@tanem/react-nprogress";
import { useIsFetching, useIsMutating } from "@tanstack/react-query";
import { useRouterState } from "@tanstack/react-router";
import React, { useMemo } from "react";
-import { createPortal } from "react-dom";
export default function NProgress() {
const isQueryFetching = useIsFetching();
diff --git a/src/components/playback/videoPlayer/bubbleSlider/index.tsx b/src/components/playback/videoPlayer/bubbleSlider/index.tsx
index d6a6e17..60f7642 100644
--- a/src/components/playback/videoPlayer/bubbleSlider/index.tsx
+++ b/src/components/playback/videoPlayer/bubbleSlider/index.tsx
@@ -195,9 +195,6 @@ const BubbleSlider = () => {
};
const imgUrlParams = new URLSearchParams(imgUrlParamsObject).toString();
- const _imageAspectRatio =
- trickplayResolution.Width / trickplayResolution.Height;
-
trickplayStyle = {
backgroundImage: `url(${api?.basePath}/Videos/${itemId}/Trickplay/${trickplayResolution.Width}/${index}.jpg?${imgUrlParams})`,
backgroundPositionX: `${backgroundOffsetX}px`,
diff --git a/src/components/playback/videoPlayer/buttons/SkipSegmentButton.tsx b/src/components/playback/videoPlayer/buttons/SkipSegmentButton.tsx
index 1a54b91..22531b7 100644
--- a/src/components/playback/videoPlayer/buttons/SkipSegmentButton.tsx
+++ b/src/components/playback/videoPlayer/buttons/SkipSegmentButton.tsx
@@ -1,4 +1,4 @@
-import { Box, Button } from "@mui/material";
+import { Button } from "@mui/material";
import { AnimatePresence, motion } from "motion/react";
import React from "react";
import { useShallow } from "zustand/shallow";
diff --git a/src/components/skeleton/libraryItems.tsx b/src/components/skeleton/libraryItems.tsx
index a529784..a4455ff 100644
--- a/src/components/skeleton/libraryItems.tsx
+++ b/src/components/skeleton/libraryItems.tsx
@@ -13,7 +13,7 @@ const LibraryItemsSkeleton = () => {
justifyContent: "center",
}}
>
- {Array.from(new Array(18)).map((item, index) => (
+ {Array.from(new Array(18)).map((_, index) => (
= [
+ { className: "n", direction: "North" },
+ { className: "s", direction: "South" },
+ { className: "e", direction: "East" },
+ { className: "w", direction: "West" },
+ { className: "ne", direction: "NorthEast" },
+ { className: "nw", direction: "NorthWest" },
+ { className: "se", direction: "SouthEast" },
+ { className: "sw", direction: "SouthWest" },
+];
+
+/**
+ * Edge/corner resize handles for the frameless Windows/Linux window. Native
+ * decorations are removed there, so the OS no longer gives us resize borders.
+ */
+const WindowResizeHandles = () => {
+ if (isMac) return null;
+
+ return (
+
+ {handles.map(({ className, direction }) => (
+
{
+ if (event.button !== 0) return;
+ event.preventDefault();
+ getCurrentWindow()
+ .startResizeDragging(direction)
+ .catch((error) =>
+ console.warn("Could not resize window", error),
+ );
+ }}
+ />
+ ))}
+
+ );
+};
+
+export default WindowResizeHandles;
diff --git a/src/components/windowControls/windowControls.scss b/src/components/windowControls/windowControls.scss
index 9e63053..fb1a56f 100644
--- a/src/components/windowControls/windowControls.scss
+++ b/src/components/windowControls/windowControls.scss
@@ -47,6 +47,82 @@ html.is-linux body.has-window-chrome #root {
padding-top: 44px;
}
+.window-resize-handles {
+ position: fixed;
+ inset: 0;
+ z-index: 10002;
+ pointer-events: none;
+}
+
+.window-resize-handle {
+ position: absolute;
+ pointer-events: auto;
+
+ &.n,
+ &.s {
+ left: 8px;
+ right: 8px;
+ height: 6px;
+ cursor: ns-resize;
+ }
+
+ &.n {
+ top: 0;
+ }
+
+ &.s {
+ bottom: 0;
+ }
+
+ &.e,
+ &.w {
+ top: 8px;
+ bottom: 8px;
+ width: 6px;
+ cursor: ew-resize;
+ }
+
+ &.e {
+ right: 0;
+ }
+
+ &.w {
+ left: 0;
+ }
+
+ &.ne,
+ &.nw,
+ &.se,
+ &.sw {
+ width: 10px;
+ height: 10px;
+ }
+
+ &.ne {
+ top: 0;
+ right: 0;
+ cursor: nesw-resize;
+ }
+
+ &.nw {
+ top: 0;
+ left: 0;
+ cursor: nwse-resize;
+ }
+
+ &.se {
+ bottom: 0;
+ right: 0;
+ cursor: nwse-resize;
+ }
+
+ &.sw {
+ bottom: 0;
+ left: 0;
+ cursor: nesw-resize;
+ }
+}
+
.window-chrome {
position: fixed;
inset: 0 0 auto;
diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx
index 4e0a2ab..689e598 100644
--- a/src/routes/__root.tsx
+++ b/src/routes/__root.tsx
@@ -31,6 +31,7 @@ import RouterLoading from "@/components/routerLoading";
import Search from "@/components/search";
import Updater from "@/components/updater";
import WindowChrome from "@/components/windowControls/windowChrome";
+import WindowResizeHandles from "@/components/windowControls/resizeHandles";
type ApiContext = {
api: Api | undefined;
@@ -58,6 +59,7 @@ export const Route = createRootRouteWithContext
()({
+
diff --git a/src/routes/_api/library/$id.tsx b/src/routes/_api/library/$id.tsx
index 9e54506..717db21 100644
--- a/src/routes/_api/library/$id.tsx
+++ b/src/routes/_api/library/$id.tsx
@@ -64,18 +64,15 @@ function Library() {
const currentLib = useSuspenseQuery(
getLibraryQueryOptions(api, user?.Id, id),
);
- const _initLibrary = useLibraryStateStore((s) => s.initLibrary);
const updateLibrary = useLibraryStateStore((s) => s.updateLibrary);
- const { currentViewType: storeViewType, libraryName: storeLibraryName } =
- useLibraryStateStore(
- useShallow((s) => {
- const sl = s.libraries[id || ""];
- return {
- currentViewType: sl?.currentViewType,
- libraryName: sl?.libraryName,
- } as const;
- }),
- );
+ const { libraryName: storeLibraryName } = useLibraryStateStore(
+ useShallow((s) => {
+ const sl = s.libraries[id || ""];
+ return {
+ libraryName: sl?.libraryName,
+ } as const;
+ }),
+ );
React.useEffect(() => {
if (!id || !currentLib.data) return;
diff --git a/src/routes/_api/search/index.tsx b/src/routes/_api/search/index.tsx
index 214c702..03806dd 100644
--- a/src/routes/_api/search/index.tsx
+++ b/src/routes/_api/search/index.tsx
@@ -381,8 +381,6 @@ function SearchResultsList({ categories, query, api, user }: any) {
// Let's use a timeout or assume if no results update to true after X time.
- const _hasAnyResults = Object.values(resultsStatus).some((v) => v);
-
return (
{categories.map((cat: any) => (
diff --git a/src/routes/_api/settings.tsx b/src/routes/_api/settings.tsx
index 149ff36..c99b73b 100644
--- a/src/routes/_api/settings.tsx
+++ b/src/routes/_api/settings.tsx
@@ -3,7 +3,7 @@ import React, { useCallback, useEffect } from "react";
import { useBackdropStore } from "@/utils/store/backdrop";
import "./settings.scss";
-import { Divider, IconButton, List, Typography } from "@mui/material";
+import { IconButton, List, Typography } from "@mui/material";
import { useShallow } from "zustand/shallow";
import BackButton from "@/components/buttons/backButton";
import ListItemLink from "@/components/listItemLink";
diff --git a/src/routes/_api/settings/changeServer/index.tsx b/src/routes/_api/settings/changeServer/index.tsx
index 3ccedf5..3add1a8 100644
--- a/src/routes/_api/settings/changeServer/index.tsx
+++ b/src/routes/_api/settings/changeServer/index.tsx
@@ -1,14 +1,11 @@
import {
- alpha,
Button,
Card,
CardActions,
CardContent,
Chip,
Grid,
- IconButton,
Typography,
- useTheme,
} from "@mui/material";
import { useQuery, useQueryClient } from "@tanstack/react-query";
import { createFileRoute } from "@tanstack/react-router";
@@ -30,7 +27,6 @@ export const Route = createFileRoute("/_api/settings/changeServer/")({
});
function ChangeServerRoute() {
- const _theme = useTheme();
const queryClient = useQueryClient();
const createApi = useApiInContext((s) => s.createApi);
const { enqueueSnackbar } = useSnackbar();
diff --git a/src/routes/setup/server.add.tsx b/src/routes/setup/server.add.tsx
index 31435da..50be965 100644
--- a/src/routes/setup/server.add.tsx
+++ b/src/routes/setup/server.add.tsx
@@ -1,6 +1,5 @@
import LoadingButton from "@mui/lab/LoadingButton";
import { yellow } from "@mui/material/colors";
-import Grid from "@mui/material/Grid";
import TextField from "@mui/material/TextField";
import Typography from "@mui/material/Typography";
import { useMutation } from "@tanstack/react-query";
diff --git a/src/utils/hooks/useDefaultSeason.ts b/src/utils/hooks/useDefaultSeason.ts
index 1fe0ce6..ca47786 100644
--- a/src/utils/hooks/useDefaultSeason.ts
+++ b/src/utils/hooks/useDefaultSeason.ts
@@ -1,5 +1,5 @@
import type { BaseItemDtoQueryResult } from "@jellyfin/sdk/lib/generated-client";
-import type { UseQueryResult, useQuery } from "@tanstack/react-query";
+import type { UseQueryResult } from "@tanstack/react-query";
import type React from "react";
import { useEffect, useState } from "react";
diff --git a/src/utils/store/central.tsx b/src/utils/store/central.tsx
index 12d321b..f080f14 100644
--- a/src/utils/store/central.tsx
+++ b/src/utils/store/central.tsx
@@ -54,13 +54,14 @@ const CentralContext = createContext>(null!);
export const CentralProvider = ({ children }: { children: ReactNode }) => {
const [store] = useState(() =>
createStore()((set) => ({
- defaultServerOnDisk: async () => await getDefaultServer(),
+ defaultServerOnDisk: async () => (await getDefaultServer()) ?? null,
defaultServerInfoOnDisk: async () => {
const a = await getDefaultServer();
- return await getServer(a);
+ if (!a) return undefined;
+ return (await getServer(a)) ?? undefined;
},
allServersOnDisk: async () => await getAllServers(),
- userOnDisk: async () => await getUser(),
+ userOnDisk: async () => (await getUser()) ?? null,
clientVersion: version,
currentUser: null,
fetchCurrentUser: async (api) => {
diff --git a/src/utils/types/playResult.ts b/src/utils/types/playResult.ts
index 5fa9834..0ce808a 100644
--- a/src/utils/types/playResult.ts
+++ b/src/utils/types/playResult.ts
@@ -3,7 +3,6 @@ import type {
MediaSegmentDtoQueryResult,
PlaybackInfoResponse,
} from "@jellyfin/sdk/lib/generated-client";
-import type IntroMediaInfo from "./introMediaInfo";
interface PlayResult {
item: BaseItemDtoQueryResult | undefined;