Merge remote-tracking branch 'upstream/main' into feat/double-click-fullscreen
# Conflicts: # src-tauri/Cargo.toml # src/routes/_api/player/index.tsx
No files matched your search
@@ -1,357 +0,0 @@
|
||||
import React, { useState, useEffect, useLayoutEffect } from "react";
|
||||
|
||||
import { ThemeProvider } from "@mui/material/styles";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
import { SnackbarProvider } from "notistack";
|
||||
import {
|
||||
Navigate,
|
||||
Route,
|
||||
Routes,
|
||||
useLocation,
|
||||
useNavigate,
|
||||
} from "react-router-dom";
|
||||
|
||||
import { relaunch } from "@tauri-apps/api/process";
|
||||
import {
|
||||
type UpdateManifest,
|
||||
checkUpdate,
|
||||
installUpdate,
|
||||
} from "@tauri-apps/api/updater";
|
||||
|
||||
// Theming
|
||||
import CssBaseline from "@mui/material/CssBaseline";
|
||||
import "./styles/global.scss";
|
||||
import { theme } from "./theme";
|
||||
|
||||
import LoadingButton from "@mui/lab/LoadingButton";
|
||||
import Button from "@mui/material/Button";
|
||||
|
||||
// MUI
|
||||
import {
|
||||
Chip,
|
||||
Dialog,
|
||||
DialogActions,
|
||||
DialogContent,
|
||||
DialogContentText,
|
||||
DialogTitle,
|
||||
IconButton,
|
||||
LinearProgress,
|
||||
SvgIcon,
|
||||
} from "@mui/material";
|
||||
|
||||
// Routes
|
||||
import About from "./routes/_about";
|
||||
import MusicAlbumTitlePage from "./routes/album/$id.js";
|
||||
import ArtistTitlePage from "./routes/artist/$id.js";
|
||||
import BoxSetTitlePage from "./routes/boxset/$id.js";
|
||||
import EpisodeTitlePage from "./routes/episode/$id";
|
||||
import FavoritePage from "./routes/favorite/index.jsx";
|
||||
import Home from "./routes/home";
|
||||
import ItemDetail from "./routes/item/$id";
|
||||
import LibraryView from "./routes/library";
|
||||
import {
|
||||
LoginRoute,
|
||||
LoginWithImage,
|
||||
UserLogin,
|
||||
UserLoginManual,
|
||||
} from "./routes/login";
|
||||
import PersonTitlePage from "./routes/person/$id.jsx";
|
||||
import VideoPlayer from "./routes/player/videoPlayer";
|
||||
import PlaylistTitlePage from "./routes/playlist/$id.jsx";
|
||||
import SearchPage from "./routes/search";
|
||||
import SeriesTitlePage from "./routes/series/$id.js";
|
||||
import { ServerSetup } from "./routes/setup/server.add";
|
||||
import ServerList from "./routes/setup/server.list.js";
|
||||
|
||||
import Markdown from "react-markdown";
|
||||
import remarkGfm from "remark-gfm";
|
||||
|
||||
|
||||
// Components
|
||||
import { AppBar } from "./components/appBar/appBar.jsx";
|
||||
import { ErrorNotice } from "./components/notices/errorNotice/errorNotice.jsx";
|
||||
import AudioPlayer from "./components/playback/audioPlayer/index.jsx";
|
||||
|
||||
// Utils
|
||||
import { useAudioPlayback } from "./utils/store/audioPlayback.js";
|
||||
import { useBackdropStore } from "./utils/store/backdrop.js";
|
||||
import { setInitialRoute, useCentralStore } from "./utils/store/central.js";
|
||||
import {
|
||||
usePlaybackDataLoadStore,
|
||||
usePlaybackStore,
|
||||
} from "./utils/store/playback";
|
||||
|
||||
// 3rd Party
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { CircularProgress } from "@mui/material";
|
||||
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { ErrorBoundary } from "react-error-boundary";
|
||||
|
||||
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
|
||||
import {
|
||||
useIsFetching,
|
||||
useIsMutating,
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import NProgress from "./components/nProgress";
|
||||
import Settings from "./components/settings";
|
||||
import { EasterEgg } from "./components/utils/easterEgg.jsx";
|
||||
import { handleRelaunch } from "./utils/misc/relaunch";
|
||||
import {
|
||||
delServer,
|
||||
getAllServers,
|
||||
getDefaultServer,
|
||||
getServer,
|
||||
setDefaultServer,
|
||||
} from "./utils/storage/servers";
|
||||
import { type UserStore, delUser, getUser } from "./utils/storage/user";
|
||||
import { axiosClient, createApi, useApi } from "./utils/store/api";
|
||||
|
||||
const handleAuthError = async () => {
|
||||
await delUser();
|
||||
setInitialRoute("/login/index");
|
||||
};
|
||||
|
||||
const authenticateUser = async (address: string, user: UserStore["user"]) => {
|
||||
try {
|
||||
createApi(address, user.AccessToken);
|
||||
setInitialRoute("/home");
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
setInitialRoute("/error");
|
||||
}
|
||||
};
|
||||
|
||||
const init = async () => {
|
||||
if (window.location.pathname !== "/") {
|
||||
window.location.href = "/";
|
||||
return;
|
||||
}
|
||||
|
||||
const defaultServerOnDisk = await getDefaultServer();
|
||||
|
||||
if (defaultServerOnDisk) {
|
||||
const defaultServerInfo = await getServer(defaultServerOnDisk);
|
||||
if (!defaultServerInfo) {
|
||||
await setDefaultServer(null);
|
||||
await delServer(defaultServerOnDisk);
|
||||
|
||||
const servers = await getAllServers();
|
||||
|
||||
setInitialRoute(servers.length > 0 ? "/servers/list" : "/setup/server");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const userOnDisk = await getUser();
|
||||
createApi(defaultServerInfo.address, "");
|
||||
try {
|
||||
const api = useApi.getState();
|
||||
const ping = await getSystemApi(api.api).getPingSystem();
|
||||
// const ping = await fetch("http://192.168.29.60:8096/System/Ping");
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
setInitialRoute("/error");
|
||||
return;
|
||||
}
|
||||
|
||||
if (userOnDisk) {
|
||||
try {
|
||||
let authApi = useApi.getState().api;
|
||||
|
||||
if (!authApi) {
|
||||
handleAuthError();
|
||||
return;
|
||||
}
|
||||
|
||||
await authenticateUser(defaultServerInfo.address, userOnDisk);
|
||||
|
||||
authApi = useApi.getState().api!;
|
||||
|
||||
const user = await getUserApi(authApi).getCurrentUser();
|
||||
|
||||
if (!user) {
|
||||
await delUser();
|
||||
handleAuthError();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
handleAuthError();
|
||||
}
|
||||
} else {
|
||||
setInitialRoute("/login/index");
|
||||
}
|
||||
} else {
|
||||
setInitialRoute("/setup/server");
|
||||
}
|
||||
};
|
||||
|
||||
function App() {
|
||||
const [appReady, setAppReady] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
init().then(() => {
|
||||
setAppReady(true);
|
||||
});
|
||||
}, []);
|
||||
|
||||
if (!appReady) {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
position: "fixed",
|
||||
top: "50%",
|
||||
left: "50%",
|
||||
transform: "translate(-50%, -50%)",
|
||||
}}
|
||||
>
|
||||
<CircularProgress size={72} thickness={1.4} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return <AppReady />;
|
||||
}
|
||||
function AppReady() {
|
||||
const [audioPlayerVisible] = useAudioPlayback((state) => [state.display]);
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const [initialRoute] = useCentralStore((state) => [state.initialRoute]);
|
||||
const [backdropUrl, backdropId] = useBackdropStore((state) => [
|
||||
state.backdropUrl,
|
||||
state.backdropId,
|
||||
]);
|
||||
const [playbackDataLoading] = usePlaybackDataLoadStore((state) => [
|
||||
state.isPending,
|
||||
]);
|
||||
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
|
||||
|
||||
|
||||
const isQueryFetching = useIsFetching();
|
||||
const isMutating = useIsMutating();
|
||||
|
||||
useEffect(() => window.scrollTo(0, 0), [location.key]);
|
||||
|
||||
const [videoPlaybackItem] = usePlaybackStore((state) => [state.item]);
|
||||
|
||||
|
||||
|
||||
if (!initialRoute) {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
position: "fixed",
|
||||
top: "50%",
|
||||
left: "50%",
|
||||
transform: "translate(-50%, -50%)",
|
||||
}}
|
||||
>
|
||||
<CircularProgress size={72} thickness={1.4} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
|
||||
|
||||
|
||||
{/* Show Dialog if server not reachable */}
|
||||
|
||||
|
||||
<div
|
||||
className={audioPlayerVisible ? "audio-playing" : ""}
|
||||
style={{
|
||||
display: "flex",
|
||||
width: "100vw",
|
||||
transition: "padding 250ms",
|
||||
}}
|
||||
>
|
||||
|
||||
<ErrorBoundary FallbackComponent={ErrorNotice} key={location.key}>
|
||||
<Routes location={location}>
|
||||
<Route path="/" element={<Navigate to={initialRoute} />} />
|
||||
<Route
|
||||
path="/error"
|
||||
element={
|
||||
<Dialog
|
||||
open
|
||||
onClose={handleRelaunch}
|
||||
aria-labelledby="alert-dialog-text"
|
||||
aria-describedby="alert-dialog-desc"
|
||||
maxWidth="md"
|
||||
>
|
||||
<DialogTitle id="alert-dialog-text">
|
||||
Unable to reach server
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<DialogContentText id="alert-dialog-desc">
|
||||
Unable to connect to the jellyfin server.
|
||||
</DialogContentText>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button
|
||||
color="secondary"
|
||||
variant="contained"
|
||||
onClick={() => navigate("/servers/list")}
|
||||
>
|
||||
Change Server
|
||||
</Button>
|
||||
<Button
|
||||
variant="contained"
|
||||
color="primary"
|
||||
onClick={handleRelaunch}
|
||||
>
|
||||
Restart JellyPlayer
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
}
|
||||
/>
|
||||
<Route path="/login/index" element={<LoginRoute />} />
|
||||
|
||||
<Route path="/home" element={<Home />} />
|
||||
<Route path="/setup/server" element={<ServerSetup />} />
|
||||
<Route path="/servers/list" element={<ServerList />} />
|
||||
<Route
|
||||
path="/login/withImg/:userName/:userId/"
|
||||
element={<LoginWithImage />}
|
||||
/>
|
||||
<Route path="/login/users" element={<UserLogin />} />
|
||||
<Route path="/login/manual" element={<UserLoginManual />} />
|
||||
<Route path="/library/:id" element={<LibraryView />} />
|
||||
<Route path="/item/:id" element={<ItemDetail />} />
|
||||
<Route
|
||||
path="/musicalbum/:id"
|
||||
element={<MusicAlbumTitlePage />}
|
||||
errorElement={<div>Error</div>}
|
||||
/>
|
||||
<Route path="/artist/:id" element={<ArtistTitlePage />} />
|
||||
<Route path="/boxset/:id" element={<BoxSetTitlePage />} />
|
||||
<Route path="/episode/:id" element={<EpisodeTitlePage />} />
|
||||
<Route path="/person/:id" element={<PersonTitlePage />} />
|
||||
<Route path="/playlist/:id" element={<PlaylistTitlePage />} />
|
||||
<Route path="/series/:id" element={<SeriesTitlePage />} />
|
||||
<Route path="/search" element={<SearchPage />} />
|
||||
<Route path="/favorite" element={<FavoritePage />} />
|
||||
<Route path="/about" element={<About />} />
|
||||
<Route
|
||||
path="/player"
|
||||
element={<VideoPlayer />}
|
||||
key={videoPlaybackItem?.Id ?? "noplayback"}
|
||||
/>
|
||||
</Routes>
|
||||
</ErrorBoundary>
|
||||
</div>
|
||||
|
||||
<ReactQueryDevtools buttonPosition="bottom-right" position="left" />
|
||||
</>
|
||||
</SnackbarProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg width="1310" height="1512" viewBox="0 0 1310 1512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M654.715 756L52 1103.98L654.715 1451.96L1257.43 1103.98V408.022L654.715 60.0444L52 408.022L654.715 756ZM654.715 0L1309.43 378V1134L654.715 1512L0 1134V1073.96V438.044V378L654.715 0Z" fill="#101010"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 360 B |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 94 KiB |
@@ -1,11 +1,16 @@
|
||||
<svg width="1512" height="1512" viewBox="0 0 1512 1512" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<rect width="1512" height="1512" rx="756" fill="white"/>
|
||||
<rect width="1012" height="1012" transform="translate(250 250)" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M755.809 756L317.601 503V1009L755.809 756Z" fill="url(#pattern0_1167_274)"/>
|
||||
<mask id="mask0_1167_274" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="317" y="503" width="439" height="506">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M755.809 756L317.601 503V1009L755.809 756Z" fill="#D9D9D9"/>
|
||||
</mask>
|
||||
<g mask="url(#mask0_1167_274)">
|
||||
<rect x="220.55" y="503" width="535.45" height="506" fill="url(#pattern0_1167_274)"/>
|
||||
</g>
|
||||
<path d="M1194.02 503L755.809 250L317.601 503L755.809 756L317.601 1009L755.809 1262L1194.02 1009V503Z" fill="#222222"/>
|
||||
<defs>
|
||||
<pattern id="pattern0_1167_274" patternContentUnits="objectBoundingBox" width="1" height="1">
|
||||
<use xlink:href="#image0_1167_274" transform="matrix(0 -0.000244141 0.000281909 0 -0.0773503 1)"/>
|
||||
<use xlink:href="#image0_1167_274" transform="matrix(0.000572484 0 0 0.000580984 -0.735848 -0.442641)"/>
|
||||
</pattern>
|
||||
<image id="image0_1167_274" width="4096" height="4096" xlink:href="data:image/png;base64,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 truncated
|
||||
</defs>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 3.7 MiB |
@@ -0,0 +1,4 @@
|
||||
<svg width="39" height="14" viewBox="0 0 39 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 0H34.69C36.8991 0 38.69 1.79086 38.69 4V10C38.69 12.2091 36.8991 14 34.69 14H4.00001C1.79087 14 0 12.2091 0 10V4C0 1.79086 1.79086 0 4 0ZM6.7 9.395H4.4V3.525H3V10.505H6.7V9.395ZM10.7798 8.075L13.1398 3.525H11.5798L10.0898 6.715L8.58984 3.525H7.00984L9.37984 8.075V10.505H10.7798V8.075ZM16.0073 7.785L17.5473 10.505H19.1673L17.4973 7.675C18.0239 7.535 18.4206 7.28167 18.6873 6.915C18.9539 6.54167 19.0873 6.125 19.0873 5.665C19.0873 5.265 18.9906 4.905 18.7973 4.585C18.6106 4.25833 18.3273 4.00167 17.9473 3.815C17.5673 3.62167 17.1073 3.525 16.5673 3.525H13.9473V10.505H15.3473V7.785H16.0073ZM21.7535 10.505V3.525H20.3535V10.505H21.7535ZM23.2567 5.165C22.9501 5.705 22.7967 6.31833 22.7967 7.005C22.7967 7.69167 22.9501 8.305 23.2567 8.845C23.5701 9.385 23.9934 9.80833 24.5267 10.115C25.0667 10.415 25.6701 10.565 26.3367 10.565C27.1234 10.565 27.8067 10.3683 28.3867 9.975C28.9734 9.575 29.3834 9.01833 29.6167 8.305H28.0067C27.8467 8.63833 27.6201 8.89167 27.3267 9.065C27.0401 9.23167 26.7067 9.315 26.3267 9.315C25.9201 9.315 25.5567 9.22167 25.2367 9.035C24.9234 8.84167 24.6767 8.57167 24.4967 8.225C24.3234 7.87167 24.2367 7.465 24.2367 7.005C24.2367 6.53833 24.3234 6.13167 24.4967 5.785C24.6767 5.43833 24.9234 5.17167 25.2367 4.985C25.5567 4.79167 25.9201 4.695 26.3267 4.695C26.7067 4.695 27.0401 4.77833 27.3267 4.945C27.6201 5.11167 27.8467 5.36167 28.0067 5.695H29.6167C29.3834 4.98833 28.9734 4.435 28.3867 4.035C27.8001 3.635 27.1167 3.435 26.3367 3.435C25.6701 3.435 25.0667 3.58833 24.5267 3.895C23.9934 4.195 23.5701 4.61833 23.2567 5.165ZM31.9025 10.325C32.2958 10.4917 32.7358 10.575 33.2225 10.575C33.7358 10.575 34.1792 10.4817 34.5525 10.295C34.9258 10.1017 35.2092 9.845 35.4025 9.525C35.5958 9.205 35.6925 8.85833 35.6925 8.485C35.6925 8.05167 35.5892 7.70167 35.3825 7.435C35.1758 7.16833 34.9292 6.96833 34.6425 6.835C34.3558 6.70167 33.9858 6.56833 33.5325 6.435C33.1992 6.335 32.9392 6.24833 32.7525 6.175C32.5725 6.095 32.4192 5.995 32.2925 5.875C32.1725 5.74833 32.1125 5.59167 32.1125 5.405C32.1125 5.13833 32.1925 4.935 32.3525 4.795C32.5192 4.655 32.7392 4.585 33.0125 4.585C33.3258 4.585 33.5758 4.665 33.7625 4.825C33.9558 4.97833 34.0592 5.175 34.0725 5.415H35.6125C35.5658 4.78833 35.3158 4.30167 34.8625 3.955C34.4158 3.60167 33.8325 3.425 33.1125 3.425C32.6325 3.425 32.2058 3.50833 31.8325 3.675C31.4592 3.835 31.1692 4.06833 30.9625 4.375C30.7558 4.68167 30.6525 5.04167 30.6525 5.455C30.6525 5.895 30.7525 6.24833 30.9525 6.515C31.1592 6.775 31.4025 6.97167 31.6825 7.105C31.9692 7.23167 32.3392 7.36167 32.7925 7.495C33.1258 7.58833 33.3858 7.675 33.5725 7.755C33.7658 7.82833 33.9258 7.93167 34.0525 8.065C34.1792 8.19833 34.2425 8.36833 34.2425 8.575C34.2425 8.82833 34.1492 9.035 33.9625 9.195C33.7758 9.34833 33.5192 9.425 33.1925 9.425C32.8725 9.425 32.6192 9.34167 32.4325 9.175C32.2525 9.00833 32.1525 8.78167 32.1325 8.495H30.6325C30.6392 8.92167 30.7558 9.29167 30.9825 9.605C31.2092 9.91833 31.5158 10.1583 31.9025 10.325Z" fill="white"/>
|
||||
<path d="M15.3473 6.735H16.5173C16.8973 6.735 17.1806 6.645 17.3673 6.465C17.5539 6.27833 17.6473 6.02167 17.6473 5.695C17.6473 5.375 17.5539 5.12833 17.3673 4.955C17.1806 4.775 16.8973 4.685 16.5173 4.685H15.3473V6.735Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,11 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_1029_262)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.5024 12.9928C23.271 9.28227 21.3839 6.50613 18.5446 4.9541C18.5607 5.04452 18.4802 5.15755 18.3886 5.11752C16.5315 4.30511 13.3809 6.93435 11.1793 5.55749C11.1958 6.05163 11.0993 8.46208 7.70374 8.6019C7.62358 8.60519 7.57946 8.52333 7.63015 8.46537C8.08426 7.94743 8.54275 6.63609 7.88349 5.93701C6.47168 7.20213 5.65179 7.67825 2.94477 7.04997C1.21159 8.86222 0.229486 11.3426 0.422283 14.4324C0.815644 20.7399 6.72373 24.3454 12.6732 23.9741C18.6223 23.6032 23.8959 19.3003 23.5024 12.9928Z" fill="#FA320A"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.6598 3.43995C13.8824 3.14856 17.3987 3.41156 18.5253 4.90604C18.5929 4.99566 18.4977 5.16526 18.3887 5.11766C16.5315 4.30524 13.3809 6.93449 11.1793 5.55762C11.1958 6.05176 11.0993 8.46222 7.7038 8.60204C7.62363 8.60532 7.57952 8.52347 7.6302 8.46551C8.08431 7.94756 8.5427 6.63623 7.88355 5.93714C6.34566 7.3153 5.51193 7.75815 2.17404 6.85591C2.06479 6.82644 2.10204 6.65087 2.21825 6.60655C2.84913 6.36546 4.27837 5.30946 5.63054 4.844C5.88796 4.75547 6.14459 4.68675 6.39505 4.64682C4.90625 4.51377 4.23515 4.30674 3.2882 4.44954C3.18443 4.46517 3.11392 4.34438 3.17825 4.26152C4.45414 2.61807 6.80454 2.12174 8.2547 2.9948C7.36083 1.88722 6.66064 1.0039 6.66064 1.0039L8.31973 0.0615234C8.31973 0.0615234 9.00518 1.59294 9.5039 2.7075C10.7381 0.883996 13.0343 0.715698 14.0044 2.00951C14.062 2.08639 14.0019 2.19573 13.9058 2.19344C13.1161 2.17422 12.6814 2.89243 12.6484 3.43865L12.6598 3.43995Z" fill="#00912D"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_1029_262">
|
||||
<rect width="24" height="24" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,10 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_1029_259)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.4392 21.4361C16.9038 21.6742 15.9771 16.4845 14.1977 16.5215C13.4395 16.5374 12.8419 17.3301 13.1043 18.254C13.2487 18.7619 13.649 19.5067 13.9012 19.9689C14.7909 21.6 13.4756 23.4458 11.9364 23.6019C9.37865 23.8614 8.31171 22.3776 8.37771 20.8586C8.45192 19.1535 9.89771 17.4111 8.41486 16.6698C6.86086 15.8928 5.5976 18.931 4.11055 19.6091C2.76465 20.2229 0.896337 19.747 0.232126 18.2525C-0.2344 17.2023 -0.149558 15.1801 1.9276 14.4085C3.22507 13.9266 6.11644 15.0387 6.26476 13.6301C6.43571 12.0063 3.22728 11.8694 2.26128 11.48C0.552021 10.7911 -0.456821 9.31714 0.3336 7.73588C0.926653 6.54978 2.6716 6.06714 4.00349 6.58672C5.59907 7.20914 5.85518 8.86409 6.67265 9.5523C7.37686 10.1455 8.34065 10.2197 8.97097 9.81188C9.43581 9.51104 9.59055 8.8503 9.41518 8.24672C9.18255 7.44546 8.56518 6.94546 7.96286 6.45556C6.89097 5.5842 5.37771 4.83493 6.29307 2.45651C7.04339 0.507354 9.24402 0.437144 9.24402 0.437144C10.1183 0.338828 10.9013 0.602828 11.5393 1.17283C12.3922 1.93483 12.5583 2.95335 12.4156 4.03999C12.2852 5.03188 11.9341 5.90062 11.7511 6.88335C11.5387 8.0243 12.1484 9.17399 13.3081 9.21872C14.8335 9.27767 15.2909 8.10525 15.4775 7.36209C15.7508 6.27472 16.1094 5.26525 17.1185 4.62946C18.5669 3.71693 20.5787 3.91693 21.512 5.67072C22.2503 7.05841 22.0133 8.96872 20.8808 10.0119C20.3727 10.4798 19.7617 10.6447 19.1009 10.6494C18.1532 10.6561 17.2059 10.6328 16.3262 11.0763C15.7274 11.3781 15.4664 11.8699 15.4665 12.529C15.4665 13.1715 15.801 13.591 16.3429 13.8641C17.3635 14.3785 18.4901 14.4837 19.5927 14.6767C21.1915 14.9567 22.5973 15.5199 23.4998 17.0036C23.5079 17.0166 23.5158 17.0298 23.5235 17.043C24.56 18.7997 23.476 21.329 21.4392 21.4361Z" fill="#0AC855"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_1029_259">
|
||||
<rect width="24" height="24" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 25 KiB |
@@ -1,12 +1,21 @@
|
||||
<svg width="1395" height="522" viewBox="0 0 1395 522" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<rect width="1395" height="522" fill="white"/>
|
||||
<svg width="1302" height="522" viewBox="0 0 1302 522" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<rect width="1301.68" height="522" fill="white"/>
|
||||
<rect width="322" height="322" transform="translate(100 100)" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M260.939 261L121.509 180.5V341.5L260.939 261Z" fill="url(#pattern0_1155_288)"/>
|
||||
<mask id="mask0_1155_288" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="121" y="180" width="140" height="162">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M260.939 261L121.509 180.5V341.5L260.939 261Z" fill="#D9D9D9"/>
|
||||
</mask>
|
||||
<g mask="url(#mask0_1155_288)">
|
||||
<rect x="90.6289" y="180.5" width="170.37" height="161" fill="url(#pattern0_1155_288)"/>
|
||||
</g>
|
||||
<path d="M400.369 180.5L260.939 100L121.509 180.5L260.939 261L121.509 341.5L260.939 422L400.369 341.5V180.5Z" fill="#222222"/>
|
||||
<path d="M473.213 361V165.798H564.679C588.103 165.798 605.95 170.446 618.22 179.741C630.49 188.85 636.625 201.12 636.625 216.551C636.625 226.961 634.208 235.885 629.374 243.321C624.541 250.571 618.034 256.242 609.854 260.332C601.86 264.236 593.123 266.188 583.641 266.188L588.661 256.149C599.629 256.149 609.482 258.194 618.22 262.284C626.958 266.188 633.836 271.951 638.856 279.573C644.061 287.195 646.664 296.676 646.664 308.017C646.664 324.748 640.25 337.762 627.422 347.057C614.595 356.352 595.539 361 570.256 361H473.213ZM509.465 332.556H568.025C581.596 332.556 592.007 330.325 599.258 325.864C606.508 321.402 610.133 314.244 610.133 304.391C610.133 294.724 606.508 287.66 599.258 283.198C592.007 278.55 581.596 276.227 568.025 276.227H506.676V248.062H560.775C573.417 248.062 583.084 245.831 589.776 241.369C596.655 236.907 600.094 230.215 600.094 221.291C600.094 212.182 596.655 205.396 589.776 200.934C583.084 196.473 573.417 194.242 560.775 194.242H509.465V332.556ZM682.007 361V154.086H716.865V361H682.007ZM762.615 361V212.089H797.473V361H762.615ZM780.183 187.549C773.676 187.549 768.285 185.504 764.009 181.414C759.919 177.324 757.874 172.398 757.874 166.635C757.874 160.686 759.919 155.759 764.009 151.855C768.285 147.765 773.676 145.72 780.183 145.72C786.69 145.72 791.988 147.672 796.078 151.576C800.354 155.294 802.492 160.035 802.492 165.798C802.492 171.933 800.447 177.138 796.357 181.414C792.267 185.504 786.876 187.549 780.183 187.549ZM927.718 210.416C939.616 210.416 950.212 212.739 959.508 217.387C968.989 222.035 976.425 229.192 981.816 238.859C987.208 248.341 989.903 260.61 989.903 275.669V361H955.046V280.131C955.046 266.931 951.885 257.078 945.565 250.571C939.43 244.065 930.785 240.811 919.631 240.811C911.451 240.811 904.2 242.485 897.88 245.831C891.559 249.177 886.632 254.197 883.1 260.889C879.754 267.396 878.08 275.669 878.08 285.708V361H843.223V212.089H876.407V252.245L870.551 239.975C875.757 230.494 883.286 223.243 893.139 218.224C903.178 213.018 914.704 210.416 927.718 210.416ZM1062.57 327.816L1063.4 284.035L1141.2 212.089H1183.03L1116.94 278.457L1098.54 293.795L1062.57 327.816ZM1034.12 361V154.086H1068.98V361H1034.12ZM1146.5 361L1092.13 293.795L1114.16 265.909L1188.89 361H1146.5ZM1225.28 362.952C1218.96 362.952 1213.57 360.814 1209.11 356.538C1204.65 352.076 1202.42 346.499 1202.42 339.807C1202.42 332.742 1204.65 327.165 1209.11 323.075C1213.57 318.799 1218.96 316.661 1225.28 316.661C1231.6 316.661 1237 318.799 1241.46 323.075C1245.92 327.165 1248.15 332.742 1248.15 339.807C1248.15 346.499 1245.92 352.076 1241.46 356.538C1237 360.814 1231.6 362.952 1225.28 362.952Z" fill="#222222"/>
|
||||
<path d="M694.794 368.28V161.366H729.652V368.28H694.794Z" fill="#222222"/>
|
||||
<path d="M775.402 368.28V219.369H810.26V368.28H775.402ZM792.97 194.829C786.464 194.829 781.072 192.784 776.796 188.694C772.707 184.604 770.662 179.678 770.662 173.914C770.662 167.965 772.707 163.039 776.796 159.135C781.072 155.045 786.464 153 792.97 153C799.477 153 804.775 154.952 808.865 158.856C813.141 162.574 815.279 167.315 815.279 173.078C815.279 179.213 813.234 184.418 809.144 188.694C805.054 192.784 799.663 194.829 792.97 194.829Z" fill="#222222"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M486 368.28V173.078H577.466C600.89 173.078 618.737 177.726 631.007 187.021C643.277 196.13 649.412 208.4 649.412 223.83C649.412 234.241 646.995 243.165 642.162 250.601C637.625 257.407 631.613 262.82 624.128 266.841C626.493 267.616 628.786 268.524 631.007 269.563C639.745 273.468 646.623 279.231 651.643 286.853C656.848 294.475 659.451 303.956 659.451 315.297C659.451 332.028 653.037 345.042 640.21 354.337C627.382 363.632 608.327 368.28 583.043 368.28H486ZM580.812 339.836H522.252V283.506H580.812C594.384 283.506 604.794 285.83 612.045 290.478C619.295 294.94 622.92 302.004 622.92 311.671C622.92 321.524 619.295 328.682 612.045 333.144C604.794 337.605 594.384 339.836 580.812 339.836ZM602.563 248.649C595.871 253.111 586.204 255.342 573.562 255.342H522.252V201.522H573.562C586.204 201.522 595.871 203.753 602.563 208.214C609.442 212.676 612.881 219.462 612.881 228.571C612.881 237.495 609.442 244.187 602.563 248.649Z" fill="#222222"/>
|
||||
<path d="M940.505 217.696C952.403 217.696 962.999 220.019 972.295 224.667C981.776 229.315 989.212 236.472 994.604 246.139C999.995 255.62 1002.69 267.89 1002.69 282.949V368.28H967.833V287.411C967.833 274.211 964.673 264.358 958.352 257.851C952.217 251.345 943.572 248.091 932.418 248.091C924.238 248.091 916.988 249.764 910.667 253.111C904.346 256.457 899.419 261.477 895.887 268.169C892.541 274.676 890.868 282.949 890.868 292.988V368.28H856.01V219.369H889.194V238.664C893.72 233.268 899.297 228.881 905.926 225.504C915.965 220.298 927.491 217.696 940.505 217.696Z" fill="#222222"/>
|
||||
<path d="M1153.99 219.369H1195.82L1133.68 281.767L1201.68 368.28H1159.29L1107.69 304.511L1081.77 329.03V368.28H1046.91V161.366H1081.77V286.157L1153.99 219.369Z" fill="#222222"/>
|
||||
<defs>
|
||||
<pattern id="pattern0_1155_288" patternContentUnits="objectBoundingBox" width="1" height="1">
|
||||
<use xlink:href="#image0_1155_288" transform="matrix(0 -0.000244141 0.000281909 0 -0.0773502 1)"/>
|
||||
<use xlink:href="#image0_1155_288" transform="matrix(0.000572484 0 0 0.000580984 -0.735848 -0.442641)"/>
|
||||
</pattern>
|
||||
<image id="image0_1155_288" width="4096" height="4096" xlink:href="data:image/png;base64,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 truncated
|
||||
</defs>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 3.7 MiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 25 KiB |
@@ -1,12 +1,21 @@
|
||||
<svg width="1395" height="522" viewBox="0 0 1395 522" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<rect width="1395" height="522" fill="#222222"/>
|
||||
<svg width="1302" height="522" viewBox="0 0 1302 522" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<rect width="1302" height="522" fill="#222222"/>
|
||||
<rect width="322" height="322" transform="translate(100 100)" fill="#222222"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M260.939 261L121.509 180.5V341.5L260.939 261Z" fill="url(#pattern0_1178_275)"/>
|
||||
<mask id="mask0_1178_275" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="121" y="180" width="140" height="162">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M260.939 261L121.509 180.5V341.5L260.939 261Z" fill="#D9D9D9"/>
|
||||
</mask>
|
||||
<g mask="url(#mask0_1178_275)">
|
||||
<rect x="90.6289" y="180.5" width="170.37" height="161" fill="url(#pattern0_1178_275)"/>
|
||||
</g>
|
||||
<path d="M400.369 180.5L260.939 100L121.509 180.5L260.939 261L121.509 341.5L260.939 422L400.369 341.5V180.5Z" fill="white"/>
|
||||
<path d="M473.213 361V165.798H564.679C588.103 165.798 605.95 170.446 618.22 179.741C630.49 188.85 636.625 201.12 636.625 216.551C636.625 226.961 634.208 235.885 629.374 243.321C624.541 250.571 618.034 256.242 609.854 260.332C601.86 264.236 593.123 266.188 583.641 266.188L588.661 256.149C599.629 256.149 609.482 258.194 618.22 262.284C626.958 266.188 633.836 271.951 638.856 279.573C644.061 287.195 646.664 296.676 646.664 308.017C646.664 324.748 640.25 337.762 627.422 347.057C614.595 356.352 595.539 361 570.256 361H473.213ZM509.465 332.556H568.025C581.596 332.556 592.007 330.325 599.258 325.864C606.508 321.402 610.133 314.244 610.133 304.391C610.133 294.724 606.508 287.66 599.258 283.198C592.007 278.55 581.596 276.227 568.025 276.227H506.676V248.062H560.775C573.417 248.062 583.084 245.831 589.776 241.369C596.655 236.907 600.094 230.215 600.094 221.291C600.094 212.182 596.655 205.396 589.776 200.934C583.084 196.473 573.417 194.242 560.775 194.242H509.465V332.556ZM682.007 361V154.086H716.865V361H682.007ZM762.615 361V212.089H797.473V361H762.615ZM780.183 187.549C773.676 187.549 768.285 185.504 764.009 181.414C759.919 177.324 757.874 172.398 757.874 166.635C757.874 160.686 759.919 155.759 764.009 151.855C768.285 147.765 773.676 145.72 780.183 145.72C786.69 145.72 791.988 147.672 796.078 151.576C800.354 155.294 802.492 160.035 802.492 165.798C802.492 171.933 800.447 177.138 796.357 181.414C792.267 185.504 786.876 187.549 780.183 187.549ZM927.718 210.416C939.616 210.416 950.212 212.739 959.508 217.387C968.989 222.035 976.425 229.192 981.816 238.859C987.208 248.341 989.903 260.61 989.903 275.669V361H955.046V280.131C955.046 266.931 951.885 257.078 945.565 250.571C939.43 244.065 930.785 240.811 919.631 240.811C911.451 240.811 904.2 242.485 897.88 245.831C891.559 249.177 886.632 254.197 883.1 260.889C879.754 267.396 878.08 275.669 878.08 285.708V361H843.223V212.089H876.407V252.245L870.551 239.975C875.757 230.494 883.286 223.243 893.139 218.224C903.178 213.018 914.704 210.416 927.718 210.416ZM1062.57 327.816L1063.4 284.035L1141.2 212.089H1183.03L1116.94 278.457L1098.54 293.795L1062.57 327.816ZM1034.12 361V154.086H1068.98V361H1034.12ZM1146.5 361L1092.13 293.795L1114.16 265.909L1188.89 361H1146.5ZM1225.28 362.952C1218.96 362.952 1213.57 360.814 1209.11 356.538C1204.65 352.076 1202.42 346.499 1202.42 339.807C1202.42 332.742 1204.65 327.165 1209.11 323.075C1213.57 318.799 1218.96 316.661 1225.28 316.661C1231.6 316.661 1237 318.799 1241.46 323.075C1245.92 327.165 1248.15 332.742 1248.15 339.807C1248.15 346.499 1245.92 352.076 1241.46 356.538C1237 360.814 1231.6 362.952 1225.28 362.952Z" fill="white"/>
|
||||
<path d="M694.794 368.64V161.726H729.652V368.64H694.794Z" fill="white"/>
|
||||
<path d="M775.402 368.64V219.729H810.26V368.64H775.402ZM792.97 195.189C786.464 195.189 781.072 193.144 776.796 189.054C772.707 184.964 770.662 180.037 770.662 174.274C770.662 168.325 772.707 163.399 776.796 159.495C781.072 155.405 786.464 153.36 792.97 153.36C799.477 153.36 804.775 155.312 808.865 159.216C813.141 162.934 815.279 167.675 815.279 173.438C815.279 179.573 813.234 184.778 809.144 189.054C805.054 193.144 799.663 195.189 792.97 195.189Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M486 368.64V173.438H577.466C600.89 173.438 618.737 178.085 631.007 187.381C643.277 196.49 649.412 208.76 649.412 224.19C649.412 234.601 646.995 243.525 642.162 250.961C637.625 257.766 631.613 263.18 624.128 267.201C626.493 267.976 628.786 268.884 631.007 269.923C639.745 273.827 646.623 279.59 651.643 287.213C656.848 294.835 659.451 304.316 659.451 315.656C659.451 332.388 653.037 345.401 640.21 354.697C627.382 363.992 608.327 368.64 583.043 368.64H486ZM580.812 340.196H522.252V283.866H580.812C594.384 283.866 604.794 286.19 612.045 290.838C619.295 295.3 622.92 302.364 622.92 312.031C622.92 321.884 619.295 329.042 612.045 333.503C604.794 337.965 594.384 340.196 580.812 340.196ZM602.563 249.009C595.871 253.471 586.204 255.701 573.562 255.701H522.252V201.881H573.562C586.204 201.881 595.871 204.112 602.563 208.574C609.442 213.036 612.881 219.821 612.881 228.931C612.881 237.854 609.442 244.547 602.563 249.009Z" fill="white"/>
|
||||
<path d="M940.505 218.055C952.403 218.055 962.999 220.379 972.295 225.027C981.776 229.675 989.212 236.832 994.604 246.499C999.995 255.98 1002.69 268.25 1002.69 283.309V368.64H967.833V287.77C967.833 274.571 964.673 264.718 958.352 258.211C952.217 251.704 943.572 248.451 932.418 248.451C924.238 248.451 916.988 250.124 910.667 253.471C904.346 256.817 899.419 261.836 895.887 268.529C892.541 275.036 890.868 283.309 890.868 293.348V368.64H856.01V219.729H889.194V239.024C893.72 233.627 899.297 229.241 905.926 225.863C915.965 220.658 927.491 218.055 940.505 218.055Z" fill="white"/>
|
||||
<path d="M1153.99 219.729H1195.82L1133.68 282.127L1201.68 368.64H1159.29L1107.69 304.871L1081.77 329.39V368.64H1046.91V161.726H1081.77V286.517L1153.99 219.729Z" fill="white"/>
|
||||
<defs>
|
||||
<pattern id="pattern0_1178_275" patternContentUnits="objectBoundingBox" width="1" height="1">
|
||||
<use xlink:href="#image0_1178_275" transform="matrix(0 -0.000244141 0.000281909 0 -0.0773502 1)"/>
|
||||
<use xlink:href="#image0_1178_275" transform="matrix(0.000572484 0 0 0.000580984 -0.735848 -0.442641)"/>
|
||||
</pattern>
|
||||
<image id="image0_1178_275" width="4096" height="4096" xlink:href="data:image/png;base64,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 truncated
|
||||
</defs>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 3.7 MiB |
@@ -0,0 +1,171 @@
|
||||
import useDebounce from "@/utils/hooks/useDebounce";
|
||||
import React, {
|
||||
type ReactNode,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
|
||||
import { useSpring } from "@react-spring/web";
|
||||
import { debounce } from "lodash";
|
||||
|
||||
import "./style.scss";
|
||||
import { Button, IconButton } from "@mui/material";
|
||||
|
||||
enum Direction {
|
||||
RIGHT = 0,
|
||||
LEFT = 1,
|
||||
}
|
||||
|
||||
const Slider = ({
|
||||
content,
|
||||
currentSlide,
|
||||
}: { content: ReactNode[]; currentSlide: number }) => {
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
const [scrollPos, setScrollPos] = useState({ isStart: true, isEnd: false });
|
||||
|
||||
const handleScroll = useCallback(() => {
|
||||
const scrollWidth = containerRef.current?.scrollWidth ?? 0;
|
||||
const clientWidth =
|
||||
containerRef.current?.getBoundingClientRect().width ?? 0;
|
||||
const scrolledPostion = containerRef.current?.scrollLeft ?? 0;
|
||||
if (content.length === 0) {
|
||||
setScrollPos({ isStart: true, isEnd: true });
|
||||
} else if (clientWidth >= scrollWidth) {
|
||||
setScrollPos({ isStart: true, isEnd: true });
|
||||
} else if (
|
||||
scrolledPostion >=
|
||||
(containerRef.current?.scrollWidth ?? 0) - clientWidth
|
||||
) {
|
||||
setScrollPos({ isStart: false, isEnd: true });
|
||||
} else if (scrolledPostion > 0) {
|
||||
setScrollPos({ isStart: false, isEnd: false });
|
||||
} else {
|
||||
setScrollPos({ isStart: true, isEnd: false });
|
||||
}
|
||||
}, [content]);
|
||||
|
||||
const debouncedScroll = useCallback(
|
||||
() => debounce(handleScroll, 50),
|
||||
[handleScroll],
|
||||
);
|
||||
useEffect(() => {
|
||||
const handleResize = () => {
|
||||
debouncedScroll();
|
||||
};
|
||||
window.addEventListener("resize", handleResize, { passive: true });
|
||||
return () => window.removeEventListener("resize", handleResize);
|
||||
}, [debouncedScroll]);
|
||||
|
||||
useEffect(() => {
|
||||
handleScroll();
|
||||
}, [handleScroll, content]);
|
||||
|
||||
const onScroll = () => {
|
||||
debouncedScroll();
|
||||
};
|
||||
|
||||
const [, setX] = useSpring(() => ({
|
||||
from: { x: 0 },
|
||||
to: { x: 0 },
|
||||
onChange: (results) => {
|
||||
if (containerRef.current) {
|
||||
containerRef.current.scrollLeft = results.value.x;
|
||||
}
|
||||
},
|
||||
}));
|
||||
|
||||
const slide = (direction: Direction) => {
|
||||
const clientWidth =
|
||||
containerRef.current?.getBoundingClientRect().width ?? 0;
|
||||
const cardWidth =
|
||||
containerRef.current?.firstElementChild?.getBoundingClientRect().width ??
|
||||
0;
|
||||
const scrollPosition = containerRef.current?.scrollLeft ?? 0;
|
||||
const visibleItems = Math.floor(clientWidth / cardWidth);
|
||||
const scrollOffset = scrollPosition % cardWidth;
|
||||
|
||||
if (direction === Direction.LEFT) {
|
||||
const newX = Math.max(
|
||||
scrollPosition - scrollOffset - visibleItems * cardWidth,
|
||||
0,
|
||||
);
|
||||
setX.start({
|
||||
from: { x: scrollPosition },
|
||||
to: { x: newX },
|
||||
onChange: (results) => {
|
||||
if (containerRef.current) {
|
||||
containerRef.current.scrollLeft = results.value.x;
|
||||
}
|
||||
},
|
||||
reset: true,
|
||||
config: { friction: 60, tension: 1000, velocity: 2 },
|
||||
});
|
||||
|
||||
if (newX === 0) {
|
||||
setScrollPos({ isStart: true, isEnd: false });
|
||||
} else {
|
||||
setScrollPos({ isStart: false, isEnd: false });
|
||||
}
|
||||
} else if (direction === Direction.RIGHT) {
|
||||
const newX = Math.min(
|
||||
scrollPosition - scrollOffset + visibleItems * cardWidth,
|
||||
containerRef.current?.scrollWidth ?? 0 - clientWidth,
|
||||
);
|
||||
setX.start({
|
||||
from: { x: scrollPosition },
|
||||
to: { x: newX },
|
||||
onChange: (results) => {
|
||||
if (containerRef.current) {
|
||||
containerRef.current.scrollLeft = results.value.x;
|
||||
}
|
||||
},
|
||||
reset: true,
|
||||
config: { friction: 60, tension: 500, velocity: 2 },
|
||||
});
|
||||
|
||||
if (newX >= (containerRef.current?.scrollWidth ?? 0) - clientWidth) {
|
||||
setScrollPos({ isStart: false, isEnd: true });
|
||||
} else {
|
||||
setScrollPos({ isStart: false, isEnd: false });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="slider">
|
||||
<IconButton
|
||||
className="slider-button left"
|
||||
onClick={() => slide(Direction.LEFT)}
|
||||
disabled={scrollPos.isStart}
|
||||
variant="contained"
|
||||
>
|
||||
<span className="material-symbols-rounded">chevron_left</span>
|
||||
</IconButton>
|
||||
<div className="slider-track" ref={containerRef} onScroll={onScroll}>
|
||||
{content?.map((item, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={
|
||||
currentSlide === index
|
||||
? "slider-track-item active"
|
||||
: "slider-track-item"
|
||||
}
|
||||
>
|
||||
{item}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<IconButton
|
||||
className="slider-button right"
|
||||
onClick={() => slide(Direction.RIGHT)}
|
||||
disabled={scrollPos.isEnd}
|
||||
variant="contained"
|
||||
>
|
||||
<span className="material-symbols-rounded">chevron_right</span>
|
||||
</IconButton>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default Slider;
|
||||
@@ -0,0 +1,34 @@
|
||||
.slider {
|
||||
position: relative;
|
||||
|
||||
&-track {
|
||||
overflow-y: hidden;
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
overscroll-behavior-x: contain;
|
||||
margin: 0.5em 1em;
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&-item {
|
||||
display: inline-block;
|
||||
// align-self: top;
|
||||
padding: 0.5em 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-button {
|
||||
position: absolute !important;
|
||||
bottom: 1.3em;
|
||||
|
||||
&.left {
|
||||
left: -1.2em;
|
||||
}
|
||||
|
||||
&.right {
|
||||
right: -1.2em;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +1,22 @@
|
||||
import type React from "react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
|
||||
import { relaunch } from "@tauri-apps/api/process";
|
||||
import React, { type ReactNode } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import MuiAppBar from "@mui/material/AppBar";
|
||||
import Avatar from "@mui/material/Avatar";
|
||||
import Button from "@mui/material/Button";
|
||||
import Grow from "@mui/material/Grow";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import ListItemIcon from "@mui/material/ListItemIcon";
|
||||
import Menu from "@mui/material/Menu";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import Popper from "@mui/material/Popper";
|
||||
import Toolbar from "@mui/material/Toolbar";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import useScrollTrigger from "@mui/material/useScrollTrigger";
|
||||
|
||||
import { red } from "@mui/material/colors";
|
||||
|
||||
import {
|
||||
Link,
|
||||
useLocation,
|
||||
useNavigate,
|
||||
useRouteContext,
|
||||
} from "@tanstack/react-router";
|
||||
import { Link, useLocation, useNavigate } from "@tanstack/react-router";
|
||||
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
import { delServer } from "@/utils/storage/servers";
|
||||
import { delUser } from "@/utils/storage/user";
|
||||
import { useDrawerStore } from "@/utils/store/drawer";
|
||||
import "./appBar.scss";
|
||||
|
||||
import { EventEmitter as event } from "@/eventEmitter";
|
||||
@@ -41,7 +24,7 @@ import { EventEmitter as event } from "@/eventEmitter";
|
||||
import { getTypeIcon } from "../utils/iconsCollection";
|
||||
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import useSettingsStore, {
|
||||
import {
|
||||
setSettingsDialogOpen,
|
||||
setSettingsTabValue,
|
||||
} from "@/utils/store/settings";
|
||||
@@ -56,7 +39,7 @@ import {
|
||||
import BackButton from "../buttons/backButton";
|
||||
|
||||
interface ListItemLinkProps {
|
||||
icon?: React.ReactElement;
|
||||
icon?: ReactNode;
|
||||
primary: string;
|
||||
to: string;
|
||||
}
|
||||
@@ -103,6 +86,7 @@ export const AppBar = () => {
|
||||
return usr.data;
|
||||
},
|
||||
enabled: display,
|
||||
throwOnError: true,
|
||||
});
|
||||
const libraries = useQuery({
|
||||
queryKey: ["libraries"],
|
||||
@@ -140,7 +124,7 @@ export const AppBar = () => {
|
||||
event.emit("create-jellyfin-api", api.basePath);
|
||||
queryClient.clear();
|
||||
setAnchorEl(null);
|
||||
navigate("/login/index");
|
||||
navigate({ to: "/login" });
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
@@ -156,7 +140,6 @@ export const AppBar = () => {
|
||||
} else {
|
||||
setDisplay(true);
|
||||
}
|
||||
|
||||
}, [location]);
|
||||
|
||||
const [showDrawer, setShowDrawer] = useState(false);
|
||||
@@ -185,7 +168,7 @@ export const AppBar = () => {
|
||||
<div className="material-symbols-rounded">menu</div>
|
||||
</IconButton>
|
||||
<BackButton />
|
||||
<IconButton onClick={() => navigate({ to: "/home/" })}>
|
||||
<IconButton onClick={() => navigate({ to: "/home" })}>
|
||||
<div
|
||||
className={
|
||||
location.pathname === "/home"
|
||||
@@ -208,7 +191,10 @@ export const AppBar = () => {
|
||||
<IconButton sx={{ p: 0 }} onClick={handleMenuOpen}>
|
||||
{user.isSuccess &&
|
||||
(user.data.PrimaryImageTag === undefined ? (
|
||||
<Avatar className="appBar-avatar" alt={user.data.Name}>
|
||||
<Avatar
|
||||
className="appBar-avatar"
|
||||
alt={user.data.Name ?? "image"}
|
||||
>
|
||||
<span className="material-symbols-rounded appBar-avatar-icon">
|
||||
account_circle
|
||||
</span>
|
||||
@@ -217,7 +203,7 @@ export const AppBar = () => {
|
||||
<Avatar
|
||||
className="appBar-avatar"
|
||||
src={`${api.basePath}/Users/${user.data.Id}/Images/Primary`}
|
||||
alt={user.data.Name}
|
||||
alt={user.data.Name ?? "image"}
|
||||
>
|
||||
<span className="material-symbols-rounded appBar-avatar-icon">
|
||||
account_circle
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
type BaseItemDtoQueryResult,
|
||||
BaseItemKind,
|
||||
ItemFields,
|
||||
MediaProtocol,
|
||||
type PlaybackInfoResponse,
|
||||
SortOrder,
|
||||
type UserItemDataDto,
|
||||
@@ -33,8 +34,10 @@ import { playItem, usePlaybackDataLoadStore } from "@/utils/store/playback";
|
||||
|
||||
import type PlayResult from "@//utils/types/playResult";
|
||||
import { getRuntimeCompact } from "@/utils/date/time";
|
||||
import getSubtitle from "@/utils/methods/getSubtitles";
|
||||
import playbackProfile from "@/utils/playback-profiles";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { axiosClient, useApiInContext } from "@/utils/store/api";
|
||||
import type IntroMediaInfo from "@/utils/types/introMediaInfo";
|
||||
import { getMediaInfoApi } from "@jellyfin/sdk/lib/utils/api/media-info-api";
|
||||
import type { SxProps } from "@mui/material";
|
||||
import type { AxiosResponse } from "axios";
|
||||
@@ -93,6 +96,8 @@ const PlayButton = ({
|
||||
setPlaybackDataLoading(true);
|
||||
let result: undefined | AxiosResponse<BaseItemDtoQueryResult, any>;
|
||||
let mediaSource: undefined | AxiosResponse<PlaybackInfoResponse, any>;
|
||||
let introInfo: undefined | AxiosResponse<IntroMediaInfo, any>;
|
||||
const indexNumber = item.IndexNumber ? item.IndexNumber - 1 : 0;
|
||||
if (playlistItem) {
|
||||
result = await getPlaylistsApi(api).getPlaylistItems({
|
||||
userId: userId,
|
||||
@@ -106,21 +111,37 @@ const PlayButton = ({
|
||||
fields: [ItemFields.MediaSources, ItemFields.MediaStreams],
|
||||
enableUserData: true,
|
||||
userId: userId,
|
||||
startItemId: item.Id,
|
||||
// startItemId: item.Id,
|
||||
});
|
||||
mediaSource = await getMediaInfoApi(api).getPostedPlaybackInfo({
|
||||
audioStreamIndex: currentAudioTrack,
|
||||
subtitleStreamIndex:
|
||||
currentSubTrack === "nosub" ? -1 : currentSubTrack,
|
||||
itemId: result.data.Items[0].Id,
|
||||
itemId: result.data.Items?.[indexNumber].Id,
|
||||
startTimeTicks:
|
||||
result.data.Items[0].UserData?.PlaybackPositionTicks,
|
||||
result.data.Items?.[indexNumber].UserData
|
||||
?.PlaybackPositionTicks,
|
||||
userId: userId,
|
||||
mediaSourceId: result.data.Items[0].MediaSources[0].Id,
|
||||
mediaSourceId:
|
||||
result.data.Items?.[indexNumber].MediaSources?.[0].Id,
|
||||
playbackInfoDto: {
|
||||
DeviceProfile: playbackProfile,
|
||||
},
|
||||
});
|
||||
try {
|
||||
introInfo = (
|
||||
await axiosClient.get(
|
||||
`${api.basePath}/Episode/${result.data.Items?.[indexNumber]?.Id}/IntroTimestamps`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: `MediaBrowser Token=${api.accessToken}`,
|
||||
},
|
||||
},
|
||||
)
|
||||
)?.data;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
break;
|
||||
case BaseItemKind.Series:
|
||||
result = await getTvShowsApi(api).getEpisodes({
|
||||
@@ -133,15 +154,29 @@ const PlayButton = ({
|
||||
audioStreamIndex: currentAudioTrack,
|
||||
subtitleStreamIndex:
|
||||
currentSubTrack === "nosub" ? -1 : currentSubTrack,
|
||||
itemId: result.data.Items[0].Id,
|
||||
itemId: result.data.Items?.[0].Id,
|
||||
startTimeTicks:
|
||||
result.data.Items[0].UserData?.PlaybackPositionTicks,
|
||||
result.data.Items?.[0].UserData?.PlaybackPositionTicks,
|
||||
userId: userId,
|
||||
mediaSourceId: result.data.Items[0].MediaSources[0].Id,
|
||||
mediaSourceId: result.data.Items?.[0].MediaSources?.[0].Id,
|
||||
playbackInfoDto: {
|
||||
DeviceProfile: playbackProfile,
|
||||
},
|
||||
});
|
||||
try {
|
||||
introInfo = (
|
||||
await axiosClient.get(
|
||||
`${api.basePath}/Episode/${result.data.Items?.[0]?.Id}/IntroTimestamps`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: `MediaBrowser Token=${api.accessToken}`,
|
||||
},
|
||||
},
|
||||
)
|
||||
)?.data;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
break;
|
||||
case BaseItemKind.Playlist:
|
||||
result = await getPlaylistsApi(api).getPlaylistItems({
|
||||
@@ -192,9 +227,9 @@ const PlayButton = ({
|
||||
currentSubTrack === "nosub" ? -1 : currentSubTrack,
|
||||
itemId: itemId,
|
||||
startTimeTicks:
|
||||
result.data.Items[0].UserData.PlaybackPositionTicks,
|
||||
result.data.Items?.[0].UserData?.PlaybackPositionTicks,
|
||||
userId: userId,
|
||||
mediaSourceId: result.data.Items[0].MediaSources[0].Id,
|
||||
mediaSourceId: result.data.Items?.[0].MediaSources?.[0].Id,
|
||||
playbackInfoDto: {
|
||||
DeviceProfile: playbackProfile,
|
||||
},
|
||||
@@ -202,7 +237,7 @@ const PlayButton = ({
|
||||
break;
|
||||
}
|
||||
}
|
||||
return { item: result?.data, mediaSource: mediaSource?.data };
|
||||
return { item: result?.data, mediaSource: mediaSource?.data, introInfo };
|
||||
},
|
||||
onSuccess: (result: PlayResult | null) => {
|
||||
if (trackIndex) {
|
||||
@@ -216,58 +251,43 @@ const PlayButton = ({
|
||||
api_key: api?.accessToken,
|
||||
};
|
||||
const urlParams = new URLSearchParams(urlOptions).toString();
|
||||
|
||||
|
||||
const playbackUrl = `${api.basePath}/Audio/${result?.item.Items[0].Id}/universal?${urlParams}`;
|
||||
playAudio(playbackUrl, result?.item.Items[0], undefined);
|
||||
setQueue(result?.item.Items ?? [], 0);
|
||||
} else {
|
||||
const episodeIndex = item.IndexNumber ? item.IndexNumber - 1 : 0;
|
||||
// Creates a queue containing all Episodes for a particular season(series) or collection of movies
|
||||
const queue = result?.item.Items;
|
||||
|
||||
let itemName = item.Name;
|
||||
let episodeTitle = "";
|
||||
if (result?.item.Items[0].SeriesId) {
|
||||
itemName = result?.item.Items[0].SeriesName;
|
||||
episodeTitle = `S${result?.item.Items[0].ParentIndexNumber ?? 0}:E${
|
||||
result?.item.Items[0].IndexNumber ?? 0
|
||||
} ${result?.item.Items[0].Name}`;
|
||||
if (result?.item.Items?.[episodeIndex].SeriesId) {
|
||||
itemName = result?.item.Items[episodeIndex].SeriesName;
|
||||
episodeTitle = `S${result?.item.Items[episodeIndex].ParentIndexNumber ?? 0}:E${
|
||||
result?.item.Items[episodeIndex].IndexNumber ?? 0
|
||||
} ${result?.item.Items[episodeIndex].Name}`;
|
||||
}
|
||||
|
||||
// Select correct subtitle track, this is useful if item is played with playbutton from card since that does not provide coorect default subtitle track index.
|
||||
let selectedSubtitleTrack: number | "nosub" | undefined =
|
||||
currentSubTrack;
|
||||
const subtitles =
|
||||
result?.mediaSource.MediaSources[0].MediaStreams?.filter(
|
||||
(value) => value.Type === "Subtitle",
|
||||
);
|
||||
let enableSubtitles = true;
|
||||
if (currentSubTrack === "nosub") {
|
||||
enableSubtitles = false;
|
||||
selectedSubtitleTrack = "nosub";
|
||||
} else if (!currentSubTrack && subtitles?.length > 0) {
|
||||
selectedSubtitleTrack = subtitles[0].Index;
|
||||
} else {
|
||||
enableSubtitles = false;
|
||||
}
|
||||
|
||||
// Subtitle
|
||||
const subtitle = getSubtitle(
|
||||
currentSubTrack,
|
||||
result?.mediaSource.MediaSources?.[0].MediaStreams,
|
||||
);
|
||||
console.log(subtitle);
|
||||
// URL generation
|
||||
const urlOptions = {
|
||||
Static: true,
|
||||
tag: result?.mediaSource.MediaSources[0].ETag,
|
||||
mediaSourceId: result?.mediaSource.MediaSources[0].Id,
|
||||
tag: result?.mediaSource.MediaSources?.[0].ETag,
|
||||
mediaSourceId: result?.mediaSource.MediaSources?.[0].Id,
|
||||
deviceId: api?.deviceInfo.id,
|
||||
api_key: api?.accessToken,
|
||||
};
|
||||
|
||||
const urlParams = new URLSearchParams(urlOptions).toString();
|
||||
let playbackUrl = `${api?.basePath}/Videos/${result?.mediaSource.MediaSources[0].Id}/stream.${result?.mediaSource.MediaSources[0].Container}?${urlParams}`;
|
||||
|
||||
let playbackUrl = `${api?.basePath}/Videos/${result?.mediaSource.MediaSources?.[0].Id}/stream.${result?.mediaSource.MediaSources?.[0].Container}?${urlParams}`;
|
||||
if (
|
||||
result?.mediaSource.MediaSources[0].SupportsTranscoding &&
|
||||
result?.mediaSource.MediaSources[0].TranscodingUrl
|
||||
result?.mediaSource.MediaSources?.[0].SupportsTranscoding &&
|
||||
result?.mediaSource.MediaSources?.[0].TranscodingUrl
|
||||
) {
|
||||
playbackUrl = `${api.basePath}${result.mediaSource.MediaSources[0].TranscodingUrl}`;
|
||||
} else if (result?.mediaSource.MediaSources[0].hlsStream) {
|
||||
playbackUrl = result.mediaSource.MediaSources[0].hlsStream;
|
||||
}
|
||||
|
||||
playItem(
|
||||
@@ -275,19 +295,18 @@ const PlayButton = ({
|
||||
episodeTitle,
|
||||
currentVideoTrack,
|
||||
currentAudioTrack,
|
||||
selectedSubtitleTrack,
|
||||
result?.mediaSource?.MediaSources[0].Container ?? "mkv",
|
||||
enableSubtitles,
|
||||
result?.mediaSource?.MediaSources?.[0].Container ?? "mkv",
|
||||
playbackUrl,
|
||||
userId,
|
||||
item.UserData?.PlaybackPositionTicks,
|
||||
item.RunTimeTicks,
|
||||
item,
|
||||
queue,
|
||||
0,
|
||||
subtitles,
|
||||
result?.mediaSource.MediaSources[0].Id,
|
||||
episodeIndex,
|
||||
result?.mediaSource.MediaSources?.[0]?.Id,
|
||||
result?.mediaSource.PlaySessionId,
|
||||
subtitle,
|
||||
result?.introInfo,
|
||||
);
|
||||
navigate({ to: "/player" });
|
||||
}
|
||||
@@ -359,7 +378,7 @@ const PlayButton = ({
|
||||
color="white"
|
||||
size={size}
|
||||
>
|
||||
{itemUserData.PlaybackPositionTicks > 0
|
||||
{itemUserData.PlaybackPositionTicks
|
||||
? "Continue Watching"
|
||||
: item?.Type === "MusicAlbum" ||
|
||||
item?.Type === "Audio" ||
|
||||
@@ -412,18 +431,3 @@ const PlayButton = ({
|
||||
};
|
||||
|
||||
export default PlayButton;
|
||||
|
||||
PlayButton.propTypes = {
|
||||
itemId: PropTypes.string,
|
||||
itemUserData: PropTypes.object,
|
||||
userId: PropTypes.string,
|
||||
itemType: PropTypes.string,
|
||||
currentAudioTrack: PropTypes.number,
|
||||
currentSubTrack: PropTypes.number,
|
||||
currentVideoTrack: PropTypes.number,
|
||||
className: PropTypes.string,
|
||||
sx: PropTypes.any,
|
||||
iconProps: PropTypes.any,
|
||||
buttonProps: PropTypes.any,
|
||||
iconOnly: PropTypes.bool,
|
||||
};
|
||||
@@ -4,7 +4,7 @@ import useQueue from "@/utils/store/queue";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { IconButton } from "@mui/material";
|
||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import { useRouteContext } from "@tanstack/react-router";
|
||||
import { useNavigate, useRouteContext } from "@tanstack/react-router";
|
||||
import React from "react";
|
||||
|
||||
const PlayNextButton = () => {
|
||||
@@ -16,9 +16,10 @@ const PlayNextButton = () => {
|
||||
return result.data;
|
||||
},
|
||||
});
|
||||
const navigate = useNavigate();
|
||||
const handlePlayNext = useMutation({
|
||||
mutationKey: ["playNextButton"],
|
||||
mutationFn: () => playItemFromQueue("next", user.data?.Id),
|
||||
mutationFn: () => playItemFromQueue("next", user.data?.Id, api),
|
||||
onError: (error) => [console.error(error)],
|
||||
});
|
||||
const [queueItems, currentItemIndex] = useQueue((state) => [
|
||||
|
||||
@@ -18,7 +18,7 @@ const PlayPreviousButton = () => {
|
||||
});
|
||||
const handlePlayNext = useMutation({
|
||||
mutationKey: ["playPreviousButton"],
|
||||
mutationFn: () => playItemFromQueue("previous", user.data?.Id),
|
||||
mutationFn: () => playItemFromQueue("previous", user.data?.Id, api),
|
||||
onError: (error) => [console.error(error)],
|
||||
});
|
||||
const [queueItems, currentItemIndex] = useQueue((state) => [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** @format */
|
||||
|
||||
import React from "react";
|
||||
import React, { memo } from "react";
|
||||
import { Component, useState } from "react";
|
||||
|
||||
import { useNavigate, useRouteContext } from "@tanstack/react-router";
|
||||
@@ -11,6 +11,7 @@ import Typography from "@mui/material/Typography";
|
||||
import {
|
||||
type BaseItemDto,
|
||||
BaseItemKind,
|
||||
type ImageType,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import LikeButton from "../buttons/likeButton";
|
||||
import MarkPlayedButton from "../buttons/markPlayedButton";
|
||||
@@ -34,7 +35,7 @@ const availableSpecialRoutes = [
|
||||
BaseItemKind.Playlist,
|
||||
];
|
||||
|
||||
export const Card = ({
|
||||
const CardComponent = ({
|
||||
item,
|
||||
cardTitle,
|
||||
cardCaption,
|
||||
@@ -49,22 +50,21 @@ export const Card = ({
|
||||
overrideIcon,
|
||||
}: {
|
||||
item: BaseItemDto;
|
||||
cardTitle: string | null;
|
||||
cardCaption: string | null;
|
||||
imageType: string;
|
||||
cardTitle: string | undefined | null;
|
||||
cardCaption?: string | null | number;
|
||||
imageType: ImageType;
|
||||
cardType: string;
|
||||
queryKey: [];
|
||||
userId: string;
|
||||
seriesId: string | null;
|
||||
hideText: boolean;
|
||||
onClick: () => null | null;
|
||||
disableOverlay: boolean;
|
||||
overrideIcon: any;
|
||||
queryKey?: string[];
|
||||
userId?: string;
|
||||
seriesId?: string | null;
|
||||
hideText?: boolean;
|
||||
onClick?: () => void;
|
||||
disableOverlay?: boolean;
|
||||
overrideIcon?: any;
|
||||
}) => {
|
||||
const api = useApiInContext((s) => s.api);
|
||||
const navigate = useNavigate();
|
||||
const defaultOnClick = () => {
|
||||
|
||||
switch (item.Type) {
|
||||
case BaseItemKind.BoxSet:
|
||||
navigate({ to: "/boxset/$id", params: { id: item.Id } });
|
||||
@@ -94,11 +94,7 @@ export const Card = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
className="card"
|
||||
elevation={0}
|
||||
onClick={onClick ? onClick : defaultOnClick}
|
||||
>
|
||||
<div className="card" onClick={onClick ? onClick : defaultOnClick}>
|
||||
<div className={`card-image-container ${cardType}`}>
|
||||
<ErrorBoundary fallback>
|
||||
<div
|
||||
@@ -124,21 +120,11 @@ export const Card = ({
|
||||
</Typography>
|
||||
</div>
|
||||
</ErrorBoundary>
|
||||
{/* {!!imageBlurhash && (
|
||||
<Blurhash
|
||||
hash={imageBlurhash}
|
||||
width={128}
|
||||
height={128}
|
||||
resolutionX={24}
|
||||
resolutionY={24}
|
||||
className="card-image-blurhash"
|
||||
/>
|
||||
)} */}
|
||||
<div className="card-image-icon-container">
|
||||
{overrideIcon ? getTypeIcon(overrideIcon) : getTypeIcon(item.Type)}
|
||||
</div>
|
||||
<img
|
||||
alt={item.Name}
|
||||
alt={item.Name ?? "blink"}
|
||||
src={
|
||||
overrideIcon === "User"
|
||||
? `${api.basePath}/Users/${item.Id}/Images/Primary`
|
||||
@@ -172,7 +158,7 @@ export const Card = ({
|
||||
userId={userId}
|
||||
itemType={item.Type}
|
||||
currentAudioTrack={0}
|
||||
currentSubTrack={0}
|
||||
currentSubTrack="nosub"
|
||||
currentVideoTrack={0}
|
||||
className="card-play-button"
|
||||
iconProps={{
|
||||
@@ -215,24 +201,6 @@ export const Card = ({
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{/*
|
||||
{item.UserData?.PlaybackPositionTicks > 0 && (
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
value={item.UserData?.PlayedPercentage}
|
||||
style={{
|
||||
position: "absolute",
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
zIndex: 2,
|
||||
height: "6px",
|
||||
background: "rgb(5 5 5 / 0.5) !important",
|
||||
backdropFilter: "blur(5px)",
|
||||
}}
|
||||
color="primary"
|
||||
/>
|
||||
)} */}
|
||||
</div>
|
||||
<div
|
||||
className="card-text-container"
|
||||
@@ -253,3 +221,5 @@ export const Card = ({
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const Card = memo(CardComponent);
|
||||
@@ -10,6 +10,7 @@ import { Blurhash } from "react-blurhash";
|
||||
import "./card.scss";
|
||||
|
||||
import { getRuntimeCompact } from "@/utils/date/time";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useNavigate, useRouteContext } from "@tanstack/react-router";
|
||||
import LikeButton from "../buttons/likeButton";
|
||||
import MarkPlayedButton from "../buttons/markPlayedButton";
|
||||
@@ -43,7 +44,7 @@ export const EpisodeCard = ({
|
||||
disableRunTime = false,
|
||||
onClick,
|
||||
}) => {
|
||||
const api = useRouteContext({ from: "/" }).api;
|
||||
const api = useApiInContext((s) => s.api);
|
||||
const navigate = useNavigate();
|
||||
const defaultOnClick = () => {
|
||||
navigate({ to: `/episode/${item.Id}` });
|
||||
|
||||
@@ -1,45 +1,72 @@
|
||||
|
||||
.carousel {
|
||||
position: relative;
|
||||
height: 70vh;
|
||||
height: 64vh;
|
||||
width: calc(100% + 2*$page-margin);
|
||||
left: -$page-margin;
|
||||
margin-bottom: 3.2em;
|
||||
.slider {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
max-width: 35%;
|
||||
right: $page-margin;
|
||||
}
|
||||
&-button {
|
||||
position: absolute !important;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 100;
|
||||
|
||||
&.right {
|
||||
left: calc(100% + 0.5em);
|
||||
right: 0.5em;
|
||||
}
|
||||
|
||||
&.left {
|
||||
right: calc(100% + 0.5em);
|
||||
left: 0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
&-indicator {
|
||||
height: 3px;
|
||||
width: 100%;
|
||||
border-radius: 10px;
|
||||
transition: background $transition-time-fast,
|
||||
height $transition-time-fast;
|
||||
background: rgb(255 255 255 / 0.5);
|
||||
aspect-ratio: 1.77777;
|
||||
overflow: hidden;
|
||||
border-radius: 2px;
|
||||
padding: 2px;
|
||||
transition: opacity $transition-time-fast;
|
||||
opacity: 0.5;
|
||||
width: auto;
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
height: 6px;
|
||||
background: rgb(255 255 255 / 0.8) !important;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
&-container {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
bottom: -1.5em;
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
gap: 1em;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
&.active {
|
||||
height: 6px;
|
||||
background: white !important;
|
||||
}
|
||||
}
|
||||
&-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
&-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgb(155 155 155 / 0.4);
|
||||
border-radius: 4px;
|
||||
}
|
||||
&.active {
|
||||
opacity: 1;
|
||||
|
||||
.material-symbols-rounded {
|
||||
|
||||
--fill: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,46 +5,60 @@ import IconButton from "@mui/material/IconButton";
|
||||
|
||||
import { useCarouselStore } from "../../utils/store/carousel";
|
||||
import "./carousel.scss";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import CarouselSlide from "../carouselSlide";
|
||||
|
||||
import ReactMultiCarousel from "react-multi-carousel";
|
||||
import Slider from "../Slider";
|
||||
import { getTypeIcon } from "../utils/iconsCollection";
|
||||
|
||||
const swipeConfidenceThreshold = 8000;
|
||||
const swipePower = (offset, velocity) => {
|
||||
return Math.abs(offset) * velocity;
|
||||
};
|
||||
|
||||
const Carousel = ({ content, onChange }) => {
|
||||
const Carousel = ({
|
||||
content,
|
||||
onChange,
|
||||
}: {
|
||||
content: BaseItemDto[];
|
||||
onChange: () => void;
|
||||
}) => {
|
||||
const [currentSlide, setCurrentSlide] = useState(0);
|
||||
|
||||
const [setDirection, dir] = useCarouselStore((state) => [
|
||||
state.setDirection,
|
||||
state.direction,
|
||||
]);
|
||||
|
||||
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
|
||||
useEffect(() => {
|
||||
onChange(currentSlide);
|
||||
}, [content[currentSlide]?.key]);
|
||||
}, [content[currentSlide]?.Id]);
|
||||
|
||||
const api = useApiInContext((s) => s.api);
|
||||
|
||||
const responsive = {
|
||||
superLargeDesktop: {
|
||||
// the naming can be any, depends on you.
|
||||
breakpoint: { max: 4000, min: 3000 },
|
||||
items: 6,
|
||||
},
|
||||
desktop: {
|
||||
breakpoint: { max: 3000, min: 1024 },
|
||||
items: 6,
|
||||
},
|
||||
tablet: {
|
||||
breakpoint: { max: 1024, min: 464 },
|
||||
items: 4,
|
||||
},
|
||||
mobile: {
|
||||
breakpoint: { max: 464, min: 0 },
|
||||
items: 1,
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="carousel">
|
||||
<IconButton
|
||||
className="carousel-button left"
|
||||
onClick={() => {
|
||||
if (currentSlide === 0) {
|
||||
setDirection("left");
|
||||
setCurrentSlide(content.length - 1);
|
||||
}
|
||||
if (currentSlide > 0) {
|
||||
setDirection("left");
|
||||
setCurrentSlide((init) => init - 1);
|
||||
}
|
||||
}}
|
||||
sx={{
|
||||
background: " rgb(200 200 200 / 0.05)",
|
||||
}}
|
||||
// disabled={currentSlide == 0}
|
||||
>
|
||||
<div className="material-symbols-rounded">arrow_left</div>
|
||||
</IconButton>
|
||||
<AnimatePresence mode="sync">
|
||||
<motion.div
|
||||
key={currentSlide}
|
||||
@@ -77,35 +91,31 @@ const Carousel = ({ content, onChange }) => {
|
||||
position: "absolute",
|
||||
}}
|
||||
>
|
||||
{content[currentSlide]}
|
||||
<CarouselSlide
|
||||
item={content[currentSlide]}
|
||||
key={content[currentSlide].Id}
|
||||
/>
|
||||
</motion.div>
|
||||
</AnimatePresence>
|
||||
<IconButton
|
||||
className="carousel-button right"
|
||||
onClick={() => {
|
||||
if (currentSlide === content.length - 1) {
|
||||
setDirection("right");
|
||||
setCurrentSlide(0);
|
||||
} else if (currentSlide < content.length - 1) {
|
||||
setDirection("right");
|
||||
setCurrentSlide((init) => init + 1);
|
||||
}
|
||||
}}
|
||||
// disabled={currentSlide == content.length - 1}
|
||||
sx={{
|
||||
background: " rgb(200 200 200 / 0.05)",
|
||||
}}
|
||||
>
|
||||
<div className="material-symbols-rounded">arrow_right</div>
|
||||
</IconButton>
|
||||
<div className="carousel-indicator-container">
|
||||
{content.map((item, index) => (
|
||||
<div
|
||||
<Slider
|
||||
currentSlide={currentSlide}
|
||||
content={content.map((item, index) => (
|
||||
<motion.div
|
||||
className={
|
||||
currentSlide === index
|
||||
? "carousel-indicator active"
|
||||
: "carousel-indicator"
|
||||
}
|
||||
layout
|
||||
initial={{
|
||||
height: "4.6em",
|
||||
}}
|
||||
whileHover={{
|
||||
height: "5.5em",
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.05,
|
||||
}}
|
||||
key={item.Id}
|
||||
onClick={() => {
|
||||
if (currentSlide > index) {
|
||||
@@ -115,9 +125,24 @@ const Carousel = ({ content, onChange }) => {
|
||||
}
|
||||
setCurrentSlide(index);
|
||||
}}
|
||||
/>
|
||||
>
|
||||
{item.ImageTags?.Primary ? (
|
||||
<img
|
||||
src={api.getItemImageUrl(item.Id, "Thumb", {
|
||||
tag: item.ImageTags.Primary,
|
||||
fillWidth: 300,
|
||||
})}
|
||||
alt={item.Name ?? "item-image"}
|
||||
className="carousel-indicator-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="carousel-indicator-icon">
|
||||
{getTypeIcon(item.Type)}
|
||||
</div>
|
||||
)}
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -14,12 +14,15 @@ import { yellow } from "@mui/material/colors";
|
||||
import { endsAt, getRuntime } from "@/utils/date/time";
|
||||
import { green, red } from "@mui/material/colors";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useNavigate, useRouteContext } from "@tanstack/react-router";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import { getTypeIcon } from "../utils/iconsCollection";
|
||||
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useCarouselStore } from "@/utils/store/carousel";
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import {
|
||||
type BaseItemDto,
|
||||
BaseItemKind,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import LikeButton from "../buttons/likeButton";
|
||||
import MarkPlayedButton from "../buttons/markPlayedButton";
|
||||
@@ -41,7 +44,7 @@ const availableSpecialRoutes = [
|
||||
* @param {Props}
|
||||
* @returns {React.Component}
|
||||
*/
|
||||
const CarouselSlide = ({ item }) => {
|
||||
const CarouselSlide = ({ item }: { item: BaseItemDto }) => {
|
||||
const api = useApiInContext((s) => s.api);
|
||||
const navigate = useNavigate();
|
||||
|
||||
@@ -55,19 +58,31 @@ const CarouselSlide = ({ item }) => {
|
||||
});
|
||||
|
||||
const handleMoreInfo = () => {
|
||||
if (availableSpecialRoutes.includes(item.Type)) {
|
||||
navigate({
|
||||
to: `/${item.Type.toLocaleLowerCase()}/$id`,
|
||||
params: { id: item.Id },
|
||||
});
|
||||
} else if (!!item.Role || item.Type === BaseItemKind.Person) {
|
||||
navigate({ to: "/person/$id", params: { id: item.Id } });
|
||||
} else if (item.Type === BaseItemKind.MusicArtist) {
|
||||
navigate({ to: "/artist/$id", params: { id: item.Id } });
|
||||
} else if (item.Type === BaseItemKind.Episode) {
|
||||
navigate({ to: "/episode/$id", params: { id: item.Id } });
|
||||
} else {
|
||||
navigate({ to: "/item/$id", params: { id: item.Id } });
|
||||
switch (item.Type) {
|
||||
case BaseItemKind.BoxSet:
|
||||
navigate({ to: "/boxset/$id", params: { id: item.Id } });
|
||||
break;
|
||||
case BaseItemKind.Episode:
|
||||
navigate({ to: "/episode/$id", params: { id: item.Id } });
|
||||
break;
|
||||
case BaseItemKind.MusicAlbum:
|
||||
navigate({ to: "/album/$id", params: { id: item.Id } });
|
||||
break;
|
||||
case BaseItemKind.MusicArtist:
|
||||
navigate({ to: "/artist/$id", params: { id: item.Id } });
|
||||
break;
|
||||
case BaseItemKind.Person:
|
||||
navigate({ to: "/person/$id", params: { id: item.Id } });
|
||||
break;
|
||||
case BaseItemKind.Series:
|
||||
navigate({ to: "/series/$id", params: { id: item.Id } });
|
||||
break;
|
||||
case BaseItemKind.Playlist:
|
||||
navigate({ to: "/playlist/$id", params: { id: item.Id } });
|
||||
break;
|
||||
default:
|
||||
navigate({ to: "/item/$id", params: { id: item.Id } });
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -78,50 +93,33 @@ const CarouselSlide = ({ item }) => {
|
||||
className="hero-carousel-slide"
|
||||
sx={{
|
||||
background: "transparent",
|
||||
px: 3,
|
||||
// px: 3,
|
||||
}}
|
||||
elevation={10}
|
||||
elevation={0}
|
||||
>
|
||||
<div className="hero-carousel-background-container">
|
||||
{!!item.ImageBlurHashes.Backdrop && (
|
||||
<>
|
||||
{Object.keys(item.ImageBlurHashes.Backdrop).length !== 0 && (
|
||||
<Blurhash
|
||||
hash={
|
||||
item.ImageBlurHashes.Backdrop[
|
||||
Object.keys(item.ImageBlurHashes.Backdrop)[0]
|
||||
]
|
||||
}
|
||||
// hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
|
||||
width="256"
|
||||
height="179.2"
|
||||
resolutionX={64}
|
||||
resolutionY={45}
|
||||
className="hero-carousel-background-blurhash"
|
||||
punch={1.4}
|
||||
/>
|
||||
)}
|
||||
<img
|
||||
alt={item.Name}
|
||||
className="hero-carousel-background-image"
|
||||
src={
|
||||
item.ParentBackdropItemId
|
||||
? `${api.basePath}/Items/${item.ParentBackdropItemId}/Images/Backdrop?quality=80`
|
||||
: `${api.basePath}/Items/${item.Id}/Images/Backdrop?quality=80&fillHeight=1400`
|
||||
}
|
||||
style={{
|
||||
opacity: 0,
|
||||
}}
|
||||
onLoad={(e) => {
|
||||
e.target.style.opacity = 1;
|
||||
}}
|
||||
loading="eager"
|
||||
/>
|
||||
</>
|
||||
{item.BackdropImageTags?.length ? (
|
||||
<img
|
||||
alt={item.Name}
|
||||
className="hero-carousel-background-image"
|
||||
src={
|
||||
item.ParentBackdropItemId
|
||||
? `${api.basePath}/Items/${item.ParentBackdropItemId}/Images/Backdrop?quality=80`
|
||||
: `${api.basePath}/Items/${item.Id}/Images/Backdrop?quality=80&fillHeight=1400`
|
||||
}
|
||||
style={{
|
||||
opacity: 0,
|
||||
}}
|
||||
onLoad={(e) => {
|
||||
e.target.style.opacity = 1;
|
||||
}}
|
||||
loading="eager"
|
||||
/>
|
||||
) : (
|
||||
<div className="hero-carousel-background-icon-container">
|
||||
{getTypeIcon(item.Type)}
|
||||
</div>
|
||||
)}
|
||||
<div className="hero-carousel-background-icon-container">
|
||||
{getTypeIcon(item.Type)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="hero-carousel-detail">
|
||||
<Typography
|
||||
@@ -207,10 +205,14 @@ const CarouselSlide = ({ item }) => {
|
||||
justifyItems="flex-start"
|
||||
alignItems="center"
|
||||
>
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
|
||||
{item.ProductionYear ? item.ProductionYear : "Unknown"}
|
||||
</Typography>
|
||||
<Chip variant="filled" label={item.OfficialRating ?? "Not Rated"} />
|
||||
{item.PremiereDate && (
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle2">
|
||||
{item.ProductionYear ?? ""}
|
||||
</Typography>
|
||||
)}
|
||||
{item.OfficialRating && (
|
||||
<Chip variant="filled" size="small" label={item.OfficialRating} />
|
||||
)}
|
||||
|
||||
{item.CommunityRating && (
|
||||
<div
|
||||
@@ -222,12 +224,10 @@ const CarouselSlide = ({ item }) => {
|
||||
className="hero-carousel-info-rating"
|
||||
>
|
||||
<div
|
||||
className="material-symbols-rounded "
|
||||
className="material-symbols-rounded fill"
|
||||
style={{
|
||||
// fontSize: "2.2em",
|
||||
color: yellow[400],
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
}}
|
||||
>
|
||||
star
|
||||
@@ -236,13 +236,13 @@ const CarouselSlide = ({ item }) => {
|
||||
style={{
|
||||
opacity: "0.8",
|
||||
}}
|
||||
variant="subtitle1"
|
||||
variant="subtitle2"
|
||||
>
|
||||
{Math.round(item.CommunityRating * 10) / 10}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
{Boolean(item.CriticRating) && (
|
||||
{item.CriticRating && (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
@@ -252,11 +252,9 @@ const CarouselSlide = ({ item }) => {
|
||||
className="hero-carousel-info-rating"
|
||||
>
|
||||
<div
|
||||
className="material-symbols-rounded "
|
||||
className="material-symbols-rounded fill"
|
||||
style={{
|
||||
color: item.CriticRating > 50 ? green[400] : red[400],
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
}}
|
||||
>
|
||||
{item.CriticRating > 50 ? "thumb_up" : "thumb_down"}
|
||||
@@ -265,23 +263,26 @@ const CarouselSlide = ({ item }) => {
|
||||
style={{
|
||||
opacity: "0.8",
|
||||
}}
|
||||
variant="subtitle1"
|
||||
variant="subtitle2"
|
||||
>
|
||||
{item.CriticRating}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!!item.RunTimeTicks && (
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
|
||||
{item.RunTimeTicks && (
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle2">
|
||||
{getRuntime(item.RunTimeTicks)}
|
||||
</Typography>
|
||||
)}
|
||||
{!!item.RunTimeTicks && (
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle1">
|
||||
{endsAt(item.RunTimeTicks)}
|
||||
{item.RunTimeTicks && (
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle2">
|
||||
{endsAt(item.RunTimeTicks - item.UserData.PlaybackPositionTicks)}
|
||||
</Typography>
|
||||
)}
|
||||
<Typography variant="subtitle2" style={{ opacity: 0.8 }}>
|
||||
{item.Genres?.slice(0, 4).join(" / ")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
<Typography
|
||||
component={motion.div}
|
||||
@@ -308,7 +309,6 @@ const CarouselSlide = ({ item }) => {
|
||||
duration: 0.25,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
variant="subtitle1"
|
||||
className="hero-carousel-text"
|
||||
sx={{
|
||||
display: "-webkit-box",
|
||||
@@ -319,6 +319,8 @@ const CarouselSlide = ({ item }) => {
|
||||
WebkitLineClamp: "4",
|
||||
WebkitBoxOrient: "vertical",
|
||||
}}
|
||||
variant="subtitle2"
|
||||
fontWeight={300}
|
||||
>
|
||||
{item.Overview}
|
||||
</Typography>
|
||||
|
||||
@@ -5,15 +5,19 @@ import { CardScroller } from "../../cardScroller/cardScroller";
|
||||
import { CardsSkeleton } from "../../skeleton/cards";
|
||||
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import {
|
||||
type BaseItemDto,
|
||||
BaseItemKind,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import { useRouteContext } from "@tanstack/react-router";
|
||||
|
||||
/**
|
||||
* @description Latest Media Section
|
||||
*/
|
||||
export const LatestMediaSection = ({ latestMediaLib }) => {
|
||||
export const LatestMediaSection = ({
|
||||
latestMediaLib,
|
||||
}: { latestMediaLib: BaseItemDto }) => {
|
||||
const api = useApiInContext((s) => s.api);
|
||||
const user = useQuery({
|
||||
queryKey: ["user"],
|
||||
@@ -23,27 +27,27 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
||||
},
|
||||
networkMode: "always",
|
||||
});
|
||||
const fetchLatestMedia = async (library) => {
|
||||
const fetchLatestMedia = async (library: BaseItemDto) => {
|
||||
const media = await getUserLibraryApi(api).getLatestMedia({
|
||||
userId: user.data.Id,
|
||||
parentId: library,
|
||||
userId: user.data?.Id,
|
||||
parentId: library.Id,
|
||||
limit: 16,
|
||||
fields: ["PrimaryImageAspectRatio"],
|
||||
});
|
||||
return media.data;
|
||||
};
|
||||
const data = useQuery({
|
||||
queryKey: ["homeSection, latestMedia", latestMediaLib],
|
||||
queryFn: () => fetchLatestMedia(latestMediaLib[0]),
|
||||
queryKey: ["home", "latestMedia", latestMediaLib.Id],
|
||||
queryFn: () => fetchLatestMedia(latestMediaLib),
|
||||
enabled: !!user.data,
|
||||
refetchOnMount: true
|
||||
refetchOnMount: true,
|
||||
});
|
||||
if (data.isPending) {
|
||||
return <CardsSkeleton />;
|
||||
}
|
||||
if (data.isSuccess && data.data.length >= 1) {
|
||||
return (
|
||||
<CardScroller displayCards={7} title={`Latest ${latestMediaLib[1]}`}>
|
||||
<CardScroller displayCards={7} title={`Latest ${latestMediaLib.Name}`}>
|
||||
{data.data.map((item) => {
|
||||
return (
|
||||
<Card
|
||||
@@ -75,8 +79,8 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
queryKey={["homeSection, latestMedia", latestMediaLib]}
|
||||
userId={user.data.Id}
|
||||
queryKey={["home", "latestMedia", latestMediaLib.Id]}
|
||||
userId={user.data?.Id}
|
||||
imageBlurhash={
|
||||
!!item.ImageBlurHashes?.Primary &&
|
||||
item.ImageBlurHashes?.Primary[
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import Typography from "@mui/material/Typography";
|
||||
@@ -8,7 +9,7 @@ import { Card } from "../../../card/card";
|
||||
import { CardScroller } from "../../../cardScroller/cardScroller";
|
||||
|
||||
const GenreView = ({ libraryId, genreId, genreName, userId }) => {
|
||||
const api = useRouteContext({ from: "/" }).api;
|
||||
const api = useApiInContext((s) => s.api);
|
||||
|
||||
const items = useQuery({
|
||||
queryKey: ["library", "genreItem", genreId],
|
||||
|
||||
@@ -7,7 +7,9 @@ import PlayButton from "../buttons/playButton";
|
||||
import TextLink from "../textLink";
|
||||
import "./musicTrack.scss";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useRouteContext } from "@tanstack/react-router";
|
||||
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import type { QueryKey } from "@tanstack/react-query";
|
||||
import lyrics_icon from "../../assets/icons/lyrics.svg";
|
||||
|
||||
/**
|
||||
* @typedef {Object} Props
|
||||
@@ -33,6 +35,14 @@ const MusicTrack = ({
|
||||
playlistItemId,
|
||||
trackIndex,
|
||||
className = "",
|
||||
}: {
|
||||
item: BaseItemDto;
|
||||
queryKey: QueryKey;
|
||||
userId: string | undefined;
|
||||
playlistItem: boolean;
|
||||
playlistItemId: string;
|
||||
trackIndex: number;
|
||||
className: string;
|
||||
}) => {
|
||||
const api = useApiInContext((s) => s.api);
|
||||
const [currentTrackItem] = useAudioPlayback((state) => [state.item]);
|
||||
@@ -100,13 +110,24 @@ const MusicTrack = ({
|
||||
opacity: 0.8,
|
||||
}}
|
||||
>
|
||||
{item.ArtistItems.map((artist, index) => (
|
||||
{item.HasLyrics && (
|
||||
<img
|
||||
src={lyrics_icon}
|
||||
alt="Lyrics"
|
||||
className="music-track-info-lyrics"
|
||||
/>
|
||||
)}
|
||||
{item.ArtistItems?.map((artist, index) => (
|
||||
<>
|
||||
<TextLink
|
||||
key={index}
|
||||
variant={"subtitle2"}
|
||||
location={`/artist/${artist.Id}`}
|
||||
otherProps={{
|
||||
fontWeight: 400,
|
||||
style: {
|
||||
textDecoration: "none",
|
||||
},
|
||||
}}
|
||||
>
|
||||
{artist.Name}
|
||||
@@ -6,6 +6,7 @@
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
&-icon {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@@ -20,7 +21,7 @@
|
||||
}
|
||||
&-image {
|
||||
margin: 0.4em;
|
||||
border-radius: $border-radius-default;
|
||||
border-radius: $border-radius_04;
|
||||
overflow: hidden;
|
||||
aspect-ratio: 1;
|
||||
position: relative;
|
||||
@@ -43,6 +44,9 @@
|
||||
}
|
||||
&-info {
|
||||
justify-self: start;
|
||||
&-lyrics {
|
||||
margin-right: 0.4em;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
|
||||
@@ -9,29 +9,30 @@ const NProgress: React.FC<{ isAnimating: boolean | number }> = ({
|
||||
isAnimating,
|
||||
});
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
opacity: isFinished ? 0 : 1,
|
||||
pointerEvents: "none",
|
||||
transition: `opacity ${animationDuration}ms linear`,
|
||||
position: "fixed",
|
||||
top: "0",
|
||||
left: "0",
|
||||
right: "0",
|
||||
zIndex: "10001",
|
||||
}}
|
||||
>
|
||||
<LinearProgress
|
||||
sx={{
|
||||
height: 3,
|
||||
transitionDuration: animationDuration,
|
||||
if (isAnimating) {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
pointerEvents: "none",
|
||||
transition: `opacity ${animationDuration}ms linear`,
|
||||
position: "fixed",
|
||||
top: "0",
|
||||
left: "0",
|
||||
right: "0",
|
||||
zIndex: "10001",
|
||||
}}
|
||||
value={progress * 100}
|
||||
variant="determinate"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
>
|
||||
<LinearProgress
|
||||
sx={{
|
||||
height: 3,
|
||||
transitionDuration: animationDuration,
|
||||
}}
|
||||
value={progress * 100}
|
||||
variant="determinate"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default NProgress;
|
||||
@@ -14,7 +14,9 @@ export const EmptyNotice = ({ extraMsg }) => {
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
flexFlow: "column",
|
||||
// opacity: 0.2,
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import { getSetting, setSetting } from "@/utils/storage/settings";
|
||||
import { FormControlLabel, Switch, Typography } from "@mui/material";
|
||||
import React, { useState } from "react";
|
||||
|
||||
const SettingOption = ({
|
||||
setting,
|
||||
}: { setting: { key: string; name: string; description: string } }) => {
|
||||
const [settingVal, setSettingVal] = useState(
|
||||
async () => (await getSetting(setting.key)) ?? false,
|
||||
);
|
||||
return (
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Switch
|
||||
color="primary"
|
||||
checked={settingVal}
|
||||
onChange={(e) => {
|
||||
setSetting(setting.key, e.target.checked);
|
||||
setSettingVal(e.target.checked);
|
||||
}}
|
||||
name={setting.name}
|
||||
/>
|
||||
}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="subtitle1" fontWeight={400}>
|
||||
{setting.name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="caption"
|
||||
className="settings-option-info-caption"
|
||||
>
|
||||
{setting.description}
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default SettingOption;
|
||||
@@ -28,7 +28,7 @@ import React, { useEffect, useState } from "react";
|
||||
|
||||
import logo from "@/assets/logo.png";
|
||||
|
||||
import { createApi, jellyfin, useApiInContext } from "@/utils/store/api";
|
||||
import { jellyfin, useApiInContext } from "@/utils/store/api";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
@@ -41,14 +41,16 @@ import {
|
||||
setDefaultServer,
|
||||
setServer,
|
||||
} from "@/utils/storage/servers";
|
||||
import { allSettings, getSetting, setSetting } from "@/utils/storage/settings";
|
||||
import { delUser } from "@/utils/storage/user";
|
||||
import type { RecommendedServerInfo } from "@jellyfin/sdk";
|
||||
import { LoadingButton } from "@mui/lab";
|
||||
import { red, yellow } from "@mui/material/colors";
|
||||
import { useNavigate, useRouteContext } from "@tanstack/react-router";
|
||||
import { relaunch } from "@tauri-apps/api/process";
|
||||
import { checkUpdate, installUpdate } from "@tauri-apps/api/updater";
|
||||
import { enqueueSnackbar, useSnackbar } from "notistack";
|
||||
import { relaunch } from "@tauri-apps/plugin-process";
|
||||
import { type Update, check } from "@tauri-apps/plugin-updater";
|
||||
import { useSnackbar } from "notistack";
|
||||
import SettingOption from "../settingOption";
|
||||
|
||||
const motionConfig = {
|
||||
initial: {
|
||||
@@ -64,7 +66,9 @@ const Settings = () => {
|
||||
state.dialogOpen,
|
||||
state.tabValue,
|
||||
]);
|
||||
const api = useApiInContext((s) => s.api);
|
||||
|
||||
const api = useApiInContext((s) => s.api);
|
||||
const createApi = useApiInContext((s) => s.createApi);
|
||||
|
||||
const systemInfo = useQuery({
|
||||
queryKey: ["about", "systemInfo"],
|
||||
@@ -91,7 +95,7 @@ const Settings = () => {
|
||||
|
||||
const updateInfo = useQuery({
|
||||
queryKey: ["about", "updater"],
|
||||
queryFn: async () => await checkUpdate(),
|
||||
queryFn: async () => await check(),
|
||||
enabled: open,
|
||||
});
|
||||
|
||||
@@ -117,7 +121,7 @@ const Settings = () => {
|
||||
},
|
||||
onSuccess: async () => {
|
||||
setSettingsDialogOpen(false);
|
||||
navigate({ to: "/login/index" });
|
||||
navigate({ to: "/login" });
|
||||
},
|
||||
onError: (error) => {
|
||||
console.error(error);
|
||||
@@ -259,27 +263,8 @@ const Settings = () => {
|
||||
{/* General */}
|
||||
{tabValue === 1 && (
|
||||
<div className="settings-container">
|
||||
{Array.from(new Array(10)).map((i) => (
|
||||
<FormControlLabel
|
||||
key={i}
|
||||
value="start"
|
||||
control={<Switch color="primary" />}
|
||||
label={
|
||||
<div className="settings-option-info">
|
||||
<Typography variant="subtitle1">
|
||||
Some dummy setting
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="caption"
|
||||
className="settings-option-info-caption"
|
||||
>
|
||||
this a test
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
labelPlacement="start"
|
||||
className="settings-option"
|
||||
/>
|
||||
{allSettings.general.map((setting) => (
|
||||
<SettingOption key={setting.key} setting={setting} />
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
@@ -436,7 +421,7 @@ const Settings = () => {
|
||||
className="material-symbols-rounded"
|
||||
style={{ "--wght": 500 }}
|
||||
>
|
||||
{updateInfo.data?.shouldUpdate
|
||||
{updateInfo.data?.available
|
||||
? "new_release"
|
||||
: "new_releases"}
|
||||
</span>
|
||||
@@ -446,9 +431,7 @@ const Settings = () => {
|
||||
{applicationVersion}
|
||||
</Typography>
|
||||
}
|
||||
color={
|
||||
updateInfo.data?.shouldUpdate ? "error" : "success"
|
||||
}
|
||||
color={updateInfo.data?.available ? "error" : "success"}
|
||||
size="small"
|
||||
style={{
|
||||
width: "fit-content !important",
|
||||
@@ -462,7 +445,7 @@ const Settings = () => {
|
||||
<Typography variant="subtitle2">
|
||||
{updateInfo.isFetching ? (
|
||||
"Checking for new updates..."
|
||||
) : updateInfo.data?.shouldUpdate ? (
|
||||
) : updateInfo.data?.available ? (
|
||||
<Chip
|
||||
icon={
|
||||
<span className="material-symbols-rounded">
|
||||
@@ -491,12 +474,12 @@ const Settings = () => {
|
||||
}}
|
||||
loading={updateInfo.isFetching || updating}
|
||||
variant="contained"
|
||||
disabled={!updateInfo.data?.shouldUpdate}
|
||||
disabled={!updateInfo.data?.available}
|
||||
loadingPosition="start"
|
||||
onClick={async () => {
|
||||
if (updateInfo.data?.shouldUpdate) {
|
||||
if (updateInfo.data?.available) {
|
||||
setUpdating(true);
|
||||
await installUpdate();
|
||||
await updateInfo.data?.downloadAndInstall();
|
||||
enqueueSnackbar(
|
||||
"Update has been installed! You need to relaunch JellyPlayer.",
|
||||
{
|
||||
@@ -509,7 +492,7 @@ const Settings = () => {
|
||||
>
|
||||
{updateInfo.isFetching
|
||||
? "Checking for Update..."
|
||||
: updateInfo.data?.shouldUpdate
|
||||
: updateInfo.data?.available
|
||||
? "Update"
|
||||
: "No Update Found"}
|
||||
</LoadingButton>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import { Skeleton } from "@mui/material";
|
||||
import React from "react";
|
||||
|
||||
const LibraryItemsSkeleton = () => {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
width: "100%",
|
||||
overflow: "visible",
|
||||
flexWrap: "wrap",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
{Array.from(new Array(18)).map((item, index) => (
|
||||
<Skeleton
|
||||
key={index}
|
||||
variant="rounded"
|
||||
sx={{
|
||||
flexBasis: 185,
|
||||
height: "auto",
|
||||
aspectRatio: 0.6666,
|
||||
// background: "red",
|
||||
marginRight: "1.5em",
|
||||
marginBottom: "1.5em",
|
||||
flexShrink: 1,
|
||||
flexGrow: 0,
|
||||
borderRadius: "10px",
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default LibraryItemsSkeleton;
|
||||
@@ -1,17 +1,32 @@
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { RouterProvider, createRouter } from "@tanstack/react-router";
|
||||
import {
|
||||
RouterProvider,
|
||||
createRouteMask,
|
||||
createRouter,
|
||||
} from "@tanstack/react-router";
|
||||
import React, { Suspense } from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
// Import the generated route tree
|
||||
import { routeTree } from "./routeTree.gen";
|
||||
|
||||
//TODO: Need help implementing modal routes in TanStack Router
|
||||
// const SearchMask = createRouteMask({
|
||||
// routeTree,
|
||||
// from: "/searchModal,
|
||||
// to: "/search",
|
||||
// params: true,
|
||||
// });
|
||||
|
||||
// Create a new router instance
|
||||
const router = createRouter({
|
||||
routeTree,
|
||||
context: {
|
||||
api: undefined!,
|
||||
createApi: undefined!,
|
||||
user: undefined,
|
||||
jellyfinSDK: undefined!,
|
||||
},
|
||||
defaultPreload: "intent",
|
||||
});
|
||||
|
||||
// Register the router instance for type safety
|
||||
@@ -21,9 +36,6 @@ declare module "@tanstack/react-router" {
|
||||
}
|
||||
}
|
||||
|
||||
import { ThemeProvider } from "@mui/material";
|
||||
import { SnackbarProvider } from "notistack";
|
||||
import { theme } from "./theme";
|
||||
import { ApiProvider, useApiInContext } from "./utils/store/api";
|
||||
|
||||
export const queryClient = new QueryClient({
|
||||
@@ -38,9 +50,14 @@ export const queryClient = new QueryClient({
|
||||
});
|
||||
|
||||
function ProviderWrapper() {
|
||||
const api = useApiInContext((s) => s.api);
|
||||
const createApi = useApiInContext((s) => s.createApi);
|
||||
return <RouterProvider router={router} context={{ api, createApi }} />;
|
||||
const [api, createApi, jellyfinSDK] = useApiInContext((s) => [
|
||||
s.api,
|
||||
s.createApi,
|
||||
s.jellyfin,
|
||||
]);
|
||||
return (
|
||||
<RouterProvider router={router} context={{ api, createApi, jellyfinSDK }} />
|
||||
);
|
||||
}
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root")!).render(
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
import { Route as rootRoute } from './routes/__root'
|
||||
import { Route as ApiImport } from './routes/_api'
|
||||
import { Route as IndexImport } from './routes/index'
|
||||
import { Route as ErrorCodeImport } from './routes/error/$code'
|
||||
import { Route as ApiSearchIndexImport } from './routes/_api/search/index'
|
||||
import { Route as ApiPlayerIndexImport } from './routes/_api/player/index'
|
||||
import { Route as ApiLoginIndexImport } from './routes/_api/login/index'
|
||||
@@ -46,6 +47,11 @@ const IndexRoute = IndexImport.update({
|
||||
getParentRoute: () => rootRoute,
|
||||
} as any)
|
||||
|
||||
const ErrorCodeRoute = ErrorCodeImport.update({
|
||||
path: '/error/$code',
|
||||
getParentRoute: () => rootRoute,
|
||||
} as any)
|
||||
|
||||
const ApiSearchIndexRoute = ApiSearchIndexImport.update({
|
||||
path: '/search/',
|
||||
getParentRoute: () => ApiRoute,
|
||||
@@ -164,6 +170,13 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof ApiImport
|
||||
parentRoute: typeof rootRoute
|
||||
}
|
||||
'/error/$code': {
|
||||
id: '/error/$code'
|
||||
path: '/error/$code'
|
||||
fullPath: '/error/$code'
|
||||
preLoaderRoute: typeof ErrorCodeImport
|
||||
parentRoute: typeof rootRoute
|
||||
}
|
||||
'/_api/album/$id': {
|
||||
id: '/_api/album/$id'
|
||||
path: '/album/$id'
|
||||
@@ -330,6 +343,7 @@ export const routeTree = rootRoute.addChildren({
|
||||
ApiSearchIndexRoute,
|
||||
ApiLoginUserIdUserNameRoute,
|
||||
}),
|
||||
ErrorCodeRoute,
|
||||
SetupServerAddRoute,
|
||||
SetupServerErrorRoute,
|
||||
SetupServerListRoute,
|
||||
@@ -345,6 +359,7 @@ export const routeTree = rootRoute.addChildren({
|
||||
"children": [
|
||||
"/",
|
||||
"/_api",
|
||||
"/error/$code",
|
||||
"/setup/server/add",
|
||||
"/setup/server/error",
|
||||
"/setup/server/list"
|
||||
@@ -375,6 +390,9 @@ export const routeTree = rootRoute.addChildren({
|
||||
"/_api/login/$userId/$userName"
|
||||
]
|
||||
},
|
||||
"/error/$code": {
|
||||
"filePath": "error/$code.tsx"
|
||||
},
|
||||
"/_api/album/$id": {
|
||||
"filePath": "_api/album/$id.tsx",
|
||||
"parent": "/_api"
|
||||
|
||||
@@ -23,18 +23,12 @@ import { useIsFetching, useIsMutating } from "@tanstack/react-query";
|
||||
import {
|
||||
Outlet,
|
||||
ScrollRestoration,
|
||||
createRootRoute,
|
||||
createRootRouteWithContext,
|
||||
useNavigate,
|
||||
useRouterState,
|
||||
} from "@tanstack/react-router";
|
||||
import { TanStackRouterDevtools } from "@tanstack/router-devtools";
|
||||
import { relaunch } from "@tauri-apps/api/process";
|
||||
import {
|
||||
type UpdateManifest,
|
||||
checkUpdate,
|
||||
installUpdate,
|
||||
} from "@tauri-apps/api/updater";
|
||||
import { relaunch } from "@tauri-apps/plugin-process";
|
||||
import { type Update, check } from "@tauri-apps/plugin-updater";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
import { SnackbarProvider, useSnackbar } from "notistack";
|
||||
import React, { Suspense, useEffect, useLayoutEffect, useState } from "react";
|
||||
@@ -49,7 +43,8 @@ import "@fontsource-variable/jetbrains-mono";
|
||||
import "@fontsource-variable/noto-sans";
|
||||
|
||||
import "material-symbols/rounded.scss";
|
||||
import type { Api } from "@jellyfin/sdk";
|
||||
import type { Api, Jellyfin } from "@jellyfin/sdk";
|
||||
import type { UserDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||
|
||||
type ApiContext = {
|
||||
@@ -58,34 +53,28 @@ type ApiContext = {
|
||||
serverAddress: string | undefined,
|
||||
accessToken: string | undefined,
|
||||
) => void;
|
||||
user: UserDto | null | undefined;
|
||||
jellyfinSDK: Jellyfin;
|
||||
};
|
||||
|
||||
export const Route = createRootRouteWithContext<ApiContext>()({
|
||||
errorComponent: (error) => {
|
||||
console.error(error.error);
|
||||
},
|
||||
component: () => {
|
||||
"use memo";
|
||||
const isQueryFetching = useIsFetching();
|
||||
const isMutating = useIsMutating();
|
||||
const routeIsLoading = useRouterState().isLoading;
|
||||
const [updateDialog, setUpdateDialog] = useState(false);
|
||||
const [updateDialogButton, setUpdateDialogButton] = useState(false);
|
||||
const [updateInfo, setUpdateInfo] = useState<UpdateManifest | undefined>(
|
||||
undefined,
|
||||
);
|
||||
const [updateInfo, setUpdateInfo] = useState<Update | undefined>(undefined);
|
||||
useLayoutEffect(() => {
|
||||
async function checkForUpdates() {
|
||||
try {
|
||||
const { shouldUpdate, manifest } = await checkUpdate();
|
||||
const update = await check();
|
||||
|
||||
if (shouldUpdate) {
|
||||
setUpdateInfo(manifest);
|
||||
if (update?.available) {
|
||||
setUpdateInfo(update);
|
||||
setUpdateDialog(true);
|
||||
|
||||
console.log(
|
||||
`Update found : ${manifest?.version}, ${manifest?.date}`,
|
||||
);
|
||||
console.log(`Update found : ${update.version}, ${update.date}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
@@ -113,6 +102,11 @@ export const Route = createRootRouteWithContext<ApiContext>()({
|
||||
<Settings />
|
||||
<EasterEgg />
|
||||
<NProgress
|
||||
key={
|
||||
isQueryFetching || isMutating || routeIsLoading
|
||||
? `show${(isQueryFetching ?? 1) * (isMutating ?? 1) * (routeIsLoading ?? 1)}`
|
||||
: "hide"
|
||||
}
|
||||
isAnimating={isQueryFetching || isMutating || routeIsLoading}
|
||||
/>
|
||||
|
||||
@@ -219,7 +213,7 @@ export const Route = createRootRouteWithContext<ApiContext>()({
|
||||
loadingIndicator="Updating..."
|
||||
onClick={async () => {
|
||||
setUpdateDialogButton(true);
|
||||
await installUpdate();
|
||||
await updateInfo.downloadAndInstall();
|
||||
enqueueSnackbar(
|
||||
"Update has been installed! You need to relaunch JellyPlayer.",
|
||||
{
|
||||
|
||||
@@ -1,42 +1,65 @@
|
||||
import {
|
||||
getAllServers,
|
||||
getDefaultServer,
|
||||
getServer,
|
||||
} from "@/utils/storage/servers";
|
||||
import { getDefaultServer, getServer } from "@/utils/storage/servers";
|
||||
import { getUser } from "@/utils/storage/user";
|
||||
import { axiosClient, useApiInContext } from "@/utils/store/api";
|
||||
import { axiosClient } from "@/utils/store/api";
|
||||
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { Outlet, createFileRoute, redirect } from "@tanstack/react-router";
|
||||
import React from "react";
|
||||
import { Suspense } from "react";
|
||||
|
||||
export const Route = createFileRoute("/_api")({
|
||||
beforeLoad: async ({ context, location }) => {
|
||||
console.log(context.api);
|
||||
// console.log(context.api);
|
||||
if (!context.api) {
|
||||
const currentServerId = await getDefaultServer();
|
||||
if (currentServerId) {
|
||||
const currentServer = await getServer(currentServerId);
|
||||
const apiTemp = context.jellyfinSDK.createApi(
|
||||
currentServer?.address,
|
||||
null,
|
||||
axiosClient,
|
||||
);
|
||||
try {
|
||||
await getSystemApi(apiTemp).getPingSystem();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw redirect({
|
||||
to: "/error/$code",
|
||||
params: {
|
||||
code: "101",
|
||||
},
|
||||
});
|
||||
}
|
||||
const userOnDisk = await getUser();
|
||||
if (userOnDisk) {
|
||||
if (location.pathname !== "/login/manual") {
|
||||
const apiTemp = context.jellyfinSDK.createApi(
|
||||
currentServer?.address,
|
||||
userOnDisk.AccessToken,
|
||||
axiosClient,
|
||||
);
|
||||
try {
|
||||
await getUserApi(apiTemp).getCurrentUser();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw redirect({
|
||||
to: "/login/manual",
|
||||
search: {
|
||||
redirect: location.href,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
context.createApi(currentServer?.address, userOnDisk.AccessToken);
|
||||
} else {
|
||||
context.createApi(currentServer?.address, undefined); // Creates Api
|
||||
}
|
||||
}
|
||||
} else if (context.api) {
|
||||
try {
|
||||
await getSystemApi(context.api).getPingSystem(); // Verify server status
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw redirect({
|
||||
to: "/setup/server/error",
|
||||
});
|
||||
}
|
||||
if (context.api.accessToken) {
|
||||
if (context.api.accessToken && location.pathname !== "/login/manual") {
|
||||
try {
|
||||
await getUserApi(context.api).getCurrentUser(); // Verify user is able to authenticate
|
||||
return {
|
||||
user: await getUserApi(context.api).getCurrentUser(),
|
||||
}; // Verify user is able to authenticate
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw redirect({
|
||||
|
||||
@@ -7,10 +7,9 @@
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border-radius: 10px !important;
|
||||
overflow: hidden;
|
||||
overflow: visible;
|
||||
margin: 0 auto;
|
||||
border: 1.2px solid rgb(255 255 255 / 0.15);
|
||||
border: none;
|
||||
// box-shadow: 0 0 30px black !important;
|
||||
}
|
||||
&-background {
|
||||
@@ -24,32 +23,31 @@
|
||||
&-container {
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
top: 0;
|
||||
top: -4.4em;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 90vh;
|
||||
filter: brightness(0.8);
|
||||
mask-image: linear-gradient(to left, black 50%, transparent), linear-gradient(to bottom, black 60%, transparent);
|
||||
-webkit-mask-image: linear-gradient(to left,
|
||||
black 50%,
|
||||
transparent), linear-gradient(to bottom, black 40%, transparent);
|
||||
mask-composite: intersect;
|
||||
}
|
||||
&-image {
|
||||
position: absolute;
|
||||
background-size: cover;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background-position: center;
|
||||
object-fit: cover;
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
height: 90vh;
|
||||
transition: opacity 0.5s;
|
||||
mask-image: linear-gradient(to left, black 50%, transparent);
|
||||
-webkit-mask-image: linear-gradient(
|
||||
to left,
|
||||
black 50%,
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
&-icon-container {
|
||||
position: absolute;
|
||||
// background: $clr-gradient-dark;
|
||||
@@ -60,6 +58,7 @@
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-blend-mode: overlay;
|
||||
height: 90vh;
|
||||
.material-symbols-rounded {
|
||||
position: absolute;
|
||||
font-size: 15em !important;
|
||||
@@ -67,7 +66,7 @@
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 50,
|
||||
"opsz" 60;
|
||||
"opsz" 60;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,16 +88,17 @@
|
||||
display: flex;
|
||||
height: 100%;
|
||||
width: 80%;
|
||||
padding: 2.5em;
|
||||
padding: $page-margin;
|
||||
padding-bottom: 0;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
justify-content: flex-end;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.backdropContainer {
|
||||
background: linear-gradient(
|
||||
45deg,
|
||||
45deg,
|
||||
$clr-background-default,
|
||||
$clr-background-light
|
||||
);
|
||||
@@ -113,13 +113,14 @@
|
||||
width: 100%;
|
||||
}
|
||||
&-text {
|
||||
-webkit-line-clamp: 2 !important;
|
||||
&-logo {
|
||||
max-width: 7em;
|
||||
max-height: 2em;
|
||||
object-fit: contain;
|
||||
object-position: bottom;
|
||||
}
|
||||
}
|
||||
-webkit-line-clamp: 2 !important;
|
||||
|
||||
&-logo {
|
||||
max-width: 7em;
|
||||
max-height: 2em;
|
||||
object-fit: contain;
|
||||
object-position: bottom;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,29 +19,35 @@ import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||
|
||||
import { createFileRoute, useNavigate } from "@tanstack/react-router";
|
||||
import { Outlet, createFileRoute, useNavigate } from "@tanstack/react-router";
|
||||
|
||||
import { setBackdrop, useBackdropStore } from "@/utils/store/backdrop";
|
||||
import { setBackdrop } from "@/utils/store/backdrop";
|
||||
|
||||
import CarouselSlide from "@/components/carouselSlide";
|
||||
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
|
||||
import {
|
||||
type BaseItemDto,
|
||||
BaseItemKind,
|
||||
ItemFields,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { useSnackbar } from "notistack";
|
||||
import { ErrorBoundary } from "react-error-boundary";
|
||||
|
||||
export const Route = createFileRoute("/_api/home/")({
|
||||
component: Home,
|
||||
onError: (err) => {
|
||||
console.log(err);
|
||||
},
|
||||
});
|
||||
|
||||
function Home() {
|
||||
const api = useApiInContext((s) => s.api);
|
||||
|
||||
const user = useQuery({
|
||||
queryKey: ["user"],
|
||||
queryFn: async () => {
|
||||
const usr = await getUserApi(api).getCurrentUser();
|
||||
console.log(usr.data);
|
||||
return usr.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
@@ -52,7 +58,7 @@ function Home() {
|
||||
queryKey: ["libraries"],
|
||||
queryFn: async () => {
|
||||
const libs = await getUserViewsApi(api).getUserViews({
|
||||
userId: user.data.Id,
|
||||
userId: user.data?.Id,
|
||||
});
|
||||
return libs.data;
|
||||
},
|
||||
@@ -64,11 +70,10 @@ function Home() {
|
||||
queryKey: ["home", "latestMedia"],
|
||||
queryFn: async () => {
|
||||
const media = await getUserLibraryApi(api).getLatestMedia({
|
||||
userId: user.data.Id,
|
||||
userId: user.data?.Id,
|
||||
fields: [
|
||||
ItemFields.Overview,
|
||||
ItemFields.ParentId,
|
||||
"ParentIndexNumber",
|
||||
ItemFields.SeasonUserData,
|
||||
ItemFields.IsHd,
|
||||
ItemFields.MediaStreams,
|
||||
@@ -86,7 +91,7 @@ function Home() {
|
||||
queryKey: ["home", "resume", "video"],
|
||||
queryFn: async () => {
|
||||
const resumeItems = await getItemsApi(api).getResumeItems({
|
||||
userId: user.data.Id,
|
||||
userId: user.data?.Id,
|
||||
limit: 10,
|
||||
mediaTypes: ["Video"],
|
||||
enableUserData: true,
|
||||
@@ -102,7 +107,7 @@ function Home() {
|
||||
queryKey: ["home", "resume", "audio"],
|
||||
queryFn: async () => {
|
||||
const resumeItems = await getItemsApi(api).getResumeItems({
|
||||
userId: user.data.Id,
|
||||
userId: user.data?.Id,
|
||||
limit: 10,
|
||||
mediaTypes: ["Audio"],
|
||||
enableUserData: true,
|
||||
@@ -117,14 +122,12 @@ function Home() {
|
||||
queryKey: ["home", "upNext"],
|
||||
queryFn: async () => {
|
||||
const upNext = await getTvShowsApi(api).getNextUp({
|
||||
userId: user.data.Id,
|
||||
userId: user.data?.Id,
|
||||
fields: [
|
||||
ItemFields.PrimaryImageAspectRatio,
|
||||
ItemFields.MediaStreams,
|
||||
ItemFields.MediaSources,
|
||||
ItemFields.ParentId,
|
||||
"IndexNumber",
|
||||
"ParentIndexNumber",
|
||||
],
|
||||
limit: 10,
|
||||
});
|
||||
@@ -134,38 +137,31 @@ function Home() {
|
||||
refetchOnMount: true,
|
||||
});
|
||||
|
||||
const [latestMediaLibs, setLatestMediaLibs] = useState([]);
|
||||
const [latestMediaLibs, setLatestMediaLibs] = useState<
|
||||
BaseItemDto[] | undefined
|
||||
>([]);
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
const excludeTypes = ["boxsets", "playlists", "livetv", "channels"];
|
||||
|
||||
let tempData = [];
|
||||
const [excludeTypes] = useState(
|
||||
() => new Set(["boxsets", "playlists", "livetv", "channels"]),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (libraries.isSuccess) {
|
||||
libraries.data.Items.map((lib) => {
|
||||
if (excludeTypes.includes(lib.CollectionType)) {
|
||||
return;
|
||||
}
|
||||
tempData = latestMediaLibs;
|
||||
if (
|
||||
!tempData.some(
|
||||
(el) => JSON.stringify(el) === JSON.stringify([lib.Id, lib.Name]),
|
||||
)
|
||||
) {
|
||||
tempData.push([lib.Id, lib.Name]);
|
||||
setLatestMediaLibs(tempData);
|
||||
}
|
||||
});
|
||||
const latestMediaLibsTemp = libraries.data.Items?.reduce(
|
||||
(filteredItems: BaseItemDto[], currentItem) => {
|
||||
if (!excludeTypes.has(currentItem.Type)) {
|
||||
filteredItems.push(currentItem);
|
||||
}
|
||||
return filteredItems;
|
||||
},
|
||||
[],
|
||||
);
|
||||
setLatestMediaLibs(latestMediaLibsTemp);
|
||||
}
|
||||
}, [libraries.isSuccess]);
|
||||
|
||||
if (user.isPaused) {
|
||||
user.refetch();
|
||||
console.log(user.isError);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<main
|
||||
@@ -179,22 +175,35 @@ function Home() {
|
||||
{latestMedia.isPending ? (
|
||||
<CarouselSkeleton />
|
||||
) : (
|
||||
latestMedia.data.length > 0 && (
|
||||
latestMedia.data?.length && (
|
||||
<Carousel
|
||||
content={latestMedia.data?.map((item) => (
|
||||
<CarouselSlide item={item} key={item.Id} />
|
||||
))}
|
||||
onChange={(now) => {
|
||||
content={latestMedia.data}
|
||||
onChange={(now: number) => {
|
||||
if (latestMedia.isSuccess && latestMedia.data.length > 0) {
|
||||
if (latestMedia.data[now]?.ParentBackdropImageTags) {
|
||||
setBackdrop(
|
||||
`${api.basePath}/Items/${latestMedia.data[now].ParentBackdropItemId}/Images/Backdrop`,
|
||||
latestMedia.data[now].Id,
|
||||
api.getItemImageUrl(
|
||||
latestMedia.data[now].Id,
|
||||
"Backdrop",
|
||||
{
|
||||
tag: latestMedia.data[now]
|
||||
.ParentBackdropImageTags[0],
|
||||
},
|
||||
),
|
||||
latestMedia.data[now]?.ParentBackdropImageTags[0] ??
|
||||
latestMedia.data[now].Id,
|
||||
);
|
||||
} else {
|
||||
setBackdrop(
|
||||
`${api.basePath}/Items/${latestMedia.data[now].Id}/Images/Backdrop`,
|
||||
latestMedia.data[now].Id,
|
||||
api.getItemImageUrl(
|
||||
latestMedia.data[now].Id,
|
||||
"Backdrop",
|
||||
{
|
||||
tag: latestMedia.data[now].BackdropImageTags[0],
|
||||
},
|
||||
),
|
||||
latestMedia.data[now]?.BackdropImageTags[0] ??
|
||||
latestMedia.data[now].Id,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -216,7 +225,7 @@ function Home() {
|
||||
) : (
|
||||
<CardScroller displayCards={4} title="Libraries">
|
||||
{libraries.status === "success" &&
|
||||
libraries.data.Items.map((item) => {
|
||||
libraries.data.Items?.map((item) => {
|
||||
return (
|
||||
<Card
|
||||
key={item.Id}
|
||||
@@ -225,12 +234,11 @@ function Home() {
|
||||
imageType="Primary"
|
||||
cardType="thumb"
|
||||
disableOverlay
|
||||
onClick={() => navigate({ to: `/library/${item.Id}` })}
|
||||
imageBlurhash={
|
||||
!!item.ImageBlurHashes?.Primary &&
|
||||
item.ImageBlurHashes?.Primary[
|
||||
Object.keys(item.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
onClick={() =>
|
||||
navigate({
|
||||
to: "/library/$id",
|
||||
params: { id: item.Id ?? "" },
|
||||
})
|
||||
}
|
||||
overrideIcon={item.CollectionType}
|
||||
/>
|
||||
@@ -248,11 +256,11 @@ function Home() {
|
||||
>
|
||||
{upNextItems.isPending ? (
|
||||
<CardsSkeleton />
|
||||
) : upNextItems.isSuccess && upNextItems.data.Items.length === 0 ? (
|
||||
) : upNextItems.isSuccess && !upNextItems.data.TotalRecordCount ? (
|
||||
<></>
|
||||
) : (
|
||||
<CardScroller displayCards={4} title="Up Next">
|
||||
{upNextItems.data.Items.map((item) => {
|
||||
{upNextItems.data?.Items?.map((item) => {
|
||||
return (
|
||||
<Card
|
||||
key={item.Id}
|
||||
@@ -265,7 +273,7 @@ function Home() {
|
||||
imageType={
|
||||
item.Type === BaseItemKind.Episode
|
||||
? "Primary"
|
||||
: Object.keys(item.ImageTags).includes("Thumb")
|
||||
: item.ImageTags?.Thumb
|
||||
? "Thumb"
|
||||
: "Backdrop"
|
||||
}
|
||||
@@ -288,13 +296,7 @@ function Home() {
|
||||
}
|
||||
cardType="thumb"
|
||||
queryKey={["home", "upNext"]}
|
||||
userId={user.data.Id}
|
||||
imageBlurhash={
|
||||
!!item.ImageBlurHashes?.Primary &&
|
||||
item.ImageBlurHashes?.Primary[
|
||||
Object.keys(item.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
}
|
||||
userId={user.data?.Id}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@@ -311,11 +313,11 @@ function Home() {
|
||||
{resumeItemsVideo.isPending ? (
|
||||
<CardsSkeleton />
|
||||
) : resumeItemsVideo.isSuccess &&
|
||||
resumeItemsVideo.data.Items.length === 0 ? (
|
||||
!resumeItemsVideo.data.TotalRecordCount ? (
|
||||
<></>
|
||||
) : (
|
||||
<CardScroller displayCards={4} title="Continue Watching">
|
||||
{resumeItemsVideo.data.Items.map((item) => {
|
||||
{resumeItemsVideo.data?.Items?.map((item) => {
|
||||
return (
|
||||
<Card
|
||||
key={item.Id}
|
||||
@@ -328,7 +330,7 @@ function Home() {
|
||||
imageType={
|
||||
item.Type === BaseItemKind.Episode
|
||||
? "Primary"
|
||||
: Object.keys(item.ImageTags).includes("Thumb")
|
||||
: item.ImageTags?.Thumb
|
||||
? "Thumb"
|
||||
: "Backdrop"
|
||||
}
|
||||
@@ -347,13 +349,7 @@ function Home() {
|
||||
}
|
||||
cardType="thumb"
|
||||
queryKey={["home", "resume", "video"]}
|
||||
userId={user.data.Id}
|
||||
imageBlurhash={
|
||||
!!item.ImageBlurHashes?.Primary &&
|
||||
item.ImageBlurHashes?.Primary[
|
||||
Object.keys(item.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
}
|
||||
userId={user.data?.Id}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@@ -370,32 +366,21 @@ function Home() {
|
||||
{resumeItemsAudio.isPending ? (
|
||||
<CardsSkeleton />
|
||||
) : resumeItemsAudio.isSuccess &&
|
||||
resumeItemsAudio.data.Items.length === 0 ? (
|
||||
!resumeItemsAudio.data.TotalRecordCount ? (
|
||||
<></>
|
||||
) : (
|
||||
<CardScroller displayCards={4} title="Continue Listening">
|
||||
{resumeItemsAudio.data.Items.map((item) => {
|
||||
{resumeItemsAudio.data?.Items?.map((item) => {
|
||||
return (
|
||||
<Card
|
||||
key={item.Id}
|
||||
item={item}
|
||||
cardTitle={item.Name}
|
||||
imageType={
|
||||
item.Type === BaseItemKind.Episode
|
||||
? "Primary"
|
||||
: Object.keys(item.ImageTags).includes("Thumb")
|
||||
? "Thumb"
|
||||
: "Backdrop"
|
||||
}
|
||||
imageType="Primary"
|
||||
cardCaption={item.ProductionYear}
|
||||
cardType="thumb"
|
||||
queryKey={["home", "resume", "audio"]}
|
||||
userId={user.data.Id}
|
||||
imageBlurhash={
|
||||
item.ImageBlurHashes?.Primary?.[
|
||||
Object.keys(item.ImageBlurHashes.Primary)[0]
|
||||
]
|
||||
}
|
||||
userId={user.data?.Id}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@@ -409,8 +394,8 @@ function Home() {
|
||||
</div>
|
||||
}
|
||||
>
|
||||
{latestMediaLibs.map((lib) => {
|
||||
return <LatestMediaSection key={lib[0]} latestMediaLib={lib} />;
|
||||
{latestMediaLibs?.map((lib) => {
|
||||
return <LatestMediaSection key={lib.Id} latestMediaLib={lib} />;
|
||||
})}
|
||||
</ErrorBoundary>
|
||||
</main>
|
||||
|
||||
@@ -26,7 +26,7 @@ import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
||||
|
||||
import heroBg from "@/assets/herobg.png";
|
||||
import { Card } from "@/components/card/card";
|
||||
@@ -67,6 +67,7 @@ import sdrIcon from "@/assets/icons/sdr.svg";
|
||||
import type MediaQualityInfo from "@/utils/types/mediaQualityInfo";
|
||||
|
||||
import IconLink from "@/components/iconLink";
|
||||
import { queryClient } from "@/main";
|
||||
import { Link, createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
function TabPanel(props) {
|
||||
@@ -97,7 +98,6 @@ export const Route = createFileRoute("/_api/item/$id")({
|
||||
});
|
||||
|
||||
function ItemDetail() {
|
||||
"use memo";
|
||||
const { id } = Route.useParams();
|
||||
|
||||
const api = Route.useRouteContext().api;
|
||||
@@ -126,6 +126,8 @@ function ItemDetail() {
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
// const item = useSuspenseQuery({ queryKey: ["item", id] });
|
||||
|
||||
const similarItems = useQuery({
|
||||
queryKey: ["item", id, "similarItem"],
|
||||
queryFn: async () => {
|
||||
@@ -207,7 +209,7 @@ function ItemDetail() {
|
||||
api?.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
}),
|
||||
item.data.Id,
|
||||
item.data.BackdropImageTags[0],
|
||||
);
|
||||
} else {
|
||||
setBackdrop("", "");
|
||||
|
||||
@@ -12,10 +12,10 @@ import { useSnackbar } from "notistack";
|
||||
|
||||
import { AppBarBackOnly } from "@/components/appBar/backOnly.jsx";
|
||||
import { AvatarImage } from "@/components/avatar/avatar.jsx";
|
||||
import { createApi } from "@/utils/store/api.js";
|
||||
import "./login.scss";
|
||||
|
||||
import { saveUser } from "@/utils/storage/user";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { setBackdrop } from "@/utils/store/backdrop.js";
|
||||
import { createFileRoute, useNavigate } from "@tanstack/react-router";
|
||||
import React, { useLayoutEffect, useState } from "react";
|
||||
@@ -27,7 +27,8 @@ export const Route = createFileRoute("/_api/login/$userId/$userName")({
|
||||
function LoginUser() {
|
||||
const { userName, userId } = Route.useParams();
|
||||
|
||||
const api = Route.useRouteContext().api;
|
||||
const api = useApiInContext((s) => s.api);
|
||||
const createApi = useApiInContext((s) => s.createApi);
|
||||
|
||||
const [password, setPassword] = useState({
|
||||
showpass: false,
|
||||
|
||||
@@ -31,9 +31,9 @@ import { getQuickConnectApi } from "@jellyfin/sdk/lib/utils/api/quick-connect-ap
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
|
||||
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice.jsx";
|
||||
import { createApi } from "@/utils/store/api.js";
|
||||
import "./login.scss";
|
||||
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { setBackdrop } from "@/utils/store/backdrop.js";
|
||||
import { blue } from "@mui/material/colors";
|
||||
import { createFileRoute, useNavigate } from "@tanstack/react-router";
|
||||
@@ -52,7 +52,8 @@ function LoginPublicUsersList() {
|
||||
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const api = Route.useRouteContext().api;
|
||||
const api = useApiInContext((s) => s.api);
|
||||
const createApi = useApiInContext((s) => s.createApi);
|
||||
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [rememberMe, setRememberMe] = useState(true);
|
||||
|
||||
@@ -30,7 +30,7 @@ import InputLabel from "@mui/material/InputLabel";
|
||||
import { useSnackbar } from "notistack";
|
||||
|
||||
import { AppBarBackOnly } from "@/components/appBar/backOnly.jsx";
|
||||
import { useApiInContext } from "@/utils/store/api.js";
|
||||
import { axiosClient, useApiInContext } from "@/utils/store/api.js";
|
||||
import { getBrandingApi } from "@jellyfin/sdk/lib/utils/api/branding-api";
|
||||
import { getQuickConnectApi } from "@jellyfin/sdk/lib/utils/api/quick-connect-api";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
@@ -69,6 +69,15 @@ function UserLoginManual() {
|
||||
},
|
||||
});
|
||||
|
||||
const ssoProviders = useQuery({
|
||||
queryKey: ["login", "manual", "ssoProviders"],
|
||||
queryFn: async () => {
|
||||
return axiosClient.get(
|
||||
`${api.basePath}/sso/SAML/Get?api_key=${api.accessToken}`,
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
const navigate = useNavigate();
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
@@ -210,7 +219,7 @@ function UserLoginManual() {
|
||||
enqueueSnackbar(`Logged in as ${auth.data.User.Name}!`, {
|
||||
variant: "success",
|
||||
});
|
||||
navigate("/home");
|
||||
navigate({ to: "/home" });
|
||||
}, 1000);
|
||||
|
||||
setLoading(false);
|
||||
@@ -303,7 +312,7 @@ function UserLoginManual() {
|
||||
className="userEventButton"
|
||||
// size="large"
|
||||
style={{ flex: 1 }}
|
||||
onClick={() => navigate("/servers/list")}
|
||||
onClick={() => navigate({ to: "/setup/server/list" })}
|
||||
>
|
||||
Change Server
|
||||
</Button>
|
||||
|
||||
@@ -1,55 +1,46 @@
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
import React, { useLayoutEffect } from "react";
|
||||
import { WebviewWindow as appWindow } from "@tauri-apps/api/webviewWindow";
|
||||
import React, { MouseEventHandler, type ChangeEventHandler } from "react";
|
||||
import { useLayoutEffect, useMemo } from "react";
|
||||
|
||||
import Backdrop from "@mui/material/Backdrop";
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Menu from "@mui/material/Menu";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import Slider from "@mui/material/Slider";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import ReactPlayer from "react-player";
|
||||
|
||||
import { usePlaybackStore } from "@/utils/store/playback";
|
||||
import {
|
||||
changeSubtitleTrack,
|
||||
toggleSubtitleTrack,
|
||||
usePlaybackStore,
|
||||
} from "@/utils/store/playback";
|
||||
|
||||
import { getRuntimeMusic, secToTicks, ticksToSec } from "@/utils/date/time";
|
||||
import { secToTicks, ticksToSec } from "@/utils/date/time";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { Navigate, useNavigate } from "react-router-dom";
|
||||
|
||||
import { getMediaInfoApi } from "@jellyfin/sdk/lib/utils/api/media-info-api";
|
||||
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||
|
||||
import "./videoPlayer.scss";
|
||||
|
||||
import { endsAt } from "@/utils/date/time";
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import {
|
||||
ItemFields,
|
||||
LocationType,
|
||||
PlayMethod,
|
||||
RepeatMode,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { PlayMethod, RepeatMode } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
|
||||
import { setBackdrop } from "@/utils/store/backdrop";
|
||||
|
||||
import { FormControl, TextField } from "@mui/material";
|
||||
import type JASSUB from "jassub";
|
||||
import { Button, TextField } from "@mui/material";
|
||||
import JASSUB from "jassub";
|
||||
import workerUrl from "jassub/dist/jassub-worker.js?url";
|
||||
import wasmUrl from "jassub/dist/jassub-worker.wasm?url";
|
||||
|
||||
import PlayNextButton from "@/components/buttons/playNextButton";
|
||||
import PlayPreviousButton from "@/components/buttons/playPreviousButtom";
|
||||
import QueueButton from "@/components/buttons/queueButton";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { createFileRoute, useRouter } from "@tanstack/react-router";
|
||||
import type { OnProgressProps } from "react-player/base";
|
||||
import subtitleFont from "./Noto-Sans-Indosphere.ttf";
|
||||
|
||||
const ticksDisplay = (ticks: number) => {
|
||||
@@ -82,27 +73,28 @@ function VideoPlayer() {
|
||||
const api = Route.useRouteContext().api;
|
||||
const { history } = useRouter();
|
||||
const [hoveringOsd, setHoveringOsd] = useState(false);
|
||||
const player = useRef<ReactPlayer | null>(null);
|
||||
|
||||
const [
|
||||
hlsStream,
|
||||
playbackStream,
|
||||
item,
|
||||
itemName,
|
||||
itemDuration,
|
||||
startPosition,
|
||||
episodeTitle,
|
||||
mediaSource,
|
||||
enableSubtitle,
|
||||
playsessionId,
|
||||
introInfo,
|
||||
] = usePlaybackStore((state) => [
|
||||
state.hlsStream,
|
||||
state.playbackStream,
|
||||
state.item,
|
||||
state.itemName,
|
||||
state.itemDuration,
|
||||
state.startPosition,
|
||||
state.episodeTitle,
|
||||
state.mediaSource,
|
||||
state.enableSubtitle,
|
||||
state.playsessionId,
|
||||
state.intro,
|
||||
]);
|
||||
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -117,10 +109,7 @@ function VideoPlayer() {
|
||||
const [sliderProgress, setSliderProgress] = useState(startPosition);
|
||||
const [progress, setProgress] = useState(startPosition);
|
||||
const [appFullscreen, setAppFullscreen] = useState(false);
|
||||
const [showSubtitles, setShowSubtitles] = useState(enableSubtitle);
|
||||
const [selectedSubtitle, setSelectedSubtitle] = useState(
|
||||
mediaSource.subtitleTrack,
|
||||
);
|
||||
// const [showSubtitles, setShowSubtitles] = useState(mediaSource.subtitle.enable);
|
||||
const [volume, setVolume] = useState(1);
|
||||
const [muted, setMuted] = useState(false);
|
||||
|
||||
@@ -129,26 +118,16 @@ function VideoPlayer() {
|
||||
const [subtitleRenderer, setSubtitleRenderer] = useState<JASSUB>(null);
|
||||
const [clickTimeout, setClickTimeout] = useState<NodeJS.Timeout>(null)
|
||||
|
||||
const showSubtitles = useMemo(
|
||||
() => mediaSource.subtitle.enable,
|
||||
[mediaSource.subtitle],
|
||||
);
|
||||
|
||||
const handleReady = async () => {
|
||||
if (!isReady) {
|
||||
if (selectedSubtitle !== "nosub") {
|
||||
const font = await fetch(subtitleFont).then((r) => r.arrayBuffer());
|
||||
const uint8 = new Uint8Array(font);
|
||||
// const subtitleRendererRaw = new JASSUB({
|
||||
// video: player.current.getInternalPlayer(),
|
||||
// subUrl: `${api.basePath}/Videos/${item.Id}/${item.Id}/Subtitles/${mediaSource.subtitleTrack}/Stream.ass?api_key=${api.accessToken}`,
|
||||
// workerUrl,
|
||||
// wasmUrl,
|
||||
// availableFonts: { "noto sans": uint8 },
|
||||
// fallbackFont: "Noto Sans",
|
||||
// });
|
||||
// setSubtitleRenderer(subtitleRendererRaw);
|
||||
}
|
||||
|
||||
player.current?.seekTo(ticksToSec(startPosition), "seconds");
|
||||
setIsReady(true);
|
||||
|
||||
console.log(item);
|
||||
// Report Jellyfin server: Playback has begin
|
||||
getPlaystateApi(api).reportPlaybackStart({
|
||||
playbackStartInfo: {
|
||||
@@ -169,7 +148,8 @@ function VideoPlayer() {
|
||||
}
|
||||
};
|
||||
|
||||
const handleProgress = async (event) => {
|
||||
const handleProgress = async (event: OnProgressProps) => {
|
||||
setProgress(secToTicks(event.playedSeconds));
|
||||
// Report Jellyfin server: Playback progress
|
||||
getPlaystateApi(api).reportPlaybackProgress({
|
||||
playbackProgressInfo: {
|
||||
@@ -182,7 +162,7 @@ function VideoPlayer() {
|
||||
PlayMethod: PlayMethod.DirectPlay,
|
||||
PlaySessionId: playsessionId,
|
||||
PlaybackStartTimeTicks: startPosition,
|
||||
PositionTicks: progress,
|
||||
PositionTicks: secToTicks(event.playedSeconds),
|
||||
RepeatMode: RepeatMode.RepeatNone,
|
||||
VolumeLevel: volume * 100,
|
||||
},
|
||||
@@ -190,10 +170,8 @@ function VideoPlayer() {
|
||||
};
|
||||
|
||||
const handleExitPlayer = async () => {
|
||||
appWindow.setFullscreen(false);
|
||||
if (subtitleRenderer) {
|
||||
subtitleRenderer.destroy();
|
||||
}
|
||||
appWindow.getCurrent().setFullscreen(false);
|
||||
|
||||
history.back();
|
||||
// Report Jellyfin server: Playback has ended/stopped
|
||||
getPlaystateApi(api).reportPlaybackStopped({
|
||||
@@ -208,8 +186,6 @@ function VideoPlayer() {
|
||||
usePlaybackStore.setState(usePlaybackStore.getInitialState());
|
||||
};
|
||||
|
||||
const player = useRef(null);
|
||||
|
||||
const handleShowOsd = () => {
|
||||
let timer = null;
|
||||
if (hoveringOsd) {
|
||||
@@ -242,7 +218,7 @@ function VideoPlayer() {
|
||||
case "F":
|
||||
case "f":
|
||||
setAppFullscreen((state) => {
|
||||
appWindow.setFullscreen(!state);
|
||||
appWindow.getCurrent().setFullscreen(!state);
|
||||
return !state;
|
||||
});
|
||||
break;
|
||||
@@ -270,44 +246,69 @@ function VideoPlayer() {
|
||||
};
|
||||
}, [handleKeyPress]);
|
||||
|
||||
useEffect(() => {
|
||||
async function fetchFonts() {
|
||||
const font = await fetch(subtitleFont).then((r) => r.arrayBuffer());
|
||||
const uint8 = new Uint8Array(font);
|
||||
return uint8;
|
||||
}
|
||||
if (subtitleRenderer)
|
||||
if (showSubtitles) {
|
||||
subtitleRenderer.setTrackByUrl(
|
||||
`${api.basePath}/Videos/${item?.Id}/${item?.Id}/Subtitles/${selectedSubtitle}/Stream.ass?api_key=${api.accessToken}`,
|
||||
);
|
||||
} else {
|
||||
subtitleRenderer.freeTrack();
|
||||
}
|
||||
else if (
|
||||
!subtitleRenderer &&
|
||||
selectedSubtitle !== "nosub" &&
|
||||
showSubtitles
|
||||
) {
|
||||
// fetchFonts().then((uint8) => {
|
||||
// const subtitleRendererRaw = new JASSUB({
|
||||
// video: player.current.getInternalPlayer(),
|
||||
// subUrl: `${api.basePath}/Videos/${item?.Id}/${item?.Id}/Subtitles/${selectedSubtitle}/Stream.ass?api_key=${api.accessToken}`,
|
||||
// workerUrl,
|
||||
// wasmUrl,
|
||||
// availableFonts: { "noto sans": uint8 },
|
||||
// fallbackFont: "Noto Sans",
|
||||
// });
|
||||
// setSubtitleRenderer(subtitleRendererRaw);
|
||||
// });
|
||||
}
|
||||
}, [showSubtitles, selectedSubtitle]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
setPlaying(true);
|
||||
setIsReady(false);
|
||||
}, [item?.Id]);
|
||||
|
||||
const reactPlayerCaptions = useMemo(() => {
|
||||
if (
|
||||
(mediaSource.subtitle.format === "vtt" ||
|
||||
mediaSource.subtitle.format === "subrip") &&
|
||||
mediaSource.subtitle.enable
|
||||
) {
|
||||
return [
|
||||
{
|
||||
kind: "subtitles",
|
||||
src: `${api.basePath}${mediaSource.subtitle.url}`,
|
||||
srcLang: "en",
|
||||
default: true,
|
||||
label: mediaSource.subtitle.url,
|
||||
},
|
||||
];
|
||||
}
|
||||
return [];
|
||||
}, [mediaSource.subtitle.track, mediaSource.subtitle.enable]);
|
||||
const handleSubtitleChange = (
|
||||
e: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>,
|
||||
) => {
|
||||
changeSubtitleTrack(e.target.value, mediaSource.subtitle.allTracks);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (player.current?.getInternalPlayer() && mediaSource.subtitle.enable) {
|
||||
if (
|
||||
mediaSource.subtitle.format === "ass" ||
|
||||
mediaSource.subtitle.format === "ssa"
|
||||
) {
|
||||
const jassubRenderer = new JASSUB({
|
||||
video: player.current?.getInternalPlayer(),
|
||||
workerUrl,
|
||||
wasmUrl,
|
||||
subUrl: `${api.basePath}${mediaSource.subtitle.url}`,
|
||||
});
|
||||
return () => jassubRenderer.destroy(); // Remove JASSUB renderer when track changes to fix duplicate renders
|
||||
}
|
||||
}
|
||||
}, [
|
||||
mediaSource.subtitle.track,
|
||||
mediaSource.subtitle.enable,
|
||||
player.current?.getInternalPlayer(),
|
||||
]);
|
||||
|
||||
const showSkipIntroButton = useMemo(() => {
|
||||
if (
|
||||
ticksToSec(progress) >= introInfo?.ShowSkipPromptAt &&
|
||||
ticksToSec(progress) < introInfo?.HideSkipPromptAt
|
||||
)
|
||||
return true;
|
||||
return false;
|
||||
}, [progress]);
|
||||
|
||||
const handleSkipIntro = useCallback(() => {
|
||||
player.current?.seekTo(introInfo?.IntroEnd);
|
||||
}, [item?.Id]);
|
||||
|
||||
return (
|
||||
<div className="video-player">
|
||||
<AnimatePresence>
|
||||
@@ -334,6 +335,22 @@ function VideoPlayer() {
|
||||
</motion.div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
{showSkipIntroButton && (
|
||||
<Button
|
||||
variant="outlined"
|
||||
size="large"
|
||||
color="white"
|
||||
style={{
|
||||
position: "absolute",
|
||||
bottom: "18vh",
|
||||
right: "2em",
|
||||
zIndex: 10000,
|
||||
}}
|
||||
onClick={handleSkipIntro}
|
||||
>
|
||||
Skip Intro
|
||||
</Button>
|
||||
)}
|
||||
<motion.div
|
||||
className={
|
||||
hoveringOsd || !playing || isSeeking
|
||||
@@ -403,14 +420,15 @@ function VideoPlayer() {
|
||||
select
|
||||
label="Subtitles"
|
||||
variant="outlined"
|
||||
value={selectedSubtitle}
|
||||
onChange={(e) => setSelectedSubtitle(e.target.value)}
|
||||
value={mediaSource.subtitle.track}
|
||||
onChange={handleSubtitleChange}
|
||||
fullWidth
|
||||
disabled={mediaSource.subtitle.track === -2}
|
||||
>
|
||||
<MenuItem key={-1} value={"nosub"}>
|
||||
<MenuItem key={-1} value={-1}>
|
||||
No Subtitle
|
||||
</MenuItem>
|
||||
{mediaSource.availableSubtitleTracks.map((sub) => (
|
||||
{mediaSource.subtitle.allTracks?.map((sub) => (
|
||||
<MenuItem key={sub.Index} value={sub.Index}>
|
||||
{sub.DisplayTitle}
|
||||
</MenuItem>
|
||||
@@ -556,9 +574,12 @@ function VideoPlayer() {
|
||||
</span>
|
||||
</IconButton>
|
||||
<QueueButton />
|
||||
<IconButton onClick={() => setShowSubtitles((state) => !state)}>
|
||||
<IconButton
|
||||
disabled={mediaSource.subtitle.track === -2}
|
||||
onClick={toggleSubtitleTrack}
|
||||
>
|
||||
<span className={"material-symbols-rounded"}>
|
||||
{showSubtitles
|
||||
{mediaSource.subtitle.enable
|
||||
? "closed_caption"
|
||||
: "closed_caption_disabled"}
|
||||
</span>
|
||||
@@ -566,7 +587,7 @@ function VideoPlayer() {
|
||||
<IconButton
|
||||
onClick={async () => {
|
||||
setAppFullscreen((state) => {
|
||||
appWindow.setFullscreen(!state);
|
||||
appWindow.getCurrent().setFullscreen(!state);
|
||||
return !state;
|
||||
});
|
||||
}}
|
||||
@@ -584,7 +605,7 @@ function VideoPlayer() {
|
||||
<ReactPlayer
|
||||
key={item?.Id}
|
||||
playing={playing}
|
||||
url={hlsStream}
|
||||
url={playbackStream}
|
||||
ref={player}
|
||||
onProgress={handleProgress}
|
||||
onError={(error, data, hls, hlsG) => {
|
||||
@@ -599,9 +620,14 @@ function VideoPlayer() {
|
||||
position: "fixed",
|
||||
zIndex: 1,
|
||||
}}
|
||||
// onReady={(playerRef) => {
|
||||
// playerRef.seekTo(ticksToSec(startPosition));
|
||||
// }}
|
||||
config={{
|
||||
file: {
|
||||
attributes: {
|
||||
crossOrigin: "true",
|
||||
},
|
||||
tracks: reactPlayerCaptions,
|
||||
},
|
||||
}}
|
||||
volume={muted ? 0 : volume}
|
||||
onReady={handleReady}
|
||||
onBuffer={() => setLoading(true)}
|
||||
|
||||
@@ -21,7 +21,8 @@ import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getPersonsApi } from "@jellyfin/sdk/lib/utils/api/persons-api";
|
||||
import { getSearchApi } from "@jellyfin/sdk/lib/utils/api/search-api";
|
||||
import "./search.scss";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { Dialog } from "@mui/material";
|
||||
import { Outlet, createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_api/search/")({
|
||||
component: SearchPage,
|
||||
@@ -48,8 +49,8 @@ function SearchPage() {
|
||||
const movies = useQuery({
|
||||
queryKey: ["search", "items", "Movie", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(api).getItemsByUserId({
|
||||
userId: user.data.Id,
|
||||
const result = await getItemsApi(api).getItems({
|
||||
userId: user.data?.Id,
|
||||
searchTerm,
|
||||
includeItemTypes: [BaseItemKind.Movie],
|
||||
recursive: true,
|
||||
@@ -58,13 +59,12 @@ function SearchPage() {
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess,
|
||||
cacheTime: 0,
|
||||
});
|
||||
const series = useQuery({
|
||||
queryKey: ["search", "items", "Series", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(api).getItemsByUserId({
|
||||
userId: user.data.Id,
|
||||
const result = await getItemsApi(api).getItems({
|
||||
userId: user.data?.Id,
|
||||
searchTerm,
|
||||
includeItemTypes: [BaseItemKind.Series],
|
||||
recursive: true,
|
||||
@@ -73,13 +73,12 @@ function SearchPage() {
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess,
|
||||
cacheTime: 0,
|
||||
});
|
||||
const musicAlbum = useQuery({
|
||||
queryKey: ["search", "items", "MusicAlbum", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(api).getItemsByUserId({
|
||||
userId: user.data.Id,
|
||||
const result = await getItemsApi(api).getItems({
|
||||
userId: user.data?.Id,
|
||||
searchTerm,
|
||||
includeItemTypes: [BaseItemKind.MusicAlbum],
|
||||
recursive: true,
|
||||
@@ -88,13 +87,12 @@ function SearchPage() {
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess,
|
||||
cacheTime: 0,
|
||||
});
|
||||
const audio = useQuery({
|
||||
queryKey: ["search", "items", "Audio", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(api).getItemsByUserId({
|
||||
userId: user.data.Id,
|
||||
const result = await getItemsApi(api).getItems({
|
||||
userId: user.data?.Id,
|
||||
searchTerm,
|
||||
includeItemTypes: [BaseItemKind.Audio],
|
||||
recursive: true,
|
||||
@@ -103,13 +101,12 @@ function SearchPage() {
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess,
|
||||
cacheTime: 0,
|
||||
});
|
||||
const book = useQuery({
|
||||
queryKey: ["search", "items", "Book", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(api).getItemsByUserId({
|
||||
userId: user.data.Id,
|
||||
const result = await getItemsApi(api).getItems({
|
||||
userId: user.data?.Id,
|
||||
searchTerm,
|
||||
includeItemTypes: [BaseItemKind.Book],
|
||||
recursive: true,
|
||||
@@ -118,13 +115,12 @@ function SearchPage() {
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess,
|
||||
cacheTime: 0,
|
||||
});
|
||||
const musicArtists = useQuery({
|
||||
queryKey: ["search", "items", "MusicArtists", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(api).getItemsByUserId({
|
||||
userId: user.data.Id,
|
||||
const result = await getItemsApi(api).getItems({
|
||||
userId: user.data?.Id,
|
||||
searchTerm,
|
||||
includeItemTypes: [BaseItemKind.MusicArtist],
|
||||
recursive: true,
|
||||
@@ -133,26 +129,24 @@ function SearchPage() {
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess,
|
||||
cacheTime: 0,
|
||||
});
|
||||
const person = useQuery({
|
||||
queryKey: ["search", "items", "Person", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getPersonsApi(api).getPersons({
|
||||
userId: user.data.Id,
|
||||
userId: user.data?.Id,
|
||||
searchTerm,
|
||||
limit: itemLimit,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess,
|
||||
cacheTime: 0,
|
||||
});
|
||||
const episodes = useQuery({
|
||||
queryKey: ["search", "items", "Episodes", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getSearchApi(api).get({
|
||||
userId: user.data.Id,
|
||||
const result = await getSearchApi(api).getSearchHints({
|
||||
userId: user.data?.Id,
|
||||
searchTerm,
|
||||
limit: itemLimit,
|
||||
includeItemTypes: ["Episode"],
|
||||
@@ -160,7 +154,6 @@ function SearchPage() {
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess,
|
||||
cacheTime: 0,
|
||||
});
|
||||
|
||||
const [setBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||
@@ -433,7 +426,7 @@ function SearchPage() {
|
||||
musicAlbum.data.Items.length === 0 &&
|
||||
book.data.Items.length === 0 &&
|
||||
musicArtists.data.Items.length === 0 &&
|
||||
person.data.Items.length === 0 &&
|
||||
person.data.Items?.length === 0 &&
|
||||
episodes.data.SearchHints?.length === 0 && (
|
||||
<div
|
||||
style={{
|
||||
@@ -443,6 +436,7 @@ function SearchPage() {
|
||||
<EmptyNotice extraMsg={"Try using different search terms."} />
|
||||
</div>
|
||||
)}
|
||||
<Outlet />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ import TrailerButton from "@/components/buttons/trailerButton";
|
||||
import ShowMoreText from "@/components/showMoreText";
|
||||
import { SeasonSelectorSkeleton } from "@/components/skeleton/seasonSelector";
|
||||
import { getTypeIcon } from "@/components/utils/iconsCollection";
|
||||
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||
import { setBackdrop, useBackdropStore } from "@/utils/store/backdrop";
|
||||
|
||||
import IconLink from "@/components/iconLink";
|
||||
import EpisodeSkeleton from "@/components/skeleton/episode";
|
||||
@@ -173,9 +173,10 @@ function SeriesTitlePage() {
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const [backdropImage, setBackdropImage] = useState(() => {
|
||||
const result = sessionStorage.getItem(`backdrop-${item.data?.Id}`);
|
||||
return result ?? "0";
|
||||
const [backdropImage, setBackdropImage] = useState<SeriesBackdropImage>(() => {
|
||||
const url = sessionStorage.getItem(`backdrop-${item.data?.Id}`);
|
||||
const key = sessionStorage.getItem(`backdrop-${item.data?.Id}-key`);
|
||||
return { url, key };
|
||||
});
|
||||
const [backdropImageLoaded, setBackdropImageLoaded] = useState(false);
|
||||
|
||||
@@ -199,7 +200,7 @@ function SeriesTitlePage() {
|
||||
});
|
||||
|
||||
const episodes = useQuery({
|
||||
queryKey: ["item", id, `season ${currentSeason + 1}`, "episodes"],
|
||||
queryKey: ["item", id, "season", currentSeason, "episodes"],
|
||||
queryFn: async () => {
|
||||
const result = await getTvShowsApi(api).getEpisodes({
|
||||
userId: user.data.Id,
|
||||
@@ -226,7 +227,6 @@ function SeriesTitlePage() {
|
||||
},
|
||||
enabled: item.isSuccess,
|
||||
});
|
||||
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||
|
||||
const [directors, setDirectors] = useState([]);
|
||||
const [writers, setWriters] = useState([]);
|
||||
@@ -235,17 +235,18 @@ function SeriesTitlePage() {
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (item.isSuccess) {
|
||||
setBackdropImage(
|
||||
api.getItemImageUrl(item.data?.Id, "Backdrop", {
|
||||
tag: item.data?.BackdropImageTags[0],
|
||||
}),
|
||||
);
|
||||
setAppBackdrop(
|
||||
api.getItemImageUrl(item.data?.Id, "Backdrop", {
|
||||
tag: item.data?.BackdropImageTags[0],
|
||||
}),
|
||||
item.data.Id,
|
||||
);
|
||||
// setBackdropImage({
|
||||
// url: api.getItemImageUrl(item.data?.Id, "Backdrop", {
|
||||
// tag: item.data?.BackdropImageTags[0],
|
||||
// }),
|
||||
// key: item.data?.BackdropImageTags[0],
|
||||
// });
|
||||
// setBackdrop(
|
||||
// api.getItemImageUrl(item.data?.Id, "Backdrop", {
|
||||
// tag: item.data?.BackdropImageTags[0],
|
||||
// }),
|
||||
// item.data.Id,
|
||||
// );
|
||||
const direTp = item.data.People.filter((itm) => itm.Type === "Director");
|
||||
setDirectors(direTp);
|
||||
const writeTp = item.data.People.filter((itm) => itm.Type === "Writer");
|
||||
@@ -283,42 +284,53 @@ function SeriesTitlePage() {
|
||||
sessionStorage.setItem(
|
||||
`backdrop-${item.data?.Id}`,
|
||||
api.getItemImageUrl(currentSeasonItem.data.Id, "Backdrop", {
|
||||
tag: currentSeasonItem.data.BackdropImageTags[0],
|
||||
tag: currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
}),
|
||||
);
|
||||
setBackdropImage(
|
||||
api.getItemImageUrl(currentSeasonItem.data.Id, "Backdrop", {
|
||||
tag: currentSeasonItem.data.BackdropImageTags[0],
|
||||
}),
|
||||
currentSeasonItem.data.Id,
|
||||
sessionStorage.setItem(
|
||||
`backdrop-${item.data?.Id}-key`,
|
||||
currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
);
|
||||
setAppBackdrop(
|
||||
api.getItemImageUrl(currentSeasonItem.data.Id, "Backdrop", {
|
||||
tag: currentSeasonItem.data.BackdropImageTags[0],
|
||||
setBackdropImage({
|
||||
url: api.getItemImageUrl(currentSeasonItem.data.Id, "Backdrop", {
|
||||
tag: currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
}),
|
||||
currentSeasonItem.data.Id,
|
||||
key: currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
});
|
||||
setBackdrop(
|
||||
api.getItemImageUrl(currentSeasonItem.data.Id, "Backdrop", {
|
||||
tag: currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
}),
|
||||
currentSeasonItem.data.BackdropImageTags?.[0],
|
||||
);
|
||||
setBackdropImageLoaded(false);
|
||||
} else if (item.isSuccess && item.data?.BackdropImageTags?.length > 0) {
|
||||
sessionStorage.setItem(
|
||||
`backdrop-${item.data?.Id}`,
|
||||
api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
tag: item.data.BackdropImageTags?.[0],
|
||||
}),
|
||||
);
|
||||
setBackdropImage(
|
||||
sessionStorage.setItem(
|
||||
`backdrop-${item.data?.Id}-key`,
|
||||
item.data?.BackdropImageTags?.[0],
|
||||
);
|
||||
if (backdropImage.key !== item.data?.BackdropImageTags?.[0]) {
|
||||
setBackdropImageLoaded(false); // Reset Backdrop image load status if previous image is diff then new image
|
||||
}
|
||||
setBackdropImage({
|
||||
url: api.getItemImageUrl(item.data?.Id, "Backdrop", {
|
||||
tag: item.data?.BackdropImageTags?.[0],
|
||||
}),
|
||||
key: item.data?.BackdropImageTags?.[0],
|
||||
});
|
||||
setBackdrop(
|
||||
api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
tag: item.data.BackdropImageTags?.[0],
|
||||
}),
|
||||
item.data.Id,
|
||||
item.data.BackdropImageTags?.[0],
|
||||
);
|
||||
setAppBackdrop(
|
||||
api.getItemImageUrl(item.data.Id, "Backdrop", {
|
||||
tag: item.data.BackdropImageTags[0],
|
||||
}),
|
||||
item.data.Id,
|
||||
);
|
||||
setBackdropImageLoaded(false);
|
||||
// setBackdropImageLoaded(false);
|
||||
}
|
||||
}, [currentSeasonItem.dataUpdatedAt]);
|
||||
|
||||
@@ -369,14 +381,15 @@ function SeriesTitlePage() {
|
||||
<AnimatePresence mode="wait">
|
||||
{item.data.BackdropImageTags ? (
|
||||
<motion.img
|
||||
key={currentSeasonItem.dataUpdatedAt}
|
||||
key={backdropImage.key}
|
||||
alt={item.data.Name}
|
||||
src={backdropImage}
|
||||
src={backdropImage.url}
|
||||
className="item-hero-backdrop"
|
||||
initial={{
|
||||
opacity: 0,
|
||||
}}
|
||||
onLoad={() => {
|
||||
console.info("Image Loaded");
|
||||
setBackdropImageLoaded(true);
|
||||
}}
|
||||
animate={{
|
||||
@@ -580,7 +593,7 @@ function SeriesTitlePage() {
|
||||
itemUserData={item.data.UserData}
|
||||
currentAudioTrack={0}
|
||||
currentVideoTrack={0}
|
||||
currentSubTrack={0}
|
||||
currentSubTrack="nosub"
|
||||
userId={user.data.Id}
|
||||
buttonProps={{
|
||||
fullWidth: true,
|
||||
@@ -1007,12 +1020,12 @@ function SeriesTitlePage() {
|
||||
<PlayButton
|
||||
item={episode}
|
||||
itemId={episode.Id}
|
||||
itemType="Episode"
|
||||
itemType={BaseItemKind.Episode}
|
||||
itemUserData={episode.UserData}
|
||||
userId={user.data.Id}
|
||||
currentAudioTrack={0}
|
||||
currentVideoTrack={0}
|
||||
currentSubTrack={0}
|
||||
currentSubTrack="nosub"
|
||||
size="medium"
|
||||
buttonProps={{
|
||||
color: "white",
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import { Button, ButtonGroup, Typography } from "@mui/material";
|
||||
import { Link, createFileRoute } from "@tanstack/react-router";
|
||||
import { relaunch } from "@tauri-apps/plugin-process";
|
||||
import React from "react";
|
||||
|
||||
export const Route = createFileRoute("/error/$code")({
|
||||
component: ErrorRoute,
|
||||
});
|
||||
|
||||
function ErrorRoute() {
|
||||
const errorCode = Route.useParams({ select: (s) => s.code });
|
||||
switch (errorCode) {
|
||||
case "101":
|
||||
return (
|
||||
<div
|
||||
className="flex flex-column flex-center"
|
||||
style={{ height: "100vh", gap: "0.25em" }}
|
||||
>
|
||||
<span
|
||||
className="material-symbols-rounded fill gradient-text"
|
||||
style={{ fontSize: "8em", marginBottom: "0.0em" }}
|
||||
>
|
||||
report
|
||||
</span>
|
||||
<Typography variant="h5" fontWeight={500}>
|
||||
Error connecting server.
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" style={{ opacity: 0.6 }}>
|
||||
Check your internet connection or contact your server administrator
|
||||
</Typography>
|
||||
<div
|
||||
className="flex flex-center"
|
||||
style={{ gap: "1em", marginTop: "0.5em" }}
|
||||
>
|
||||
<Button
|
||||
component={Link}
|
||||
to="/setup/server/list"
|
||||
variant="contained"
|
||||
>
|
||||
Change Server
|
||||
</Button>
|
||||
<Button variant="contained" onClick={async () => await relaunch()}>
|
||||
Restart Blink
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
default:
|
||||
return <div>Error</div>;
|
||||
}
|
||||
}
|
||||
@@ -1,53 +1,19 @@
|
||||
import {
|
||||
type ServerInfo,
|
||||
getAllServers,
|
||||
getDefaultServer,
|
||||
getServer,
|
||||
} from "@/utils/storage/servers";
|
||||
import { UserStore, delUser, getUser } from "@/utils/storage/user";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { setAppReady, useCentralStore } from "@/utils/store/central";
|
||||
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import {
|
||||
Button,
|
||||
ButtonGroup,
|
||||
CircularProgress,
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
import {
|
||||
Outlet,
|
||||
createFileRoute,
|
||||
redirect,
|
||||
useNavigate,
|
||||
} from "@tanstack/react-router";
|
||||
import axios from "axios";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
import * as React from "react";
|
||||
import Markdown from "react-markdown";
|
||||
import remarkGfm from "remark-gfm";
|
||||
|
||||
type LoaderData = {
|
||||
serversOnDisk: ServerInfo[];
|
||||
currentServer: ServerInfo | undefined;
|
||||
userOnDisk: { Name: string; AccessToken: string } | null;
|
||||
};
|
||||
import { getDefaultServer } from "@/utils/storage/servers";
|
||||
import { getUser } from "@/utils/storage/user";
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/")({
|
||||
errorComponent: (error) => {
|
||||
console.error(error.error);
|
||||
},
|
||||
beforeLoad: async ({ context, navigate }) => {
|
||||
beforeLoad: async () => {
|
||||
const currentServerId = await getDefaultServer();
|
||||
const currentServer = await getServer(currentServerId);
|
||||
const userOnDisk = await getUser();
|
||||
if (currentServerId) {
|
||||
context.createApi(currentServer?.address, undefined);
|
||||
if (userOnDisk) {
|
||||
context.createApi(currentServer?.address, userOnDisk.AccessToken);
|
||||
throw redirect({ to: "/home/" });
|
||||
throw redirect({ to: "/home" });
|
||||
}
|
||||
throw redirect({ to: "/login/" });
|
||||
throw redirect({ to: "/login" });
|
||||
}
|
||||
|
||||
throw redirect({ to: "/setup/server/add" });
|
||||
|
||||
@@ -11,7 +11,7 @@ import Typography from "@mui/material/Typography";
|
||||
|
||||
import { useSnackbar } from "notistack";
|
||||
|
||||
import { createApi, jellyfin } from "@/utils/store/api";
|
||||
import { jellyfin, useApiInContext } from "@/utils/store/api";
|
||||
import { yellow } from "@mui/material/colors";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
// SCSS
|
||||
@@ -24,6 +24,7 @@ export const Route = createFileRoute("/setup/server/add")({
|
||||
|
||||
function ServerSetup() {
|
||||
const [serverIp, setServerIp] = useState("");
|
||||
const createApi = useApiInContext((s) => s.createApi);
|
||||
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
@@ -47,7 +48,7 @@ function ServerSetup() {
|
||||
variant: "success",
|
||||
});
|
||||
|
||||
navigate({ to: "/login/index" });
|
||||
navigate({ to: "/login" });
|
||||
}
|
||||
},
|
||||
onError: (err) => {
|
||||
|
||||
@@ -3,7 +3,7 @@ import React from "react";
|
||||
|
||||
import "./server.error.scss";
|
||||
import { Button, ButtonGroup, Typography } from "@mui/material";
|
||||
import { relaunch } from "@tauri-apps/api/process";
|
||||
import { relaunch } from "@tauri-apps/plugin-process";
|
||||
|
||||
export const Route = createFileRoute("/setup/server/error")({
|
||||
component: () => {
|
||||
|
||||
@@ -14,12 +14,12 @@ import {
|
||||
setDefaultServer,
|
||||
} from "@/utils/storage/servers";
|
||||
import { delUser } from "@/utils/storage/user";
|
||||
import { createApi } from "@/utils/store/api";
|
||||
import { setBackdrop } from "@/utils/store/backdrop";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { createFileRoute, useNavigate } from "@tanstack/react-router";
|
||||
import { useSnackbar } from "notistack";
|
||||
import "./serverList.scss";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
|
||||
export const Route = createFileRoute("/setup/server/list")({
|
||||
component: ServerList,
|
||||
@@ -30,6 +30,8 @@ function ServerList() {
|
||||
const [serverState, setServerState] = useState(null);
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const createApi = useApiInContext((s) => s.createApi);
|
||||
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const servers = useQuery({
|
||||
@@ -52,7 +54,7 @@ function ServerList() {
|
||||
queryClient.removeQueries();
|
||||
},
|
||||
onSuccess: async () => {
|
||||
navigate({ to: "/login/index" });
|
||||
navigate({ to: "/login" });
|
||||
},
|
||||
onError: (error) => {
|
||||
console.error(error);
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
import type { MediaStream } from "@jellyfin/sdk/lib/generated-client";
|
||||
import type subtitlePlaybackInfo from "../types/subtitlePlaybackInfo";
|
||||
|
||||
export default function getSubtitle(
|
||||
track: number | "nosub",
|
||||
mediaStreams: MediaStream[] | undefined | null,
|
||||
): subtitlePlaybackInfo {
|
||||
const availableSubtitles = mediaStreams?.filter(
|
||||
(stream) => stream.Type === "Subtitle",
|
||||
);
|
||||
if (!availableSubtitles?.length)
|
||||
return {
|
||||
track: -2,
|
||||
enable: false,
|
||||
format: "vtt",
|
||||
allTracks: availableSubtitles,
|
||||
url: null,
|
||||
};
|
||||
if (track === "nosub")
|
||||
return {
|
||||
track: -1,
|
||||
enable: false,
|
||||
format: "vtt",
|
||||
allTracks: availableSubtitles,
|
||||
url: null,
|
||||
};
|
||||
const requiredSubtitle = availableSubtitles?.filter(
|
||||
(stream) => stream.Index === track,
|
||||
);
|
||||
const url = requiredSubtitle?.[0]?.DeliveryUrl;
|
||||
console.log(track);
|
||||
return {
|
||||
track,
|
||||
enable: true,
|
||||
format: requiredSubtitle?.[0]?.Codec,
|
||||
allTracks: availableSubtitles,
|
||||
url,
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { relaunch } from "@tauri-apps/api/process";
|
||||
import { relaunch } from "@tauri-apps/plugin-process";
|
||||
|
||||
export const handleRelaunch = async (_event: unknown, reason?: string) => {
|
||||
if (reason && reason === "backdropClick") {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { RecommendedServerInfo } from "@jellyfin/sdk";
|
||||
import { Store } from "tauri-plugin-store-api";
|
||||
import { Store } from "@tauri-apps/plugin-store";
|
||||
|
||||
export interface ServerInfo extends RecommendedServerInfo {
|
||||
id: string;
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import { Store } from "@tauri-apps/plugin-store";
|
||||
|
||||
const SettingsStore = new Store(".settings.dat");
|
||||
|
||||
/**
|
||||
* settingKey should be of type:
|
||||
* 'settingDomain.settingKeyName'
|
||||
*/
|
||||
|
||||
export const setSetting = async (settingKey: string, value: boolean) => {
|
||||
await SettingsStore.set(settingKey, value);
|
||||
await SettingsStore.save();
|
||||
};
|
||||
|
||||
export const getSetting = async (settingKey: string) => {
|
||||
const value = await SettingsStore.get(settingKey);
|
||||
console.log(`${settingKey} - ${value}`);
|
||||
if (value) return value;
|
||||
return false;
|
||||
};
|
||||
|
||||
export const allSettings = {
|
||||
general: [
|
||||
{
|
||||
key: "general.enable_skip_intro_outro",
|
||||
name: "Enable Intro-Skipper plugin",
|
||||
description:
|
||||
"Shows a skip button for Intros and End Credit scenes in an episode. Note: this requires jumoog/intro-skipper plugin to be installed on server",
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Store } from "tauri-plugin-store-api";
|
||||
import { Store } from "@tauri-apps/plugin-store";
|
||||
|
||||
export interface UserStore {
|
||||
user: {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { type Api, Jellyfin } from "@jellyfin/sdk";
|
||||
import React, { createContext, useContext, useRef, useState } from "react";
|
||||
import React, { type ReactNode } from "react";
|
||||
import { createContext, useContext, useState } from "react";
|
||||
import { type StoreApi, createStore, useStore } from "zustand";
|
||||
import { version as appVer } from "../../../package.json";
|
||||
|
||||
@@ -11,14 +12,11 @@ type ApiStore = {
|
||||
api: Api;
|
||||
deviceId: string | null;
|
||||
jellyfin: Jellyfin;
|
||||
createApi: (
|
||||
serverAddress: string | undefined,
|
||||
accessToken?: string | undefined,
|
||||
) => void;
|
||||
createApi: (serverAddress: string, accessToken?: string | undefined) => void;
|
||||
};
|
||||
|
||||
export const axiosClient = axios.create({
|
||||
adapter: axiosTauriApiAdapter,
|
||||
// adapter: axiosTauriApiAdapter,
|
||||
headers: {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
},
|
||||
@@ -42,31 +40,29 @@ export const jellyfin = new Jellyfin({
|
||||
},
|
||||
});
|
||||
|
||||
// export const useApi = create<{
|
||||
// api: Api;
|
||||
// deviceId: string | null;
|
||||
// jellyfin: Jellyfin;
|
||||
// }>(() => ({
|
||||
// api: undefined,
|
||||
// deviceId: deviceId,
|
||||
// jellyfin: jellyfin,
|
||||
// }));
|
||||
export const ApiContext = createContext<StoreApi<ApiStore>>(undefined!);
|
||||
|
||||
const ApiContext = createContext(null);
|
||||
|
||||
export const ApiProvider = ({ children }) => {
|
||||
export const ApiProvider = ({ children }: { children: ReactNode }) => {
|
||||
const [store] = useState(() =>
|
||||
createStore<ApiStore>()((set) => ({
|
||||
api: undefined,
|
||||
api: undefined!,
|
||||
deviceId: deviceId,
|
||||
jellyfin: jellyfin,
|
||||
createApi: (serverAddress, accessToken?) =>
|
||||
set((state) => ({
|
||||
...state,
|
||||
api: jellyfin.createApi(serverAddress, accessToken, axiosClient),
|
||||
})),
|
||||
set((state) => {
|
||||
const apiTemp = state.jellyfin.createApi(
|
||||
serverAddress,
|
||||
accessToken,
|
||||
axiosClient,
|
||||
);
|
||||
console.info(apiTemp);
|
||||
return {
|
||||
...state,
|
||||
api: apiTemp,
|
||||
};
|
||||
}),
|
||||
})),
|
||||
)
|
||||
);
|
||||
return <ApiContext.Provider value={store}>{children}</ApiContext.Provider>;
|
||||
};
|
||||
|
||||
@@ -76,12 +72,4 @@ export function useApiInContext<T>(selector?: (state: ApiStore) => T) {
|
||||
throw new Error("Missing StoreProvider");
|
||||
}
|
||||
return useStore(store, selector!);
|
||||
}
|
||||
|
||||
export const createApi = (
|
||||
serverAddress: string | undefined,
|
||||
accessToken: string | undefined,
|
||||
) => {
|
||||
const createApiFn = useApiInContext((s) => s.createApi);
|
||||
createApiFn(serverAddress, accessToken);
|
||||
};
|
||||
}
|
||||
@@ -1,73 +1,82 @@
|
||||
import type { Api } from "@jellyfin/sdk";
|
||||
import type {
|
||||
BaseItemDto,
|
||||
BaseItemKind,
|
||||
MediaStream,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getMediaInfoApi } from "@jellyfin/sdk/lib/utils/api/media-info-api";
|
||||
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||
import type { AxiosResponse } from "axios";
|
||||
import { create } from "zustand";
|
||||
import getSubtitle from "../methods/getSubtitles";
|
||||
import playbackProfile from "../playback-profiles";
|
||||
import { useApiInContext } from "./api";
|
||||
import type IntroMediaInfo from "../types/introMediaInfo";
|
||||
import type subtitlePlaybackInfo from "../types/subtitlePlaybackInfo";
|
||||
import { axiosClient, useApiInContext } from "./api";
|
||||
import { playAudio } from "./audioPlayback";
|
||||
import useQueue, { setQueue, setTrackIndex } from "./queue";
|
||||
|
||||
type PlaybackStore = {
|
||||
itemName: string | React.Component;
|
||||
itemName: string | React.Component | undefined | null;
|
||||
episodeTitle: string | React.Component;
|
||||
mediaSource: {
|
||||
videoTrack: number;
|
||||
audioTrack: number;
|
||||
subtitleTrack: number | "nosub";
|
||||
container: string;
|
||||
availableSubtitleTracks: MediaStream[];
|
||||
id: string | undefined;
|
||||
subtitle: subtitlePlaybackInfo;
|
||||
};
|
||||
enableSubtitle: boolean;
|
||||
hlsStream: string;
|
||||
playbackStream: string;
|
||||
userId: string;
|
||||
startPosition: number;
|
||||
itemDuration: number;
|
||||
item: BaseItemDto | null;
|
||||
playsessionId: string | undefined | null;
|
||||
intro: IntroMediaInfo | undefined;
|
||||
};
|
||||
|
||||
export const usePlaybackStore = create<PlaybackStore>(() => ({
|
||||
itemName: "",
|
||||
itemName: undefined!,
|
||||
episodeTitle: "",
|
||||
mediaSource: {
|
||||
videoTrack: 0,
|
||||
audioTrack: 0,
|
||||
subtitleTrack: 0,
|
||||
container: "",
|
||||
availableSubtitleTracks: [],
|
||||
id: undefined,
|
||||
subtitle: {
|
||||
enable: false,
|
||||
track: undefined!,
|
||||
format: "ass",
|
||||
allTracks: undefined,
|
||||
url: undefined,
|
||||
},
|
||||
},
|
||||
enableSubtitle: true,
|
||||
hlsStream: "",
|
||||
playbackStream: "",
|
||||
userId: "",
|
||||
startPosition: 0,
|
||||
itemDuration: 0,
|
||||
item: null,
|
||||
playsessionId: "",
|
||||
intro: undefined,
|
||||
}));
|
||||
|
||||
export const playItem = (
|
||||
itemName,
|
||||
episodeTitle,
|
||||
videoTrack,
|
||||
audioTrack,
|
||||
subtitleTrack,
|
||||
container,
|
||||
enableSubtitle,
|
||||
hlsStream,
|
||||
userId,
|
||||
startPosition,
|
||||
itemDuration,
|
||||
item,
|
||||
queue,
|
||||
queueItemIndex,
|
||||
availableSubtitleTracks,
|
||||
mediaSourceId,
|
||||
playsessionId,
|
||||
itemName: string | React.Component | undefined | null,
|
||||
episodeTitle: string,
|
||||
videoTrack: number,
|
||||
audioTrack: number,
|
||||
container: string,
|
||||
playbackStream: string,
|
||||
userId: string,
|
||||
startPosition: number | undefined | null,
|
||||
itemDuration: number | undefined | null,
|
||||
item: BaseItemDto,
|
||||
queue: BaseItemDto[] | undefined | null,
|
||||
queueItemIndex: number,
|
||||
mediaSourceId: string | undefined | null,
|
||||
playsessionId: string | undefined | null,
|
||||
subtitle: subtitlePlaybackInfo,
|
||||
intro: IntroMediaInfo | undefined,
|
||||
) => {
|
||||
console.log({
|
||||
itemName,
|
||||
@@ -75,18 +84,17 @@ export const playItem = (
|
||||
mediaSource: {
|
||||
videoTrack,
|
||||
audioTrack,
|
||||
subtitleTrack,
|
||||
container,
|
||||
availableSubtitleTracks,
|
||||
id: mediaSourceId,
|
||||
subtitle,
|
||||
},
|
||||
enableSubtitle,
|
||||
hlsStream,
|
||||
playbackStream,
|
||||
userId,
|
||||
startPosition,
|
||||
itemDuration,
|
||||
item,
|
||||
playsessionId,
|
||||
intro,
|
||||
});
|
||||
usePlaybackStore.setState({
|
||||
itemName,
|
||||
@@ -94,18 +102,17 @@ export const playItem = (
|
||||
mediaSource: {
|
||||
videoTrack,
|
||||
audioTrack,
|
||||
subtitleTrack,
|
||||
container,
|
||||
availableSubtitleTracks,
|
||||
id: mediaSourceId,
|
||||
subtitle,
|
||||
},
|
||||
enableSubtitle,
|
||||
hlsStream,
|
||||
playbackStream,
|
||||
userId,
|
||||
startPosition,
|
||||
itemDuration,
|
||||
item,
|
||||
playsessionId,
|
||||
intro,
|
||||
});
|
||||
setQueue(queue, queueItemIndex);
|
||||
};
|
||||
@@ -113,6 +120,7 @@ export const playItem = (
|
||||
export const playItemFromQueue = async (
|
||||
index: "next" | "previous" | number,
|
||||
userId: string | undefined,
|
||||
api: Api,
|
||||
) => {
|
||||
const queueItems = useQueue.getState().tracks;
|
||||
const currentItemIndex = useQueue.getState().currentItemIndex;
|
||||
@@ -123,7 +131,6 @@ export const playItemFromQueue = async (
|
||||
? currentItemIndex - 1
|
||||
: index;
|
||||
const item = queueItems[requestedItemIndex];
|
||||
const api = useApiInContext((s) => s.api);
|
||||
if (item.Type === "Audio") {
|
||||
const urlOptions = {
|
||||
deviceId: api?.deviceInfo.id,
|
||||
@@ -136,18 +143,21 @@ export const playItemFromQueue = async (
|
||||
console.log(item);
|
||||
playAudio(playbackUrl, item, undefined, queueItems, requestedItemIndex);
|
||||
} else {
|
||||
const mediaInfo = await getMediaInfoApi(api).getPostedPlaybackInfo({
|
||||
audioStreamIndex: item.MediaSources[0].DefaultAudioStreamIndex ?? 0,
|
||||
subtitleStreamIndex: item.MediaSources[0].DefaultSubtitleStreamIndex ?? 0,
|
||||
itemId: item.Id,
|
||||
startTimeTicks: item.UserData?.PlaybackPositionTicks,
|
||||
userId: userId,
|
||||
mediaSourceId: item.MediaSources[0].Id,
|
||||
playbackInfoDto: {
|
||||
DeviceProfile: playbackProfile,
|
||||
},
|
||||
});
|
||||
console.log(mediaInfo);
|
||||
const mediaSource = (
|
||||
await getMediaInfoApi(api).getPostedPlaybackInfo({
|
||||
audioStreamIndex: item.MediaSources?.[0]?.DefaultAudioStreamIndex ?? 0,
|
||||
subtitleStreamIndex:
|
||||
item.MediaSources?.[0]?.DefaultSubtitleStreamIndex ?? 0,
|
||||
itemId: item.Id,
|
||||
startTimeTicks: item.UserData?.PlaybackPositionTicks,
|
||||
userId: userId,
|
||||
mediaSourceId: item.MediaSources?.[0].Id,
|
||||
playbackInfoDto: {
|
||||
DeviceProfile: playbackProfile,
|
||||
},
|
||||
})
|
||||
).data;
|
||||
console.log(mediaSource);
|
||||
let itemName = item.Name;
|
||||
let episodeTitle = "";
|
||||
if (item.SeriesId) {
|
||||
@@ -156,53 +166,65 @@ export const playItemFromQueue = async (
|
||||
item.IndexNumber ?? 0
|
||||
} ${item.Name}`;
|
||||
}
|
||||
|
||||
// Select correct subtitle track, this is useful if item is played with playbutton from card since that does not provide coorect default subtitle track index.
|
||||
let selectedSubtitleTrack: number | "nosub" | undefined = -1;
|
||||
const subtitles = mediaInfo.data.MediaSources[0].MediaStreams?.filter(
|
||||
(value) => value.Type === "Subtitle",
|
||||
// Subtitle
|
||||
const subtitle = getSubtitle(
|
||||
mediaSource.MediaSources?.[0].DefaultSubtitleStreamIndex ?? "nosub",
|
||||
mediaSource.MediaSources?.[0].MediaStreams,
|
||||
);
|
||||
let enableSubtitles = true;
|
||||
if (mediaInfo.data.MediaSources[0].DefaultSubtitleStreamIndex) {
|
||||
selectedSubtitleTrack =
|
||||
mediaInfo.data.MediaSources[0].DefaultSubtitleStreamIndex;
|
||||
} else if (subtitles?.length > 0) {
|
||||
selectedSubtitleTrack = subtitles[0].Index;
|
||||
} else {
|
||||
enableSubtitles = false;
|
||||
}
|
||||
const videoTrack = mediaInfo.data.MediaSources[0].MediaStreams?.filter(
|
||||
(value) => value.Type === "Subtitle",
|
||||
);
|
||||
|
||||
console.log(subtitle);
|
||||
// URL generation
|
||||
const urlOptions = {
|
||||
Static: true,
|
||||
tag: mediaInfo.data.MediaSources[0].ETag,
|
||||
mediaSourceId: mediaInfo.data.MediaSources[0].Id,
|
||||
tag: mediaSource.MediaSources?.[0].ETag,
|
||||
mediaSourceId: mediaSource.MediaSources?.[0].Id,
|
||||
deviceId: api?.deviceInfo.id,
|
||||
api_key: api?.accessToken,
|
||||
startTimeTicks: item.UserData?.PlaybackPositionTicks,
|
||||
};
|
||||
|
||||
const urlParams = new URLSearchParams(urlOptions).toString();
|
||||
let playbackUrl = `${api?.basePath}/Videos/${mediaInfo.data.MediaSources[0].Id}/stream.${mediaInfo.data.MediaSources[0].Container}?${urlParams}`;
|
||||
|
||||
let playbackUrl = `${api?.basePath}/Videos/${mediaSource.MediaSources?.[0].Id}/stream.${mediaSource.MediaSources?.[0].Container}?${urlParams}`;
|
||||
if (
|
||||
mediaInfo.data.MediaSources[0].SupportsTranscoding &&
|
||||
mediaInfo.data.MediaSources[0].TranscodingUrl
|
||||
mediaSource.MediaSources?.[0].SupportsTranscoding &&
|
||||
mediaSource.MediaSources?.[0].TranscodingUrl
|
||||
) {
|
||||
playbackUrl = `${api.basePath}${mediaInfo.data.MediaSources[0].TranscodingUrl}`;
|
||||
} else if (mediaInfo.data.MediaSources[0].hlsStream) {
|
||||
playbackUrl = mediaInfo.data.MediaSources[0].hlsStream;
|
||||
playbackUrl = `${api.basePath}${mediaSource.MediaSources[0].TranscodingUrl}`;
|
||||
}
|
||||
|
||||
const videoTrack = mediaSource.MediaSources?.[0].MediaStreams?.filter(
|
||||
(value) => value.Type === "Video",
|
||||
);
|
||||
|
||||
let introInfo: undefined | AxiosResponse<IntroMediaInfo, any>;
|
||||
try {
|
||||
introInfo = (
|
||||
await axiosClient.get(
|
||||
`${api.basePath}/Episode/${item.Id}/IntroTimestamps`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: `MediaBrowser Token=${api.accessToken}`,
|
||||
},
|
||||
},
|
||||
)
|
||||
)?.data;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
// Report playback stop to jellyfin server for previous episode allowing next episode to report playback
|
||||
getPlaystateApi(api).reportPlaybackStopped({
|
||||
playbackStopInfo: {
|
||||
Failed: false,
|
||||
ItemId: item?.Id,
|
||||
MediaSourceId: mediaSource.MediaSources?.[0].Id,
|
||||
PlaySessionId: mediaSource.PlaySessionId,
|
||||
},
|
||||
});
|
||||
|
||||
playItem(
|
||||
itemName,
|
||||
episodeTitle,
|
||||
videoTrack[0].Index,
|
||||
mediaInfo.data.MediaSources[0].DefaultAudioStreamIndex ?? 0,
|
||||
selectedSubtitleTrack,
|
||||
mediaInfo.data?.MediaSources[0].Container ?? "mkv",
|
||||
enableSubtitles,
|
||||
mediaSource.MediaSources?.[0].DefaultAudioStreamIndex,
|
||||
mediaSource?.MediaSources?.[0].Container ?? "mkv",
|
||||
playbackUrl,
|
||||
userId,
|
||||
item.UserData?.PlaybackPositionTicks,
|
||||
@@ -210,9 +232,10 @@ export const playItemFromQueue = async (
|
||||
item,
|
||||
queueItems,
|
||||
requestedItemIndex,
|
||||
subtitles,
|
||||
mediaInfo.data.MediaSources[0].Id,
|
||||
mediaInfo.data.PlaySessionId,
|
||||
mediaSource.MediaSources?.[0]?.Id,
|
||||
mediaSource.PlaySessionId,
|
||||
subtitle,
|
||||
introInfo,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -234,3 +257,30 @@ export const usePlaybackDataLoadStore = create<PlaybackDataLoadState>(
|
||||
})),
|
||||
}),
|
||||
);
|
||||
|
||||
export const changeSubtitleTrack = (
|
||||
trackIndex: number,
|
||||
allTracks: MediaStream[],
|
||||
) => {
|
||||
const requiredSubtitle = allTracks.filter(
|
||||
(track) => track.Index === trackIndex,
|
||||
);
|
||||
const prevState = usePlaybackStore.getState();
|
||||
prevState.mediaSource.subtitle = {
|
||||
url: requiredSubtitle?.[0]?.DeliveryUrl,
|
||||
track: trackIndex,
|
||||
format: requiredSubtitle?.[0]?.Codec,
|
||||
allTracks,
|
||||
enable: true,
|
||||
};
|
||||
usePlaybackStore.setState(prevState);
|
||||
};
|
||||
|
||||
export const toggleSubtitleTrack = () => {
|
||||
const prevState = usePlaybackStore.getState();
|
||||
if (prevState.mediaSource.subtitle.track !== -1) {
|
||||
prevState.mediaSource.subtitle.enable =
|
||||
!prevState.mediaSource.subtitle.enable;
|
||||
usePlaybackStore.setState(prevState);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
type IntroMediaInfo = {
|
||||
EpisodeId: string;
|
||||
Valid: true;
|
||||
IntroStart: number;
|
||||
IntroEnd: number;
|
||||
ShowSkipPromptAt: number;
|
||||
HideSkipPromptAt: number;
|
||||
};
|
||||
|
||||
export default IntroMediaInfo
|
||||
@@ -2,10 +2,12 @@ import type {
|
||||
BaseItemDtoQueryResult,
|
||||
PlaybackInfoResponse,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import type IntroMediaInfo from "./introMediaInfo";
|
||||
|
||||
interface PlayResult {
|
||||
item: BaseItemDtoQueryResult;
|
||||
mediaSource: PlaybackInfoResponse;
|
||||
introInfo: IntroMediaInfo | undefined;
|
||||
}
|
||||
|
||||
export default PlayResult;
|
||||
@@ -0,0 +1,4 @@
|
||||
type SeriesBackdropImage = {
|
||||
url?: string | null;
|
||||
key?: string | null;
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { MediaStream } from "@jellyfin/sdk/lib/generated-client";
|
||||
|
||||
export default interface subtitlePlaybackInfo {
|
||||
enable: boolean;
|
||||
track: number;
|
||||
format: "vtt" | "ass" | "ssa" | "subrip" | undefined | null;
|
||||
allTracks: undefined | MediaStream[];
|
||||
url: string | undefined | null;
|
||||
}
|
||||