Compare commits
35
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f4c2f990a | ||
|
|
027cf93492 | ||
|
|
092a1c74ab | ||
|
|
fb7c86631d | ||
|
|
7137cbc13e | ||
|
|
989542107f | ||
|
|
97981c7d35 | ||
|
|
797c80b8cd | ||
|
|
377f926fea | ||
|
|
dd4f5bab30 | ||
|
|
e47b7afd15 | ||
|
|
a16523118b | ||
|
|
b2aaed792e | ||
|
|
117ddba9b6 | ||
|
|
1a25bb20cb | ||
|
|
8ba41979e2 | ||
|
|
1bd295e0d4 | ||
|
|
479ae161b1 | ||
|
|
6957641999 | ||
|
|
419c76d81c | ||
|
|
bd5313ebf3 | ||
|
|
16dcff113d | ||
|
|
e2d50addc1 | ||
|
|
2ddaf61399 | ||
|
|
2570c96f31 | ||
|
|
fbe31a190a | ||
|
|
7c1df32117 | ||
|
|
b690ff5b3e | ||
|
|
a04e263ad5 | ||
|
|
0e0833876b | ||
|
|
4d92a059d1 | ||
|
|
5c41bfeca1 | ||
|
|
7df95a05ed | ||
|
|
3911459eed | ||
|
|
b1c0704bac |
No files matched your search
@@ -3,6 +3,7 @@
|
|||||||
# 📝 Prerequisites:
|
# 📝 Prerequisites:
|
||||||
- Nodejs (≥19.1.0)
|
- Nodejs (≥19.1.0)
|
||||||
- Rust (≥1.66.1)
|
- Rust (≥1.66.1)
|
||||||
|
- Visual Studio C++ Build tools
|
||||||
|
|
||||||
# ℹ️ Getting started:
|
# ℹ️ Getting started:
|
||||||
- Install Nodejs and Rust.
|
- Install Nodejs and Rust.
|
||||||
|
|||||||
Generated
+857
-691
File diff suppressed because it is too large.
Load diff
+12
-14
@@ -15,39 +15,37 @@
|
|||||||
"@fontsource/open-sans": "^4.5.13",
|
"@fontsource/open-sans": "^4.5.13",
|
||||||
"@jellyfin/sdk": "^0.8.2",
|
"@jellyfin/sdk": "^0.8.2",
|
||||||
"@mdi/js": "^7.2.96",
|
"@mdi/js": "^7.2.96",
|
||||||
"@mui/lab": "^5.0.0-alpha.127",
|
"@mui/lab": "^5.0.0-alpha.128",
|
||||||
"@mui/material": "^5.11.16",
|
"@mui/material": "^5.11.16",
|
||||||
"@reduxjs/toolkit": "^1.9.3",
|
|
||||||
"@tanstack/react-query": "^4.26.1",
|
"@tanstack/react-query": "^4.26.1",
|
||||||
"@tanstack/react-query-devtools": "^4.29.3",
|
"@tanstack/react-query-devtools": "^4.29.3",
|
||||||
|
"@tauri-apps/api": "^1.2.0",
|
||||||
|
"@videojs/http-streaming": "^3.0.2",
|
||||||
|
"axios": "^1.4.0",
|
||||||
"blurhash": "^2.0.5",
|
"blurhash": "^2.0.5",
|
||||||
"events": "^3.3.0",
|
"events": "^3.3.0",
|
||||||
"framer-motion": "^10.12.4",
|
"framer-motion": "^10.12.4",
|
||||||
"localforage": "^1.10.0",
|
|
||||||
"match-sorter": "^6.3.1",
|
|
||||||
"notistack": "^3.0.1",
|
"notistack": "^3.0.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-blurhash": "^0.3.0",
|
"react-blurhash": "^0.3.0",
|
||||||
"react-cookie": "^4.1.1",
|
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-konami-code": "^2.3.0",
|
"react-konami-code": "^2.3.0",
|
||||||
"react-material-ui-carousel": "^3.4.2",
|
"react-material-ui-carousel": "^3.4.2",
|
||||||
"react-multi-carousel": "^2.8.3",
|
"react-multi-carousel": "^2.8.3",
|
||||||
"react-parallax": "^3.5.1",
|
"react-player": "^2.12.0",
|
||||||
"react-redux": "^8.0.5",
|
"react-router-dom": "^6.11.0",
|
||||||
"react-router-dom": "^6.10.0",
|
|
||||||
"redux": "^4.2.1",
|
|
||||||
"sort-by": "^1.2.0",
|
|
||||||
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
|
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
|
||||||
"uuid": "^9.0.0",
|
"uuid": "^9.0.0",
|
||||||
"vite-plugin-svgr": "^2.2.2"
|
"vite-plugin-svgr": "^3.2.0",
|
||||||
|
"zustand": "^4.3.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tauri-apps/cli": "^1.2.2",
|
"@tauri-apps/cli": "^1.2.2",
|
||||||
"@types/react": "^18.0.38",
|
"@types/react": "^18.2.0",
|
||||||
"@types/react-dom": "^18.0.8",
|
"@types/react-dom": "^18.2.1",
|
||||||
"@vitejs/plugin-react": "^4.0.0",
|
"@vitejs/plugin-react": "^4.0.0",
|
||||||
"sass": "^1.61.0",
|
"sass": "^1.62.1",
|
||||||
|
"video.js": "^8.3.0",
|
||||||
"vite": "^4.3.1"
|
"vite": "^4.3.1"
|
||||||
},
|
},
|
||||||
"license": "GPL-3.0-only"
|
"license": "GPL-3.0-only"
|
||||||
|
|||||||
@@ -17,8 +17,10 @@ tauri-build = { version = "1.2.1", features = [] }
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
tauri = { version = "1.2.2", features = ["process-exit", "process-relaunch"] }
|
tauri = { version = "1.2.2", features = ["api-all", "devtools"] }
|
||||||
tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" }
|
tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" }
|
||||||
|
tauri-plugin-localhost = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
|
||||||
|
portpicker = "0.1" # used in the example to pick a random free port
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# by default Tauri runs in production mode
|
# by default Tauri runs in production mode
|
||||||
|
|||||||
+34
-2
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
use tauri::Manager;
|
use tauri::Manager;
|
||||||
|
|
||||||
|
use tauri::{utils::config::AppUrl, WindowUrl};
|
||||||
|
|
||||||
// Create the command:
|
// Create the command:
|
||||||
// This command must be async so that it doesn't run on the main thread.
|
// This command must be async so that it doesn't run on the main thread.
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
@@ -14,10 +16,40 @@ async fn close_splashscreen(window: tauri::Window) {
|
|||||||
window.get_window("main").unwrap().show().unwrap();
|
window.get_window("main").unwrap().show().unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tauri by default uses HTTPS, so use the localhost plugin to downgrade back to
|
||||||
|
// HTTP. However, when running tauri dev, we already have a localhost server
|
||||||
|
// provided by vite, so don't enable it
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
|
const USE_LOCALHOST_SERVER: bool = false;
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
|
const USE_LOCALHOST_SERVER: bool = true;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
tauri::Builder::default()
|
let port = portpicker::pick_unused_port().expect("failed to find unused port");
|
||||||
|
|
||||||
|
let window_url = if USE_LOCALHOST_SERVER {
|
||||||
|
WindowUrl::External(format!("http://localhost:{}", port).parse().unwrap())
|
||||||
|
} else {
|
||||||
|
WindowUrl::App("index.html".into())
|
||||||
|
};
|
||||||
|
|
||||||
|
let mut context = tauri::generate_context!();
|
||||||
|
let mut builder = tauri::Builder::default();
|
||||||
|
|
||||||
|
if USE_LOCALHOST_SERVER {
|
||||||
|
// rewrite the config so the IPC is enabled on this URL
|
||||||
|
context.config_mut().build.dist_dir = AppUrl::Url(window_url.clone());
|
||||||
|
context.config_mut().build.dev_path = AppUrl::Url(window_url.clone());
|
||||||
|
builder = builder.plugin(tauri_plugin_localhost::Builder::new(port).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
builder
|
||||||
.invoke_handler(tauri::generate_handler![close_splashscreen])
|
.invoke_handler(tauri::generate_handler![close_splashscreen])
|
||||||
.plugin(tauri_plugin_store::Builder::default().build())
|
.plugin(tauri_plugin_store::Builder::default().build())
|
||||||
.run(tauri::generate_context!())
|
.run(context)
|
||||||
.expect("error while running tauri application");
|
.expect("error while running tauri application");
|
||||||
|
// tauri::Builder::default()
|
||||||
|
// .run(tauri::generate_context!())
|
||||||
|
// .expect("error while running tauri application");
|
||||||
}
|
}
|
||||||
@@ -12,12 +12,20 @@
|
|||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
"all": false,
|
|
||||||
"process": {
|
"process": {
|
||||||
"all": false,
|
"all": false,
|
||||||
"exit": true,
|
"exit": true,
|
||||||
"relaunch": true,
|
"relaunch": true,
|
||||||
"relaunchDangerousAllowSymlinkMacos": false
|
"relaunchDangerousAllowSymlinkMacos": false
|
||||||
|
},
|
||||||
|
"window": {
|
||||||
|
"setFullscreen": true
|
||||||
|
},
|
||||||
|
"shell": {
|
||||||
|
"all": true
|
||||||
|
},
|
||||||
|
"http": {
|
||||||
|
"all": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
|
|||||||
+46
-41
@@ -7,7 +7,7 @@ import Konami from "react-konami-code";
|
|||||||
const Kon = Konami.default ? Konami.default : Konami;
|
const Kon = Konami.default ? Konami.default : Konami;
|
||||||
|
|
||||||
import { ThemeProvider } from "@mui/material/styles";
|
import { ThemeProvider } from "@mui/material/styles";
|
||||||
import { SnackbarProvider } from "notistack";
|
import { SnackbarProvider, useSnackbar } from "notistack";
|
||||||
import {
|
import {
|
||||||
Routes,
|
Routes,
|
||||||
Route,
|
Route,
|
||||||
@@ -23,8 +23,7 @@ import { relaunch } from "@tauri-apps/api/process";
|
|||||||
|
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||||
// import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|
||||||
|
|
||||||
// Theming
|
// Theming
|
||||||
import CssBaseline from "@mui/material/CssBaseline";
|
import CssBaseline from "@mui/material/CssBaseline";
|
||||||
@@ -47,9 +46,12 @@ import Home from "./routes/home";
|
|||||||
import { UserLogin, LoginWithImage, UserLoginManual } from "./routes/login";
|
import { UserLogin, LoginWithImage, UserLoginManual } from "./routes/login";
|
||||||
import LibraryView from "./routes/library";
|
import LibraryView from "./routes/library";
|
||||||
import ItemDetail from "./routes/item";
|
import ItemDetail from "./routes/item";
|
||||||
|
import FavouritePage from "./routes/favourite/index.jsx";
|
||||||
import Settings from "./routes/settings";
|
import Settings from "./routes/settings";
|
||||||
import About from "./routes/about";
|
import About from "./routes/about";
|
||||||
|
|
||||||
|
import { VideoPlayer } from "./routes/player/videoPlayer.jsx";
|
||||||
|
|
||||||
import { SideMenu } from "./components/menu/sidemenu.jsx";
|
import { SideMenu } from "./components/menu/sidemenu.jsx";
|
||||||
import { AppBar } from "./components/appBar/appBar.jsx";
|
import { AppBar } from "./components/appBar/appBar.jsx";
|
||||||
|
|
||||||
@@ -57,15 +59,18 @@ import { AppBar } from "./components/appBar/appBar.jsx";
|
|||||||
import "@fontsource/open-sans";
|
import "@fontsource/open-sans";
|
||||||
|
|
||||||
// Jellyfin SDK TypeScript
|
// Jellyfin SDK TypeScript
|
||||||
import { Jellyfin } from "@jellyfin/sdk";
|
import {
|
||||||
|
Jellyfin,
|
||||||
|
VersionOutdatedIssue,
|
||||||
|
VersionUnsupportedIssue,
|
||||||
|
} from "@jellyfin/sdk";
|
||||||
import { version as appVer } from "../package.json";
|
import { version as appVer } from "../package.json";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
import { v4 as uuidv4 } from "uuid";
|
||||||
import { delServer, getServer } from "./utils/storage/servers.js";
|
import { delServer, getServer } from "./utils/storage/servers.js";
|
||||||
import { delUser, getUser } from "./utils/storage/user.js";
|
import { delUser, getUser } from "./utils/storage/user.js";
|
||||||
|
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api.js";
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
import { useDispatch } from "react-redux";
|
|
||||||
import { showSidemenu } from "./utils/slice/sidemenu.js";
|
|
||||||
import FavouritePage from "./routes/favourite/index.jsx";
|
|
||||||
const jellyfin = new Jellyfin({
|
const jellyfin = new Jellyfin({
|
||||||
clientInfo: {
|
clientInfo: {
|
||||||
name: "JellyPlayer",
|
name: "JellyPlayer",
|
||||||
@@ -90,12 +95,15 @@ event.on("set-api-accessToken", (serverAddress) => {
|
|||||||
|
|
||||||
const anim = {
|
const anim = {
|
||||||
initial: {
|
initial: {
|
||||||
|
transform: "scale(0.99)",
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
},
|
},
|
||||||
animate: {
|
animate: {
|
||||||
|
transform: "scale(1)",
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
},
|
},
|
||||||
exit: {
|
exit: {
|
||||||
|
transform: "scale(0.99)",
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -120,15 +128,13 @@ const AnimationWrapper = () => {
|
|||||||
function App() {
|
function App() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
|
||||||
|
|
||||||
const [serverReachable, setServerReachable] = useState(true);
|
const [serverReachable, setServerReachable] = useState(true);
|
||||||
const [checkingServer, setChecking] = useState(false);
|
|
||||||
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
|
|
||||||
const createApi = async () => {
|
const createApi = async () => {
|
||||||
const server = await getServer();
|
const server = await getServer();
|
||||||
event.emit("create-jellyfin-api", server.Ip);
|
event.emit("create-jellyfin-api", server.Ip);
|
||||||
dispatch(showSidemenu());
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const serverAvailable = async () => {
|
const serverAvailable = async () => {
|
||||||
@@ -159,30 +165,24 @@ function App() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const pingServer = () => {
|
const pingServer = async () => {
|
||||||
setChecking(true);
|
const server = await getServer();
|
||||||
let data;
|
try {
|
||||||
fetch(`${window.api.basePath}/System/Ping`, {
|
const result = await axios.get(
|
||||||
body: JSON.stringify(data),
|
new URL(`${server.Ip}/System/Ping`).href,
|
||||||
})
|
|
||||||
.then((res) => res.json())
|
|
||||||
.then((data) => {
|
|
||||||
if (data == "Jellyfin Server") {
|
|
||||||
setServerReachable(true);
|
|
||||||
setChecking(false);
|
|
||||||
} else {
|
|
||||||
enqueueSnackbar(
|
|
||||||
"The server address does not seem be a jellyfin server",
|
|
||||||
{ variant: "error" },
|
|
||||||
);
|
);
|
||||||
|
if (result.data == "Jellyfin Server") {
|
||||||
|
event.emit("create-jellyfin-api", server.Ip);
|
||||||
|
setServerReachable(true);
|
||||||
|
} else {
|
||||||
setServerReachable(false);
|
setServerReachable(false);
|
||||||
setChecking(false);
|
|
||||||
}
|
}
|
||||||
})
|
} catch (error) {
|
||||||
.catch((error) => {
|
|
||||||
setServerReachable(false);
|
setServerReachable(false);
|
||||||
setChecking(false);
|
enqueueSnackbar("Unable to verfiy server address.", {
|
||||||
|
variant: "error",
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const userLogin = async () => {
|
const userLogin = async () => {
|
||||||
@@ -193,8 +193,6 @@ function App() {
|
|||||||
);
|
);
|
||||||
sessionStorage.setItem("accessToken", auth.data.AccessToken);
|
sessionStorage.setItem("accessToken", auth.data.AccessToken);
|
||||||
event.emit("set-api-accessToken", window.api.basePath);
|
event.emit("set-api-accessToken", window.api.basePath);
|
||||||
|
|
||||||
// navigate("/home");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const LogicalRoutes = () => {
|
const LogicalRoutes = () => {
|
||||||
@@ -227,7 +225,6 @@ function App() {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
navigate("/setup/server");
|
navigate("/setup/server");
|
||||||
setChecking(false);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -242,7 +239,10 @@ function App() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRelaunch = async () => {
|
const handleRelaunch = async (event, reason) => {
|
||||||
|
if (reason && reason == "backdropClick") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let result = await relaunch();
|
let result = await relaunch();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -274,7 +274,7 @@ function App() {
|
|||||||
return (
|
return (
|
||||||
<SnackbarProvider maxSnack={5}>
|
<SnackbarProvider maxSnack={5}>
|
||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
{checkingServer && (
|
{pingServer.isLoading && (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@@ -340,7 +340,11 @@ function App() {
|
|||||||
location={location}
|
location={location}
|
||||||
>
|
>
|
||||||
<Route element={<AnimationWrapper />}>
|
<Route element={<AnimationWrapper />}>
|
||||||
{/* Main Routes */}
|
<Route
|
||||||
|
path="/"
|
||||||
|
element={<LogicalRoutes />}
|
||||||
|
/>
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path="/home"
|
path="/home"
|
||||||
element={<Home />}
|
element={<Home />}
|
||||||
@@ -366,10 +370,12 @@ function App() {
|
|||||||
element={<UserLoginManual />}
|
element={<UserLoginManual />}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
|
exact
|
||||||
path="/library/:id"
|
path="/library/:id"
|
||||||
element={<LibraryView />}
|
element={<LibraryView />}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
|
exact
|
||||||
path="/item/:id"
|
path="/item/:id"
|
||||||
element={<ItemDetail />}
|
element={<ItemDetail />}
|
||||||
/>
|
/>
|
||||||
@@ -385,13 +391,11 @@ function App() {
|
|||||||
path="/about"
|
path="/about"
|
||||||
element={<About />}
|
element={<About />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Logical Routes */}
|
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path="/"
|
path="/player"
|
||||||
element={<LogicalRoutes />}
|
element={<VideoPlayer />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path="/login"
|
path="/login"
|
||||||
element={<LoginLogicalRoutes />}
|
element={<LoginLogicalRoutes />}
|
||||||
@@ -400,6 +404,7 @@ function App() {
|
|||||||
</Routes>
|
</Routes>
|
||||||
</div>
|
</div>
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
|
<ReactQueryDevtools />
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</SnackbarProvider>
|
</SnackbarProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -15,11 +15,10 @@ import useScrollTrigger from "@mui/material/useScrollTrigger";
|
|||||||
import { MdiMagnify } from "../icons/mdiMagnify";
|
import { MdiMagnify } from "../icons/mdiMagnify";
|
||||||
import { theme } from "../../theme";
|
import { theme } from "../../theme";
|
||||||
|
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
import { useQueryClient, useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
import "./appBar.module.scss";
|
import "./appBar.module.scss";
|
||||||
import { MdiAccount } from "../icons/mdiAccount";
|
import { MdiAccount } from "../icons/mdiAccount";
|
||||||
@@ -29,11 +28,10 @@ import { MdiCog } from "../icons/mdiCog";
|
|||||||
import { MdiInformation } from "../icons/mdiInformation";
|
import { MdiInformation } from "../icons/mdiInformation";
|
||||||
|
|
||||||
export const AppBar = () => {
|
export const AppBar = () => {
|
||||||
const dispatch = useDispatch();
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const [display, setDisplay] = useState(false);
|
const [display, setDisplay] = useState(false);
|
||||||
const [backButtonVisible, setBackButtonVisible] = useState(true);
|
const [backButtonVisible, setBackButtonVisible] = useState(false);
|
||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
@@ -64,7 +62,9 @@ export const AppBar = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
location.pathname.includes("login") ||
|
location.pathname.includes("login") ||
|
||||||
location.pathname.includes("setup")
|
location.pathname.includes("setup") ||
|
||||||
|
location.pathname.includes("player") ||
|
||||||
|
location.pathname === "/"
|
||||||
) {
|
) {
|
||||||
setDisplay(false);
|
setDisplay(false);
|
||||||
} else {
|
} else {
|
||||||
@@ -88,7 +88,6 @@ export const AppBar = () => {
|
|||||||
<MuiAppBar
|
<MuiAppBar
|
||||||
sx={{
|
sx={{
|
||||||
width: `calc(100vw - ${theme.spacing(7)})`,
|
width: `calc(100vw - ${theme.spacing(7)})`,
|
||||||
// mr: "10px",
|
|
||||||
backgroundColor: "transparent",
|
backgroundColor: "transparent",
|
||||||
}}
|
}}
|
||||||
className={trigger ? "appBar backdropVisible" : "appBar"}
|
className={trigger ? "appBar backdropVisible" : "appBar"}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
import Typography from "@mui/material/Typography";
|
|
||||||
import ButtonBase from "@mui/material/ButtonBase";
|
|
||||||
|
|
||||||
import { MdiAccount } from "../icons/mdiAccount";
|
import { MdiAccount } from "../icons/mdiAccount";
|
||||||
|
|
||||||
@@ -12,7 +10,6 @@ import "./avatar.module.scss";
|
|||||||
export const AvatarImage = ({ userId, userImageTags }) => {
|
export const AvatarImage = ({ userId, userImageTags }) => {
|
||||||
return (
|
return (
|
||||||
<Box className="avatar-image-container">
|
<Box className="avatar-image-container">
|
||||||
{!!userImageTags && (
|
|
||||||
<div
|
<div
|
||||||
className="avatar-image"
|
className="avatar-image"
|
||||||
style={{
|
style={{
|
||||||
@@ -24,7 +21,6 @@ export const AvatarImage = ({ userId, userImageTags }) => {
|
|||||||
"/Images/Primary')",
|
"/Images/Primary')",
|
||||||
}}
|
}}
|
||||||
></div>
|
></div>
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="avatar-image-icon-container">
|
<div className="avatar-image-icon-container">
|
||||||
<MdiAccount className="avatar-image-icon" />
|
<MdiAccount className="avatar-image-icon" />
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import LinearProgress from "@mui/material/LinearProgress";
|
|||||||
import Chip from "@mui/material/Chip";
|
import Chip from "@mui/material/Chip";
|
||||||
import ButtonGroup from "@mui/material/ButtonGroup";
|
import ButtonGroup from "@mui/material/ButtonGroup";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
|
|
||||||
import { Blurhash } from "react-blurhash";
|
import { Blurhash } from "react-blurhash";
|
||||||
import { green, pink } from "@mui/material/colors";
|
import { green, pink } from "@mui/material/colors";
|
||||||
|
|
||||||
@@ -47,6 +48,7 @@ export const Card = ({
|
|||||||
blurhash,
|
blurhash,
|
||||||
currentUser,
|
currentUser,
|
||||||
favourite,
|
favourite,
|
||||||
|
disableOverlay,
|
||||||
}) => {
|
}) => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [imgLoading, setImgLoading] = useState(true);
|
const [imgLoading, setImgLoading] = useState(true);
|
||||||
@@ -92,8 +94,6 @@ export const Card = ({
|
|||||||
"BoxSet",
|
"BoxSet",
|
||||||
"CollectionFolder",
|
"CollectionFolder",
|
||||||
"Movie",
|
"Movie",
|
||||||
"MusicAlbum",
|
|
||||||
"MusicVideo",
|
|
||||||
"Season",
|
"Season",
|
||||||
"Series",
|
"Series",
|
||||||
"Video",
|
"Video",
|
||||||
@@ -176,6 +176,7 @@ export const Card = ({
|
|||||||
<div
|
<div
|
||||||
className="card-media-image-container"
|
className="card-media-image-container"
|
||||||
style={{ opacity: imgLoading ? 0 : 1 }}
|
style={{ opacity: imgLoading ? 0 : 1 }}
|
||||||
|
// style={{ opacity: 1 }}
|
||||||
>
|
>
|
||||||
{imageTags &&
|
{imageTags &&
|
||||||
(cardType == "thumb" ? (
|
(cardType == "thumb" ? (
|
||||||
@@ -211,7 +212,14 @@ export const Card = ({
|
|||||||
<CardMedia
|
<CardMedia
|
||||||
component="img"
|
component="img"
|
||||||
image={
|
image={
|
||||||
window.api.basePath +
|
iconType == "User"
|
||||||
|
? window.api
|
||||||
|
.basePath +
|
||||||
|
"/Users/" +
|
||||||
|
itemId +
|
||||||
|
"/Images/Primary?fillHeight=532&fillWidth=300&quality=96"
|
||||||
|
: window.api
|
||||||
|
.basePath +
|
||||||
"/Items/" +
|
"/Items/" +
|
||||||
itemId +
|
itemId +
|
||||||
"/Images/Primary?fillHeight=532&fillWidth=300&quality=96"
|
"/Images/Primary?fillHeight=532&fillWidth=300&quality=96"
|
||||||
@@ -276,6 +284,7 @@ export const Card = ({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
{!disableOverlay && (
|
||||||
<Box
|
<Box
|
||||||
className="card-media-overlay"
|
className="card-media-overlay"
|
||||||
sx={{
|
sx={{
|
||||||
@@ -291,9 +300,13 @@ export const Card = ({
|
|||||||
) && (
|
) && (
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
handleMarkAsPlayOrUnMarkAsPlay();
|
handleMarkAsPlayOrUnMarkAsPlay();
|
||||||
}}
|
}}
|
||||||
|
onFocus={(e) =>
|
||||||
|
e.stopPropagation
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<MdiCheck
|
<MdiCheck
|
||||||
sx={{
|
sx={{
|
||||||
@@ -304,16 +317,24 @@ export const Card = ({
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
{allowedLikeButton.includes(iconType) && (
|
{allowedLikeButton.includes(
|
||||||
|
iconType,
|
||||||
|
) && (
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
handleLiking();
|
handleLiking();
|
||||||
}}
|
}}
|
||||||
|
onFocus={(e) =>
|
||||||
|
e.stopPropagation
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{isFavorite ? (
|
{isFavorite ? (
|
||||||
<MdiHeart
|
<MdiHeart
|
||||||
sx={{ color: pink[700] }}
|
sx={{
|
||||||
|
color: pink[700],
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<MdiHeartOutline />
|
<MdiHeartOutline />
|
||||||
@@ -322,6 +343,7 @@ export const Card = ({
|
|||||||
)}
|
)}
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</Box>
|
</Box>
|
||||||
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<CardContent
|
<CardContent
|
||||||
@@ -344,17 +366,16 @@ export const Card = ({
|
|||||||
>
|
>
|
||||||
{itemName}
|
{itemName}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Typography
|
<Typography
|
||||||
gutterBottom
|
gutterBottom
|
||||||
variant="subtitle2"
|
variant="subtitle1"
|
||||||
component="div"
|
component="div"
|
||||||
color="gray"
|
|
||||||
textAlign="left"
|
textAlign="left"
|
||||||
// textOverflow={}
|
|
||||||
// fontSize="0.85em"
|
|
||||||
width="fit-content"
|
width="fit-content"
|
||||||
maxWidth="100%"
|
maxWidth="100%"
|
||||||
noWrap
|
noWrap
|
||||||
|
sx={{ opacity: 0.5 }}
|
||||||
>
|
>
|
||||||
{subText}
|
{subText}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import { useNavigate, Link } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
// import Link from "@mui/material/Link";
|
|
||||||
|
|
||||||
import Divider from "@mui/material/Divider";
|
import Divider from "@mui/material/Divider";
|
||||||
import Stack from "@mui/material/Stack";
|
import Stack from "@mui/material/Stack";
|
||||||
@@ -20,10 +19,7 @@ import IconButton from "@mui/material/IconButton";
|
|||||||
import { Blurhash } from "react-blurhash";
|
import { Blurhash } from "react-blurhash";
|
||||||
import { green, pink } from "@mui/material/colors";
|
import { green, pink } from "@mui/material/colors";
|
||||||
|
|
||||||
import {
|
import { TypeIconCollectionCard } from "../utils/iconsCollection";
|
||||||
MediaCollectionTypeIconCollectionCard,
|
|
||||||
TypeIconCollectionCard,
|
|
||||||
} from "../utils/iconsCollection";
|
|
||||||
|
|
||||||
import { borderRadiusDefault } from "../../palette.module.scss";
|
import { borderRadiusDefault } from "../../palette.module.scss";
|
||||||
import "./card.module.scss";
|
import "./card.module.scss";
|
||||||
@@ -56,6 +52,7 @@ export const EpisodeCard = ({
|
|||||||
parentId,
|
parentId,
|
||||||
}) => {
|
}) => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const [imgLoaded, setImgLoaded] = useState(false);
|
||||||
const [isWatched, setIsWatched] = useState(watchedStatus);
|
const [isWatched, setIsWatched] = useState(watchedStatus);
|
||||||
const [isFavourite, setIsFavourite] = useState(favourite);
|
const [isFavourite, setIsFavourite] = useState(favourite);
|
||||||
const handleMarkAsPlayOrUnMarkAsPlay = async () => {
|
const handleMarkAsPlayOrUnMarkAsPlay = async () => {
|
||||||
@@ -130,10 +127,16 @@ export const EpisodeCard = ({
|
|||||||
opacity: isWatched ? 1 : 0,
|
opacity: isWatched ? 1 : 0,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Box className="card-media-image-container">
|
<Box
|
||||||
|
className="card-media-image-container"
|
||||||
|
sx={{
|
||||||
|
opacity: imgLoaded ? 1 : 0,
|
||||||
|
transition: "opacity 250ms",
|
||||||
|
}}
|
||||||
|
>
|
||||||
{imageTags && (
|
{imageTags && (
|
||||||
<CardMedia
|
<CardMedia
|
||||||
component="div"
|
component="img"
|
||||||
image={
|
image={
|
||||||
window.api.basePath +
|
window.api.basePath +
|
||||||
"/Items/" +
|
"/Items/" +
|
||||||
@@ -148,6 +151,7 @@ export const EpisodeCard = ({
|
|||||||
borderRadiusDefault,
|
borderRadiusDefault,
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
}}
|
}}
|
||||||
|
onLoad={() => setImgLoaded(true)}
|
||||||
className="card-image"
|
className="card-image"
|
||||||
></CardMedia>
|
></CardMedia>
|
||||||
)}
|
)}
|
||||||
@@ -195,8 +199,9 @@ export const EpisodeCard = ({
|
|||||||
>
|
>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={(e) => {
|
onMouseDown={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
handleMarkAsPlayOrUnMarkAsPlay();
|
handleMarkAsPlayOrUnMarkAsPlay();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -209,8 +214,9 @@ export const EpisodeCard = ({
|
|||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={(e) => {
|
onMouseDown={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
handleLiking();
|
handleLiking();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -346,7 +352,7 @@ export const EpisodeCard = ({
|
|||||||
mr: "0.25em",
|
mr: "0.25em",
|
||||||
}}
|
}}
|
||||||
/>{" "}
|
/>{" "}
|
||||||
{itemRating}
|
{Math.round(itemRating * 10) / 10}
|
||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
{!!itemTicks && (
|
{!!itemTicks && (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
import { useState, useEffect } from "react";
|
import { useState } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Carousel from "react-multi-carousel";
|
import Carousel from "react-multi-carousel";
|
||||||
@@ -9,7 +9,6 @@ import "react-multi-carousel/lib/styles.css";
|
|||||||
import { MdiChevronLeft } from "../icons/mdiChevronLeft";
|
import { MdiChevronLeft } from "../icons/mdiChevronLeft";
|
||||||
import { MdiChevronRight } from "../icons/mdiChevronRight";
|
import { MdiChevronRight } from "../icons/mdiChevronRight";
|
||||||
|
|
||||||
import { styled } from "@mui/material/styles";
|
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
@@ -22,6 +21,7 @@ export const CardScroller = ({
|
|||||||
title,
|
title,
|
||||||
headingProps,
|
headingProps,
|
||||||
disableDecoration = false,
|
disableDecoration = false,
|
||||||
|
boxProps,
|
||||||
}) => {
|
}) => {
|
||||||
const responsive = {
|
const responsive = {
|
||||||
superLargeDesktop: {
|
superLargeDesktop: {
|
||||||
@@ -50,7 +50,7 @@ export const CardScroller = ({
|
|||||||
const [carouselRef, setCarouselRef] = useState();
|
const [carouselRef, setCarouselRef] = useState();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box className="card-scroller-container" sx={{ mb: 4 }}>
|
<Box {...boxProps} className="card-scroller-container" mb={1}>
|
||||||
<Box
|
<Box
|
||||||
sx={{ mb: 1 }}
|
sx={{ mb: 1 }}
|
||||||
className={
|
className={
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { mdiCheck } from "@mdi/js";
|
|||||||
|
|
||||||
export const MdiCheck = (props) => {
|
export const MdiCheck = (props) => {
|
||||||
return (
|
return (
|
||||||
<SvgIcon color="red" {...props}>
|
<SvgIcon {...props}>
|
||||||
<path d={mdiCheck}></path>
|
<path d={mdiCheck}></path>
|
||||||
</SvgIcon>
|
</SvgIcon>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
/** @format */
|
||||||
|
import SvgIcon from "@mui/material/SvgIcon";
|
||||||
|
|
||||||
|
import { mdiFastForward } from "@mdi/js";
|
||||||
|
|
||||||
|
export const MdiFastForward = (props) => {
|
||||||
|
return (
|
||||||
|
<SvgIcon {...props}>
|
||||||
|
<path d={mdiFastForward}></path>
|
||||||
|
</SvgIcon>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
/** @format */
|
||||||
|
import SvgIcon from "@mui/material/SvgIcon";
|
||||||
|
|
||||||
|
import { mdiPause } from "@mdi/js";
|
||||||
|
|
||||||
|
export const MdiPause = (props) => {
|
||||||
|
return (
|
||||||
|
<SvgIcon {...props}>
|
||||||
|
<path d={mdiPause}></path>
|
||||||
|
</SvgIcon>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
/** @format */
|
||||||
|
import SvgIcon from "@mui/material/SvgIcon";
|
||||||
|
|
||||||
|
import { mdiRewind } from "@mdi/js";
|
||||||
|
|
||||||
|
export const MdiRewind = (props) => {
|
||||||
|
return (
|
||||||
|
<SvgIcon {...props}>
|
||||||
|
<path d={mdiRewind}></path>
|
||||||
|
</SvgIcon>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
import SvgIcon from "@mui/material/SvgIcon";
|
||||||
|
|
||||||
|
import { mdiStar } from "@mdi/js";
|
||||||
|
|
||||||
|
export const MdiStar = (props) => {
|
||||||
|
return (
|
||||||
|
<SvgIcon {...props}>
|
||||||
|
<path d={mdiStar}></path>
|
||||||
|
</SvgIcon>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
.album {
|
||||||
|
&-image-icon {
|
||||||
|
fill: url(#clr-gradient-default) !important;
|
||||||
|
|
||||||
|
&-container {
|
||||||
|
background: $clr-gradient-dark;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,234 @@
|
|||||||
|
/** @format */
|
||||||
|
import { useState } from "react";
|
||||||
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
|
import Box from "@mui/material/Box";
|
||||||
|
import Paper from "@mui/material/Paper";
|
||||||
|
import TableContainer from "@mui/material/TableContainer";
|
||||||
|
import Table from "@mui/material/Table";
|
||||||
|
import TableBody from "@mui/material/TableBody";
|
||||||
|
import TableHead from "@mui/material/TableHead";
|
||||||
|
import TableRow from "@mui/material/TableRow";
|
||||||
|
import TableCell from "@mui/material/TableCell";
|
||||||
|
import Typography from "@mui/material/Typography";
|
||||||
|
import IconButton from "@mui/material/IconButton";
|
||||||
|
import Stack from "@mui/material/Stack";
|
||||||
|
import MuiLink from "@mui/material/Link";
|
||||||
|
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||||
|
import { MdiClockOutline } from "../../icons/mdiClockOutline";
|
||||||
|
import { getRuntimeMusic } from "../../../utils/date/time";
|
||||||
|
import { MdiHeart } from "../../icons/mdiHeart";
|
||||||
|
import { MdiHeartOutline } from "../../icons/mdiHeartOutline";
|
||||||
|
import { MdiAlbum } from "../../icons/mdiAlbum";
|
||||||
|
|
||||||
|
import "./albumArtist.scss";
|
||||||
|
|
||||||
|
export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||||
|
const albumTracks = useQuery({
|
||||||
|
queryKey: ["artist", "album", album.Id],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getItemsApi(window.api).getItems({
|
||||||
|
userId: user.Id,
|
||||||
|
parentId: album.Id,
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
networkMode: "always",
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleLikingTrack = async (track) => {
|
||||||
|
let result;
|
||||||
|
if (track.UserData.IsFavorite) {
|
||||||
|
result = await getUserLibraryApi(window.api).unmarkFavoriteItem({
|
||||||
|
userId: user.data.Id,
|
||||||
|
itemId: track.Id,
|
||||||
|
});
|
||||||
|
} else if (!track.UserData.IsFavorite) {
|
||||||
|
result = await getUserLibraryApi(window.api).markFavoriteItem({
|
||||||
|
userId: user.data.Id,
|
||||||
|
itemId: track.Id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
albumTracks.refetch();
|
||||||
|
};
|
||||||
|
|
||||||
|
const [imgLoaded, setImgLoaded] = useState(false);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box sx={{ mb: 6 }} {...boxProps}>
|
||||||
|
<Stack direction="row" gap={3} mb={3}>
|
||||||
|
{!!album.ImageTags?.Primary && (
|
||||||
|
<Box
|
||||||
|
className="album-image"
|
||||||
|
sx={{
|
||||||
|
aspectRatio: 1,
|
||||||
|
borderRadius: "10px",
|
||||||
|
overflow: "hidden",
|
||||||
|
width: "12em",
|
||||||
|
boxShadow: "0 0 10px rgb(0 0 0 /0.2)",
|
||||||
|
position: "relative",
|
||||||
|
height: "12em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={`${window.api.basePath}/Items/${album.Id}/Images/Primary?fillHeight=532&fillWidth=532&quality=96`}
|
||||||
|
style={{
|
||||||
|
width: "100%",
|
||||||
|
height: "100%",
|
||||||
|
objectFit: "cover",
|
||||||
|
opacity: imgLoaded ? 1 : 0,
|
||||||
|
transition: "opacity 250ms",
|
||||||
|
position: "relative",
|
||||||
|
zIndex: 2,
|
||||||
|
}}
|
||||||
|
onLoad={() => setImgLoaded(true)}
|
||||||
|
/>
|
||||||
|
<Box
|
||||||
|
className="album-image-icon-container"
|
||||||
|
sx={{
|
||||||
|
position: "absolute",
|
||||||
|
width: "100%",
|
||||||
|
height: "100%",
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
zIndex: 1,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MdiAlbum
|
||||||
|
className="album-image-icon"
|
||||||
|
sx={{ fontSize: "6em" }}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
<Stack>
|
||||||
|
<Typography
|
||||||
|
variant="h5"
|
||||||
|
sx={{ opacity: `0.7`, mb: 1 }}
|
||||||
|
>
|
||||||
|
{album.ProductionYear}
|
||||||
|
</Typography>
|
||||||
|
<MuiLink
|
||||||
|
component={Link}
|
||||||
|
to={`/item/${album.Id}`}
|
||||||
|
variant="h3"
|
||||||
|
color="inherit"
|
||||||
|
underline="hover"
|
||||||
|
>
|
||||||
|
{album.Name}
|
||||||
|
</MuiLink>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
<TableContainer
|
||||||
|
component={Paper}
|
||||||
|
sx={{ mb: 2, borderRadius: "15px" }}
|
||||||
|
>
|
||||||
|
<Table>
|
||||||
|
<TableHead
|
||||||
|
sx={{
|
||||||
|
mb: 1,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<TableRow>
|
||||||
|
<TableCell
|
||||||
|
sx={{
|
||||||
|
maxWidth: 120,
|
||||||
|
width: 20,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Typography variant="h6">#</Typography>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell sx={{ width: 20 }}></TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<Typography variant="h6">
|
||||||
|
Name
|
||||||
|
</Typography>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<Typography variant="h6" align="right">
|
||||||
|
<MdiClockOutline />
|
||||||
|
</Typography>
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
</TableHead>
|
||||||
|
<TableBody>
|
||||||
|
{albumTracks.isSuccess &&
|
||||||
|
albumTracks.data.Items.map(
|
||||||
|
(mitem, mindex) => {
|
||||||
|
return (
|
||||||
|
<TableRow
|
||||||
|
key={mindex}
|
||||||
|
sx={{
|
||||||
|
"&:last-child td, &:last-child th":
|
||||||
|
{
|
||||||
|
border: 0,
|
||||||
|
},
|
||||||
|
"&:hover": {
|
||||||
|
background:
|
||||||
|
"rgb(255 255 255 / 0.05)",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<TableCell
|
||||||
|
sx={{
|
||||||
|
maxWidth: 120,
|
||||||
|
width: 20,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Typography variant="body1">
|
||||||
|
{
|
||||||
|
mitem.IndexNumber
|
||||||
|
}
|
||||||
|
</Typography>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell
|
||||||
|
sx={{
|
||||||
|
width: 20,
|
||||||
|
}}
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<IconButton
|
||||||
|
onClick={() =>
|
||||||
|
handleLikingTrack(
|
||||||
|
mitem,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{mitem.UserData
|
||||||
|
.IsFavorite ? (
|
||||||
|
<MdiHeart />
|
||||||
|
) : (
|
||||||
|
<MdiHeartOutline />
|
||||||
|
)}
|
||||||
|
</IconButton>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<Typography variant="body1">
|
||||||
|
{mitem.Name}
|
||||||
|
</Typography>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="right">
|
||||||
|
<Typography variant="body1">
|
||||||
|
{getRuntimeMusic(
|
||||||
|
mitem.RunTimeTicks,
|
||||||
|
)}
|
||||||
|
</Typography>
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
</TableContainer>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { delUser } from "../../utils/storage/user";
|
import { delUser } from "../../utils/storage/user";
|
||||||
|
|
||||||
import { useQueryClient, useQuery, QueryClient } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
|
|
||||||
@@ -15,8 +15,6 @@ import Skeleton from "@mui/material/Skeleton";
|
|||||||
import Tooltip from "@mui/material/Tooltip";
|
import Tooltip from "@mui/material/Tooltip";
|
||||||
import List from "@mui/material/List";
|
import List from "@mui/material/List";
|
||||||
import ListItem from "@mui/material/ListItem";
|
import ListItem from "@mui/material/ListItem";
|
||||||
import Link from "@mui/material/Link";
|
|
||||||
import ListItemText from "@mui/material/ListItemText";
|
|
||||||
import ListItemIcon from "@mui/material/ListItemIcon";
|
import ListItemIcon from "@mui/material/ListItemIcon";
|
||||||
import ListItemButton from "@mui/material/ListItemButton";
|
import ListItemButton from "@mui/material/ListItemButton";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
@@ -28,11 +26,10 @@ import { MdiLogoutVariant } from "../icons/mdiLogoutVariant";
|
|||||||
|
|
||||||
import { MediaCollectionTypeIconCollection } from "../../components/utils/iconsCollection.jsx";
|
import { MediaCollectionTypeIconCollection } from "../../components/utils/iconsCollection.jsx";
|
||||||
|
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
|
||||||
import { hideSidemenu, setBackdrop } from "../../utils/slice/sidemenu";
|
|
||||||
|
|
||||||
import { MdiHomeVariantOutline } from "../icons/mdiHomeVariantOutline";
|
import { MdiHomeVariantOutline } from "../icons/mdiHomeVariantOutline";
|
||||||
|
|
||||||
|
import { EventEmitter as event } from "../../eventEmitter.js";
|
||||||
|
|
||||||
import "./sidemenu.module.scss";
|
import "./sidemenu.module.scss";
|
||||||
|
|
||||||
const drawerWidth = 320;
|
const drawerWidth = 320;
|
||||||
@@ -42,7 +39,6 @@ const DrawerHeader = styled("div")(({ theme }) => ({
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "flex-end",
|
justifyContent: "flex-end",
|
||||||
padding: theme.spacing(0, 1),
|
padding: theme.spacing(0, 1),
|
||||||
// necessary for content to be below app bar
|
|
||||||
...theme.mixins.toolbar,
|
...theme.mixins.toolbar,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -54,7 +50,6 @@ const MiniDrawer = styled(MuiDrawer, {
|
|||||||
boxSizing: "border-box",
|
boxSizing: "border-box",
|
||||||
backgroundColor: theme.palette.primary.background.dark,
|
backgroundColor: theme.palette.primary.background.dark,
|
||||||
overflowX: "hidden",
|
overflowX: "hidden",
|
||||||
// width: `calc(${theme.spacing(7)} + 10px)`,
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const SideMenu = ({}) => {
|
export const SideMenu = ({}) => {
|
||||||
@@ -62,7 +57,6 @@ export const SideMenu = ({}) => {
|
|||||||
|
|
||||||
const [display, setDisplay] = useState(false);
|
const [display, setDisplay] = useState(false);
|
||||||
|
|
||||||
const backdrop = useSelector((state) => state.sidebar.backdrop);
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
@@ -70,7 +64,7 @@ export const SideMenu = ({}) => {
|
|||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(window.api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
enabled: !!window.api,
|
enabled: display,
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
});
|
});
|
||||||
let libraries = useQuery({
|
let libraries = useQuery({
|
||||||
@@ -85,7 +79,6 @@ export const SideMenu = ({}) => {
|
|||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
});
|
});
|
||||||
const handleDrawerOpen = () => {};
|
const handleDrawerOpen = () => {};
|
||||||
const dispatch = useDispatch();
|
|
||||||
|
|
||||||
const handleLogout = async () => {
|
const handleLogout = async () => {
|
||||||
console.log("Logging out user...");
|
console.log("Logging out user...");
|
||||||
@@ -96,14 +89,12 @@ export const SideMenu = ({}) => {
|
|||||||
navigate("/login");
|
navigate("/login");
|
||||||
};
|
};
|
||||||
|
|
||||||
const getCurrentLocation = () => {
|
|
||||||
return location.pathname.slice(0, location.pathname.lastIndexOf("/"));
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
location.pathname.includes("login") ||
|
location.pathname.includes("login") ||
|
||||||
location.pathname.includes("setup")
|
location.pathname.includes("setup") ||
|
||||||
|
location.pathname.includes("player") ||
|
||||||
|
location.pathname === "/"
|
||||||
) {
|
) {
|
||||||
setDisplay(false);
|
setDisplay(false);
|
||||||
} else {
|
} else {
|
||||||
@@ -131,9 +122,7 @@ export const SideMenu = ({}) => {
|
|||||||
}}
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
width: `calc(${theme.spacing(7)} + 10px)`,
|
width: `calc(${theme.spacing(7)} + 10px)`,
|
||||||
background: backdrop
|
background: theme.palette.background.paper,
|
||||||
? theme.palette.background.paper
|
|
||||||
: "transparent",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DrawerHeader
|
<DrawerHeader
|
||||||
@@ -248,7 +237,7 @@ export const SideMenu = ({}) => {
|
|||||||
"center",
|
"center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<MdiHomeVariantOutline></MdiHomeVariantOutline>
|
<MdiHomeVariantOutline />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
</ListItemButton>
|
</ListItemButton>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
@@ -287,8 +276,3 @@ export const SideMenu = ({}) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// SideMenu.propTypes = {
|
|
||||||
// skeleton: PropTypes.bool.isRequired,
|
|
||||||
// data: PropTypes.array.isRequired,
|
|
||||||
// };
|
|
||||||
@@ -4,7 +4,6 @@ import Card from "@mui/material/Card";
|
|||||||
import CardMedia from "@mui/material/CardMedia";
|
import CardMedia from "@mui/material/CardMedia";
|
||||||
import CardContent from "@mui/material/CardContent";
|
import CardContent from "@mui/material/CardContent";
|
||||||
import Grid from "@mui/material/Unstable_Grid2";
|
import Grid from "@mui/material/Unstable_Grid2";
|
||||||
import Box from "@mui/material/Box";
|
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import Skeleton from "@mui/material/Skeleton";
|
import Skeleton from "@mui/material/Skeleton";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
/** @format */
|
|
||||||
|
|
||||||
export const SplashScreen = () => {
|
|
||||||
return <h1>I am loading...</h1>;
|
|
||||||
};
|
|
||||||
@@ -23,6 +23,7 @@ import { MdiAccountMusic } from "../icons/mdiAccountMusic";
|
|||||||
import { MdiDramaMasks } from "../icons/mdiDramaMasks";
|
import { MdiDramaMasks } from "../icons/mdiDramaMasks";
|
||||||
import { MdiMusic } from "../icons/mdiMusic";
|
import { MdiMusic } from "../icons/mdiMusic";
|
||||||
import { MdiAccountTie } from "../icons/mdiAccountTie";
|
import { MdiAccountTie } from "../icons/mdiAccountTie";
|
||||||
|
import { MdiAccount } from "../icons/mdiAccount";
|
||||||
|
|
||||||
export const MediaCollectionTypeIconCollection = {
|
export const MediaCollectionTypeIconCollection = {
|
||||||
universal: <MdiMultimedia />,
|
universal: <MdiMultimedia />,
|
||||||
@@ -97,6 +98,7 @@ export const TypeIconCollectionCard = {
|
|||||||
Trailer: <MdiYoutube className="card-image-icon" />,
|
Trailer: <MdiYoutube className="card-image-icon" />,
|
||||||
TvChannel: <MdiTelevisionClassic className="card-image-icon" />,
|
TvChannel: <MdiTelevisionClassic className="card-image-icon" />,
|
||||||
TvProgram: <MdiTelevisionClassic className="card-image-icon" />,
|
TvProgram: <MdiTelevisionClassic className="card-image-icon" />,
|
||||||
|
User: <MdiAccount className="card-image-icon" />,
|
||||||
UserRootFolder: <MdiFolderOutline className="card-image-icon" />,
|
UserRootFolder: <MdiFolderOutline className="card-image-icon" />,
|
||||||
UserView: <MdiMultimedia className="card-image-icon" />,
|
UserView: <MdiMultimedia className="card-image-icon" />,
|
||||||
Video: <MdiFilmstrip className="card-image-icon" />,
|
Video: <MdiFilmstrip className="card-image-icon" />,
|
||||||
|
|||||||
+8
-7
@@ -11,19 +11,20 @@ import App from "./App";
|
|||||||
|
|
||||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||||
|
|
||||||
import store from "./store";
|
const queryClient = new QueryClient({
|
||||||
import { Provider } from "react-redux";
|
defaultOptions: {
|
||||||
|
queries: {
|
||||||
const queryClient = new QueryClient();
|
networkMode: "always",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById("root")).render(
|
ReactDOM.createRoot(document.getElementById("root")).render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient} option>
|
||||||
<Provider store={store}>
|
|
||||||
<Router>
|
<Router>
|
||||||
<App />
|
<App />
|
||||||
</Router>
|
</Router>
|
||||||
</Provider>
|
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
</React.StrictMode>,
|
</React.StrictMode>,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -48,15 +48,15 @@
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
mask-image: linear-gradient(
|
mask-image: linear-gradient(
|
||||||
to right,
|
to right,
|
||||||
transparent 10%,
|
transparent 2%,
|
||||||
rgba(0, 0, 0, 0.5) 50%,
|
rgba(0, 0, 0, 0.5) 20%,
|
||||||
black 90%
|
black 70%
|
||||||
);
|
);
|
||||||
-webkit-mask-image: linear-gradient(
|
-webkit-mask-image: linear-gradient(
|
||||||
to right,
|
to right,
|
||||||
transparent 10%,
|
transparent 2%,
|
||||||
rgba(0, 0, 0, 0.5) 50%,
|
rgba(0, 0, 0, 0.5) 20%,
|
||||||
black 90%
|
black 70%
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
&-icon {
|
&-icon {
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
&-logo {
|
&-logo {
|
||||||
max-width: 6em;
|
max-width: 10em;
|
||||||
height: 2em;
|
height: 2em;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
object-position: bottom;
|
object-position: bottom;
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
height: 70vh;
|
height: 70vh;
|
||||||
width: 70%;
|
width: 70%;
|
||||||
padding: 0 2em 2em 2em;
|
padding: 2em;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|||||||
+79
-33
@@ -19,6 +19,7 @@ import Paper from "@mui/material/Paper";
|
|||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import Chip from "@mui/material/Chip";
|
import Chip from "@mui/material/Chip";
|
||||||
import Divider from "@mui/material/Divider";
|
import Divider from "@mui/material/Divider";
|
||||||
|
import Stack from "@mui/material/Stack";
|
||||||
|
|
||||||
import { yellow } from "@mui/material/colors";
|
import { yellow } from "@mui/material/colors";
|
||||||
|
|
||||||
@@ -33,7 +34,7 @@ import { CardsSkeleton } from "../../components/skeleton/cards";
|
|||||||
|
|
||||||
// Icons
|
// Icons
|
||||||
import { MediaTypeIconCollection } from "../../components/utils/iconsCollection.jsx";
|
import { MediaTypeIconCollection } from "../../components/utils/iconsCollection.jsx";
|
||||||
import { MdiStarHalfFull } from "../../components/icons/mdiStarHalfFull";
|
import { MdiStar } from "../../components/icons/mdiStar";
|
||||||
import { MdiPlayOutline } from "../../components/icons/mdiPlayOutline";
|
import { MdiPlayOutline } from "../../components/icons/mdiPlayOutline";
|
||||||
import { MdiChevronRight } from "../../components/icons/mdiChevronRight";
|
import { MdiChevronRight } from "../../components/icons/mdiChevronRight";
|
||||||
|
|
||||||
@@ -45,7 +46,8 @@ import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
|||||||
|
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
import { getRuntime } from "../../utils/date/time";
|
import { endsAt, getRuntime } from "../../utils/date/time";
|
||||||
|
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
|
||||||
const Home = () => {
|
const Home = () => {
|
||||||
const authUser = useQuery({
|
const authUser = useQuery({
|
||||||
@@ -93,7 +95,7 @@ const Home = () => {
|
|||||||
const media = await getUserLibraryApi(window.api).getLatestMedia(
|
const media = await getUserLibraryApi(window.api).getLatestMedia(
|
||||||
{
|
{
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
fields: "Overview",
|
fields: [ItemFields.Overview, ItemFields.ParentId],
|
||||||
enableUserData: true,
|
enableUserData: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -251,9 +253,50 @@ const Home = () => {
|
|||||||
key={index}
|
key={index}
|
||||||
>
|
>
|
||||||
<div className="hero-carousel-background-container">
|
<div className="hero-carousel-background-container">
|
||||||
{item.ImageBlurHashes
|
{item.Type ==
|
||||||
|
BaseItemKind.MusicAlbum ||
|
||||||
|
item.Type ==
|
||||||
|
BaseItemKind.Episode ? (
|
||||||
|
item
|
||||||
|
.ParentBackdropImageTags
|
||||||
|
.length != 0 && (
|
||||||
|
<>
|
||||||
|
<Blurhash
|
||||||
|
hash={
|
||||||
|
item
|
||||||
|
.ImageBlurHashes
|
||||||
|
.Backdrop[
|
||||||
|
item
|
||||||
|
.ParentBackdropImageTags[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
// hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
|
||||||
|
width="1080"
|
||||||
|
height="720"
|
||||||
|
resolutionX={
|
||||||
|
64
|
||||||
|
}
|
||||||
|
resolutionY={
|
||||||
|
96
|
||||||
|
}
|
||||||
|
className="hero-carousel-background-blurhash"
|
||||||
|
punch={1}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className="hero-carousel-background-image"
|
||||||
|
style={{
|
||||||
|
backgroundImage: `url(${window.api.basePath}/Items/${item.ParentBackdropItemId}/Images/Backdrop)`,
|
||||||
|
}}
|
||||||
|
></div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
) : item.ImageBlurHashes
|
||||||
.Backdrop ? (
|
.Backdrop ? (
|
||||||
<>
|
<>
|
||||||
|
{item
|
||||||
|
.BackdropImageTags
|
||||||
|
.length !=
|
||||||
|
0 && (
|
||||||
<Blurhash
|
<Blurhash
|
||||||
hash={
|
hash={
|
||||||
item
|
item
|
||||||
@@ -273,7 +316,9 @@ const Home = () => {
|
|||||||
96
|
96
|
||||||
}
|
}
|
||||||
className="hero-carousel-background-blurhash"
|
className="hero-carousel-background-blurhash"
|
||||||
|
punch={1}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
<div
|
<div
|
||||||
className="hero-carousel-background-image"
|
className="hero-carousel-background-image"
|
||||||
style={{
|
style={{
|
||||||
@@ -325,15 +370,25 @@ const Home = () => {
|
|||||||
></img>
|
></img>
|
||||||
)}
|
)}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Box
|
<Stack
|
||||||
sx={{
|
// sx={{
|
||||||
display: "flex",
|
// display: "flex",
|
||||||
alignItems:
|
// alignItems:
|
||||||
"center",
|
// "center",
|
||||||
width: "fit-content",
|
// width: "fit-content",
|
||||||
gap: "1em",
|
// gap: "1em",
|
||||||
mb: 1.5,
|
// mb: 1.5,
|
||||||
}}
|
// }}
|
||||||
|
direction="row"
|
||||||
|
gap={1}
|
||||||
|
divider={
|
||||||
|
<Divider
|
||||||
|
variant="middle"
|
||||||
|
component="div"
|
||||||
|
orientation="vertical"
|
||||||
|
flexItem
|
||||||
|
/>
|
||||||
|
}
|
||||||
className="hero-carousel-info"
|
className="hero-carousel-info"
|
||||||
>
|
>
|
||||||
<Typography
|
<Typography
|
||||||
@@ -344,12 +399,6 @@ const Home = () => {
|
|||||||
? item.ProductionYear
|
? item.ProductionYear
|
||||||
: "Unknown"}
|
: "Unknown"}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Divider
|
|
||||||
variant="middle"
|
|
||||||
component="div"
|
|
||||||
orientation="vertical"
|
|
||||||
flexItem
|
|
||||||
/>
|
|
||||||
<Chip
|
<Chip
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
label={
|
label={
|
||||||
@@ -358,12 +407,6 @@ const Home = () => {
|
|||||||
: "Not Rated"
|
: "Not Rated"
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Divider
|
|
||||||
variant="middle"
|
|
||||||
component="div"
|
|
||||||
orientation="vertical"
|
|
||||||
flexItem
|
|
||||||
/>
|
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@@ -375,7 +418,7 @@ const Home = () => {
|
|||||||
>
|
>
|
||||||
{!!item.CommunityRating ? (
|
{!!item.CommunityRating ? (
|
||||||
<>
|
<>
|
||||||
<MdiStarHalfFull
|
<MdiStar
|
||||||
sx={{
|
sx={{
|
||||||
color: yellow[700],
|
color: yellow[700],
|
||||||
}}
|
}}
|
||||||
@@ -396,18 +439,21 @@ const Home = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
<Divider
|
{!!item.RunTimeTicks && (
|
||||||
variant="middle"
|
|
||||||
component="div"
|
|
||||||
orientation="vertical"
|
|
||||||
flexItem
|
|
||||||
/>
|
|
||||||
<Typography variant="subtitle1">
|
<Typography variant="subtitle1">
|
||||||
{getRuntime(
|
{getRuntime(
|
||||||
item.RunTimeTicks,
|
item.RunTimeTicks,
|
||||||
)}
|
)}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
)}
|
||||||
|
{!!item.RunTimeTicks && (
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
{endsAt(
|
||||||
|
item.RunTimeTicks,
|
||||||
|
)}
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
<Typography
|
<Typography
|
||||||
variant="subtitle1"
|
variant="subtitle1"
|
||||||
className="hero-carousel-text"
|
className="hero-carousel-text"
|
||||||
|
|||||||
+1061
-99
File diff suppressed because it is too large.
Load diff
@@ -23,13 +23,13 @@
|
|||||||
&-backdrop {
|
&-backdrop {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 135%;
|
height: 80vh;
|
||||||
top: -88px;
|
top: -88px;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
right: 0;
|
right: 0;
|
||||||
left: -24px;
|
left: -24px;
|
||||||
z-index: -2;
|
z-index: -2;
|
||||||
filter: brightness(0.7);
|
filter: brightness(0.6);
|
||||||
mask-image: linear-gradient(0deg, transparent, black 75%);
|
mask-image: linear-gradient(0deg, transparent, black 75%);
|
||||||
-webkit-mask-image: linear-gradient(
|
-webkit-mask-image: linear-gradient(
|
||||||
0deg,
|
0deg,
|
||||||
@@ -52,10 +52,13 @@
|
|||||||
width: 15%;
|
width: 15%;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
aspect-ratio: 0.666;
|
|
||||||
border-radius: $border-radius-default;
|
border-radius: $border-radius-default;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
box-shadow: 0 0 15px rgb(0 0 0 / 0.4);
|
box-shadow: 0 0 15px rgb(0 0 0 / 0.4);
|
||||||
|
&.Episode {
|
||||||
|
flex-shrink: 0;
|
||||||
|
flex-grow: 0.25;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&-icon-container {
|
&-icon-container {
|
||||||
background: $clr-gradient-dark;
|
background: $clr-gradient-dark;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { motion } from "framer-motion";
|
||||||
import { useParams, useNavigate, Link } from "react-router-dom";
|
import { useParams, useNavigate, Link } from "react-router-dom";
|
||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
@@ -30,7 +30,6 @@ import TableRow from "@mui/material/TableRow";
|
|||||||
import TableCell from "@mui/material/TableCell";
|
import TableCell from "@mui/material/TableCell";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import Pagination from "@mui/material/Pagination";
|
import Pagination from "@mui/material/Pagination";
|
||||||
import ButtonBase from "@mui/material/ButtonBase";
|
|
||||||
|
|
||||||
import { theme } from "../../theme";
|
import { theme } from "../../theme";
|
||||||
|
|
||||||
@@ -386,7 +385,8 @@ const LibraryView = () => {
|
|||||||
queryFn: () => fetchLibItems(id),
|
queryFn: () => fetchLibItems(id),
|
||||||
enabled: currentLib.isSuccess,
|
enabled: currentLib.isSuccess,
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
keepPreviousData: true,
|
keepPreviousData: false,
|
||||||
|
cacheTime: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleCurrentViewType = (e) => {
|
const handleCurrentViewType = (e) => {
|
||||||
@@ -396,7 +396,6 @@ const LibraryView = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (viewType.length != 0) {
|
if (viewType.length != 0) {
|
||||||
setCurrentViewType(viewType[0].value);
|
setCurrentViewType(viewType[0].value);
|
||||||
console.log(viewType);
|
|
||||||
}
|
}
|
||||||
}, [viewType]);
|
}, [viewType]);
|
||||||
|
|
||||||
@@ -441,6 +440,14 @@ const LibraryView = () => {
|
|||||||
items.refetch();
|
items.refetch();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const disablePaginationViews = [
|
||||||
|
"MusicArtist",
|
||||||
|
"Person",
|
||||||
|
"Genre",
|
||||||
|
"MusicGenre",
|
||||||
|
"Studio",
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@@ -462,8 +469,8 @@ const LibraryView = () => {
|
|||||||
position="fixed"
|
position="fixed"
|
||||||
elevation={trigger ? 1 : 0}
|
elevation={trigger ? 1 : 0}
|
||||||
sx={{
|
sx={{
|
||||||
width: `calc(100vw - ${theme.spacing(7)})`,
|
width: `calc(100vw - ${theme.spacing(7)} - 10px)`,
|
||||||
mt: 8,
|
top: `${8 * 8}px !important`,
|
||||||
backdropFilter: trigger ? `blur(30px)` : "none",
|
backdropFilter: trigger ? `blur(30px)` : "none",
|
||||||
background: "transparent",
|
background: "transparent",
|
||||||
backgroundColor: trigger
|
backgroundColor: trigger
|
||||||
@@ -927,6 +934,20 @@ const LibraryView = () => {
|
|||||||
xs={1}
|
xs={1}
|
||||||
sm={1}
|
sm={1}
|
||||||
md={1}
|
md={1}
|
||||||
|
component={motion.div}
|
||||||
|
initial={{
|
||||||
|
scale: 0.8,
|
||||||
|
opacity: 0,
|
||||||
|
}}
|
||||||
|
animate={{
|
||||||
|
scale: 1,
|
||||||
|
opacity: 1,
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 0.25,
|
||||||
|
ease: "easeInOut",
|
||||||
|
delay: 0.02 * index,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Card
|
<Card
|
||||||
itemName={item.Name}
|
itemName={item.Name}
|
||||||
@@ -934,7 +955,13 @@ const LibraryView = () => {
|
|||||||
imageTags={
|
imageTags={
|
||||||
!!item.ImageTags.Primary
|
!!item.ImageTags.Primary
|
||||||
}
|
}
|
||||||
subText={item.ProductionYear}
|
subText={
|
||||||
|
item.Type.includes(
|
||||||
|
"Music",
|
||||||
|
)
|
||||||
|
? item.AlbumArtist
|
||||||
|
: item.ProductionYear
|
||||||
|
}
|
||||||
iconType={item.Type}
|
iconType={item.Type}
|
||||||
playedPercent={
|
playedPercent={
|
||||||
!!item.UserData
|
!!item.UserData
|
||||||
@@ -960,9 +987,8 @@ const LibraryView = () => {
|
|||||||
: false
|
: false
|
||||||
}
|
}
|
||||||
watchedCount={
|
watchedCount={
|
||||||
!!item.UserData &&
|
|
||||||
item.UserData
|
item.UserData
|
||||||
.UnplayedItemCount
|
?.UnplayedItemCount
|
||||||
}
|
}
|
||||||
blurhash={
|
blurhash={
|
||||||
item.ImageBlurHashes ==
|
item.ImageBlurHashes ==
|
||||||
@@ -984,6 +1010,9 @@ const LibraryView = () => {
|
|||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
currentUser={user.data}
|
currentUser={user.data}
|
||||||
|
favourite={
|
||||||
|
item.UserData?.IsFavorite
|
||||||
|
}
|
||||||
></Card>
|
></Card>
|
||||||
</Grid2>
|
</Grid2>
|
||||||
);
|
);
|
||||||
@@ -996,7 +1025,8 @@ const LibraryView = () => {
|
|||||||
{items.data.Items.map((item, index) => {
|
{items.data.Items.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
<TableRow
|
<TableRow
|
||||||
key={index}
|
component={motion.div}
|
||||||
|
key={item.Id}
|
||||||
sx={{
|
sx={{
|
||||||
"& td,& th": {
|
"& td,& th": {
|
||||||
borderBottom:
|
borderBottom:
|
||||||
@@ -1009,6 +1039,19 @@ const LibraryView = () => {
|
|||||||
"rgb(255 255 255 / 0.05)",
|
"rgb(255 255 255 / 0.05)",
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
initial={{
|
||||||
|
scale: 0.8,
|
||||||
|
opacity: 0,
|
||||||
|
}}
|
||||||
|
animate={{
|
||||||
|
scale: 1,
|
||||||
|
opacity: 1,
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 0.25,
|
||||||
|
ease: "easeInOut",
|
||||||
|
delay: 0.02 * index,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<TableCell width="4.5em">
|
<TableCell width="4.5em">
|
||||||
<Box className="library-list-image-container">
|
<Box className="library-list-image-container">
|
||||||
@@ -1098,8 +1141,9 @@ const LibraryView = () => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{!items.isFetching &&
|
{!items.isFetching &&
|
||||||
|
!disablePaginationViews.includes(currentViewType) &&
|
||||||
items.isSuccess &&
|
items.isSuccess &&
|
||||||
items.data.TotalRecordCount > 75 && (
|
items.data.TotalRecordCount > maxDisplayItems && (
|
||||||
<Stack
|
<Stack
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
justifyContent="center"
|
justifyContent="center"
|
||||||
|
|||||||
+11
-25
@@ -1,14 +1,10 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
import { useState, useEffect, useMemo } from "react";
|
import { useState } from "react";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { useNavigate, useParams, Link } from "react-router-dom";
|
import { useNavigate, useParams, Link } from "react-router-dom";
|
||||||
import { EventEmitter as event } from "../../eventEmitter.js";
|
import { EventEmitter as event } from "../../eventEmitter.js";
|
||||||
|
|
||||||
import { useDispatch } from "react-redux";
|
|
||||||
import { showSidemenu } from "../../utils/slice/sidemenu.js";
|
|
||||||
|
|
||||||
import { getServer } from "../../utils/storage/servers.js";
|
|
||||||
import { saveUser } from "../../utils/storage/user.js";
|
import { saveUser } from "../../utils/storage/user.js";
|
||||||
|
|
||||||
// import Icon from "mdi-material-ui";
|
// import Icon from "mdi-material-ui";
|
||||||
@@ -26,8 +22,6 @@ import InputLabel from "@mui/material/InputLabel";
|
|||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import LoadingButton from "@mui/lab/LoadingButton";
|
import LoadingButton from "@mui/lab/LoadingButton";
|
||||||
import Button from "@mui/material/Button";
|
import Button from "@mui/material/Button";
|
||||||
import Box from "@mui/material/Box";
|
|
||||||
import CircularProgress from "@mui/material/CircularProgress";
|
|
||||||
import LinearProgress from "@mui/material/LinearProgress";
|
import LinearProgress from "@mui/material/LinearProgress";
|
||||||
import { useSnackbar } from "notistack";
|
import { useSnackbar } from "notistack";
|
||||||
import FormGroup from "@mui/material/FormGroup";
|
import FormGroup from "@mui/material/FormGroup";
|
||||||
@@ -35,21 +29,16 @@ import FormControlLabel from "@mui/material/FormControlLabel";
|
|||||||
import Checkbox from "@mui/material/Checkbox";
|
import Checkbox from "@mui/material/Checkbox";
|
||||||
|
|
||||||
import { AvatarImage } from "../../components/avatar/avatar.jsx";
|
import { AvatarImage } from "../../components/avatar/avatar.jsx";
|
||||||
import { CardScroller } from "../../components/cardScroller/cardScroller.jsx";
|
|
||||||
import { Card } from "../../components/card/card.jsx";
|
import { Card } from "../../components/card/card.jsx";
|
||||||
import { AppBarBackOnly } from "../../components/appBar/backOnly.jsx";
|
import { AppBarBackOnly } from "../../components/appBar/backOnly.jsx";
|
||||||
|
|
||||||
// import { jellyfin } from "../../jellyfin";
|
|
||||||
// import getSystemApi from "@jellyfin/sdk";
|
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
import { getBrandingApi } from "@jellyfin/sdk/lib/utils/api/branding-api";
|
import { getBrandingApi } from "@jellyfin/sdk/lib/utils/api/branding-api";
|
||||||
|
|
||||||
import "./login.module.scss";
|
import "./login.module.scss";
|
||||||
import { CardsSkeleton } from "../../components/skeleton/cards.jsx";
|
|
||||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice.jsx";
|
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice.jsx";
|
||||||
|
|
||||||
export const LoginWithImage = () => {
|
export const LoginWithImage = () => {
|
||||||
const dispatch = useDispatch();
|
|
||||||
const { userName, userId } = useParams();
|
const { userName, userId } = useParams();
|
||||||
|
|
||||||
const [password, setPassword] = useState({
|
const [password, setPassword] = useState({
|
||||||
@@ -99,7 +88,6 @@ export const LoginWithImage = () => {
|
|||||||
}
|
}
|
||||||
event.emit("set-api-accessToken", window.api.basePath);
|
event.emit("set-api-accessToken", window.api.basePath);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
dispatch(showSidemenu());
|
|
||||||
navigate(`/home`);
|
navigate(`/home`);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -159,7 +147,7 @@ export const LoginWithImage = () => {
|
|||||||
{userName}
|
{userName}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item minWidth="100%">
|
<Grid minWidth="100%">
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<FormControl variant="outlined" fullWidth>
|
<FormControl variant="outlined" fullWidth>
|
||||||
<InputLabel htmlFor="user-password">
|
<InputLabel htmlFor="user-password">
|
||||||
@@ -208,7 +196,7 @@ export const LoginWithImage = () => {
|
|||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item minWidth="100%">
|
<Grid minWidth="100%">
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
variant="contained"
|
variant="contained"
|
||||||
endIcon={<MdiChevronRight />}
|
endIcon={<MdiChevronRight />}
|
||||||
@@ -241,9 +229,7 @@ export const UserLogin = () => {
|
|||||||
queryKey: ["login", "users"],
|
queryKey: ["login", "users"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const users = await getUserApi(window.api).getPublicUsers();
|
const users = await getUserApi(window.api).getPublicUsers();
|
||||||
console.log(users.data);
|
|
||||||
return users.data;
|
return users.data;
|
||||||
// return {};
|
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
});
|
});
|
||||||
@@ -301,8 +287,8 @@ export const UserLogin = () => {
|
|||||||
imageTags={
|
imageTags={
|
||||||
!!item.PrimaryImageTag
|
!!item.PrimaryImageTag
|
||||||
}
|
}
|
||||||
// cardType="sqaure"
|
disableOverlay
|
||||||
iconType="Person"
|
iconType="User"
|
||||||
cardOrientation="sqaure"
|
cardOrientation="sqaure"
|
||||||
onClickEvent={() =>
|
onClickEvent={() =>
|
||||||
navigate(
|
navigate(
|
||||||
@@ -345,7 +331,6 @@ export const UserLoginManual = () => {
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [rememberMe, setRememberMe] = useState(true);
|
const [rememberMe, setRememberMe] = useState(true);
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { enqueueSnackbar } = useSnackbar();
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
|
|
||||||
@@ -439,14 +424,15 @@ export const UserLoginManual = () => {
|
|||||||
sx={{
|
sx={{
|
||||||
opacity: server.isLoading ? 0 : 1,
|
opacity: server.isLoading ? 0 : 1,
|
||||||
transition: "opacity 200ms",
|
transition: "opacity 200ms",
|
||||||
|
width: "100%",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Grid item xl={5} md={6} sx={{ marginBottom: "1em" }}>
|
<Grid sx={{ marginBottom: "1em" }}>
|
||||||
<Typography variant="h3" color="textPrimary">
|
<Typography variant="h3" color="textPrimary">
|
||||||
Login
|
Login
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid sx={{ width: "100%" }} item xl={5} md={6}>
|
<Grid sx={{ width: "100%" }}>
|
||||||
<FormControl
|
<FormControl
|
||||||
sx={{ width: "100%" }}
|
sx={{ width: "100%" }}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
@@ -464,7 +450,7 @@ export const UserLoginManual = () => {
|
|||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid sx={{ width: "100%" }} item xl={5} md={6}>
|
<Grid sx={{ width: "100%" }}>
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<FormControl
|
<FormControl
|
||||||
sx={{ width: "100%" }}
|
sx={{ width: "100%" }}
|
||||||
@@ -517,7 +503,7 @@ export const UserLoginManual = () => {
|
|||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xl={5} md={6} sx={{ width: "100%" }}>
|
<Grid sx={{ width: "100%" }}>
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
variant="contained"
|
variant="contained"
|
||||||
endIcon={<MdiChevronRight />}
|
endIcon={<MdiChevronRight />}
|
||||||
@@ -530,7 +516,7 @@ export const UserLoginManual = () => {
|
|||||||
Login
|
Login
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xl={15} md={6} sx={{ width: "100%" }}>
|
<Grid sx={{ width: "100%" }}>
|
||||||
<Typography variant="subtitle2">
|
<Typography variant="subtitle2">
|
||||||
{server.isSuccess &&
|
{server.isSuccess &&
|
||||||
server.data.LoginDisclaimer}
|
server.data.LoginDisclaimer}
|
||||||
|
|||||||
@@ -0,0 +1,180 @@
|
|||||||
|
/** @format */
|
||||||
|
import { appWindow } from "@tauri-apps/api/window";
|
||||||
|
|
||||||
|
import AppBar from "@mui/material/AppBar";
|
||||||
|
import Toolbar from "@mui/material/Toolbar";
|
||||||
|
import Box from "@mui/material/Box";
|
||||||
|
import Stack from "@mui/material/Stack";
|
||||||
|
import IconButton from "@mui/material/IconButton";
|
||||||
|
import Typography from "@mui/material/Typography";
|
||||||
|
import Slider from "@mui/material/Slider";
|
||||||
|
|
||||||
|
import ReactPlayer from "react-player";
|
||||||
|
|
||||||
|
import { usePlaybackStore } from "../../utils/store/playback";
|
||||||
|
import { MdiArrowLeft } from "../../components/icons/mdiArrowLeft";
|
||||||
|
import { MdiPlay } from "../../components/icons/mdiPlay";
|
||||||
|
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { useRef, useState, useCallback } from "react";
|
||||||
|
import { secToTicks, ticksToSec } from "../../utils/date/time";
|
||||||
|
|
||||||
|
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||||
|
|
||||||
|
import "./videoPlayer.module.scss";
|
||||||
|
import { MdiPause } from "../../components/icons/mdiPause";
|
||||||
|
import { MdiFastForward } from "../../components/icons/mdiFastForward";
|
||||||
|
import { MdiRewind } from "../../components/icons/mdiRewind";
|
||||||
|
|
||||||
|
export const VideoPlayer = () => {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const playerRef = useRef();
|
||||||
|
const [isPlaying, setIsPlaying] = useState(true);
|
||||||
|
const [isMuted, setIsMuted] = useState(false);
|
||||||
|
const [isReady, setIsReady] = useState(false);
|
||||||
|
|
||||||
|
const [duration, setDuration] = useState(0);
|
||||||
|
const [progress, setProgress] = useState(0);
|
||||||
|
const [currentTime, setCurrentTime] = useState(0);
|
||||||
|
|
||||||
|
const onReady = useCallback(() => {
|
||||||
|
if (!isReady) {
|
||||||
|
const timeToStart = ticksToSec(startPosition);
|
||||||
|
playerRef.current.seekTo(timeToStart, "seconds");
|
||||||
|
setDuration(playerRef.current.getDuration());
|
||||||
|
setIsReady(true);
|
||||||
|
}
|
||||||
|
}, [isReady]);
|
||||||
|
|
||||||
|
const startTime = new Date(0);
|
||||||
|
|
||||||
|
const onProgress = async (e) => {
|
||||||
|
await getPlaystateApi(window.api).reportPlaybackProgress({
|
||||||
|
playbackProgressInfo: {
|
||||||
|
ItemId: itemId,
|
||||||
|
IsMuted: isMuted,
|
||||||
|
PositionTicks: secToTicks(e.playedSeconds),
|
||||||
|
PlaybackStartTimeTicks: startPosition,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSeeking = useCallback((time, offset) => {
|
||||||
|
playerRef.current.seekTo(time / 100);
|
||||||
|
setCurrentTime(time / 100);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const [url, startPosition, itemId, itemName] = usePlaybackStore(
|
||||||
|
(state) => [
|
||||||
|
state.url,
|
||||||
|
state.startPosition,
|
||||||
|
state.itemId,
|
||||||
|
state.itemName,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
let timer;
|
||||||
|
return (
|
||||||
|
<Box
|
||||||
|
className="video"
|
||||||
|
sx={{ background: "black" }}
|
||||||
|
onMouseMove={(e) => {
|
||||||
|
let a = "he";
|
||||||
|
clearTimeout(timer);
|
||||||
|
e.currentTarget.classList.add("video-osd-visible");
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
document
|
||||||
|
.querySelector(".video")
|
||||||
|
.classList.remove("video-osd-visible");
|
||||||
|
}, 2000);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Stack
|
||||||
|
className="video-osd"
|
||||||
|
sx={{
|
||||||
|
position: "fixed",
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
bottom: 0,
|
||||||
|
}}
|
||||||
|
alignItems="center"
|
||||||
|
justifyContent="space-between"
|
||||||
|
direction="column"
|
||||||
|
zIndex="10000000"
|
||||||
|
>
|
||||||
|
<AppBar
|
||||||
|
position="static"
|
||||||
|
elevation={0}
|
||||||
|
sx={{
|
||||||
|
background:
|
||||||
|
"linear-gradient(to bottom, rgb(0 0 0 / 0.75), transparent)",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Toolbar>
|
||||||
|
<IconButton onClick={() => navigate(-1)}>
|
||||||
|
<MdiArrowLeft />
|
||||||
|
</IconButton>
|
||||||
|
<Typography ml={2} variant="h6">
|
||||||
|
{itemName}
|
||||||
|
</Typography>
|
||||||
|
</Toolbar>
|
||||||
|
</AppBar>
|
||||||
|
<Stack direction="column" padding={2} width="100%">
|
||||||
|
<Stack width="100%">
|
||||||
|
<Slider
|
||||||
|
value={currentTime}
|
||||||
|
step={0.01}
|
||||||
|
max={100}
|
||||||
|
onChange={(e, newVal) => {
|
||||||
|
playerRef.current.seekTo(
|
||||||
|
(newVal / 100) *
|
||||||
|
playerRef.current.getDuration(),
|
||||||
|
);
|
||||||
|
setCurrentTime(newVal);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
<Stack direction="row">
|
||||||
|
<IconButton
|
||||||
|
onClick={() =>
|
||||||
|
playerRef.current.seekTo(
|
||||||
|
playerRef.current.getCurrentTime() -
|
||||||
|
15,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<MdiRewind />
|
||||||
|
</IconButton>
|
||||||
|
<IconButton
|
||||||
|
onClick={() => setIsPlaying(!isPlaying)}
|
||||||
|
>
|
||||||
|
{isPlaying ? <MdiPause /> : <MdiPlay />}
|
||||||
|
</IconButton>
|
||||||
|
<IconButton
|
||||||
|
onClick={() =>
|
||||||
|
playerRef.current.seekTo(
|
||||||
|
playerRef.current.getCurrentTime() +
|
||||||
|
15,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<MdiFastForward />
|
||||||
|
</IconButton>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
<ReactPlayer
|
||||||
|
ref={playerRef}
|
||||||
|
width="100vw"
|
||||||
|
height="100vh"
|
||||||
|
playing={isPlaying}
|
||||||
|
url={url}
|
||||||
|
onProgress={onProgress}
|
||||||
|
onReady={onReady}
|
||||||
|
muted={isMuted}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
.video {
|
||||||
|
&-osd {
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.1s linear;
|
||||||
|
}
|
||||||
|
&-osd-visible &-osd {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
import axios from "axios";
|
||||||
|
|
||||||
import { EventEmitter as event } from "../../../eventEmitter.js";
|
import { EventEmitter as event } from "../../../eventEmitter.js";
|
||||||
import { setServer } from "../../../utils/storage/servers.js";
|
import { setServer } from "../../../utils/storage/servers.js";
|
||||||
@@ -21,11 +21,17 @@ import { mdiChevronRight } from "@mdi/js";
|
|||||||
|
|
||||||
import { useSnackbar } from "notistack";
|
import { useSnackbar } from "notistack";
|
||||||
|
|
||||||
// Svgs
|
import {
|
||||||
import { ReactComponent as JellyplayerLogo } from "../../../assets/logo.svg";
|
Jellyfin,
|
||||||
|
VersionOutdatedIssue,
|
||||||
|
VersionUnsupportedIssue,
|
||||||
|
} from "@jellyfin/sdk";
|
||||||
|
import { version as appVer } from "../../../../package.json";
|
||||||
|
import { v4 as uuidv4 } from "uuid";
|
||||||
|
|
||||||
// SCSS
|
// SCSS
|
||||||
import "./server.module.scss";
|
import "./server.module.scss";
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
export const ServerList = () => {
|
export const ServerList = () => {
|
||||||
const [renderServerList, setRenderServerList] = useState(false);
|
const [renderServerList, setRenderServerList] = useState(false);
|
||||||
@@ -122,6 +128,17 @@ export const ServerList = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const ServerSetup = (props) => {
|
export const ServerSetup = (props) => {
|
||||||
|
const sdk = new Jellyfin({
|
||||||
|
clientInfo: {
|
||||||
|
name: "JellyPlayer",
|
||||||
|
version: appVer,
|
||||||
|
},
|
||||||
|
deviceInfo: {
|
||||||
|
name: "JellyPlayer",
|
||||||
|
id: uuidv4(),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const [serverIp, setServerIp] = useState("");
|
const [serverIp, setServerIp] = useState("");
|
||||||
const [checkingServer, setServerCheckState] = useState(false);
|
const [checkingServer, setServerCheckState] = useState(false);
|
||||||
|
|
||||||
@@ -131,15 +148,7 @@ export const ServerSetup = (props) => {
|
|||||||
|
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
const usersAvailable = async () => {
|
const usersAvailable = async () => {};
|
||||||
const users = await getUserApi(window.api).getPublicUsers();
|
|
||||||
if (users.data.length >= 1) {
|
|
||||||
console.log("Users => ", users.data);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const addServer = async () => {
|
const addServer = async () => {
|
||||||
event.emit("create-jellyfin-api", serverIp);
|
event.emit("create-jellyfin-api", serverIp);
|
||||||
let sysInfo = await getSystemApi(window.api).getPublicSystemInfo();
|
let sysInfo = await getSystemApi(window.api).getPublicSystemInfo();
|
||||||
@@ -148,57 +157,75 @@ export const ServerSetup = (props) => {
|
|||||||
// Set Server Config to Tauri store
|
// Set Server Config to Tauri store
|
||||||
sysInfo.Ip = serverIp;
|
sysInfo.Ip = serverIp;
|
||||||
setServer(sysInfo);
|
setServer(sysInfo);
|
||||||
|
};
|
||||||
const usersAvailablity = await usersAvailable();
|
const checkServer = async () => {
|
||||||
if (usersAvailablity == true) {
|
setServerCheckState(true);
|
||||||
console.log(usersAvailablity);
|
try {
|
||||||
|
const result = await axios.get(`${serverIp}/System/Ping`);
|
||||||
|
if (result.data == "Jellyfin Server") {
|
||||||
|
event.emit("create-jellyfin-api", serverIp);
|
||||||
|
let sysInfo = await getSystemApi(
|
||||||
|
window.api,
|
||||||
|
).getPublicSystemInfo();
|
||||||
|
sysInfo = sysInfo.data;
|
||||||
|
sysInfo.Ip = serverIp;
|
||||||
|
setServer(sysInfo);
|
||||||
|
const users = await getUserApi(window.api).getPublicUsers();
|
||||||
|
if (users.data.length >= 1) {
|
||||||
navigate("/login/users");
|
navigate("/login/users");
|
||||||
} else {
|
} else {
|
||||||
navigate("/login/manual");
|
navigate("/login/manual");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
enqueueSnackbar(
|
||||||
|
"The provided ip address doesn't seem point to a Jellyfin server.",
|
||||||
|
{ variant: "error" },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
enqueueSnackbar("Unable to verfiy server address.", {
|
||||||
|
variant: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
setServerCheckState(false);
|
||||||
|
return "";
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAddServer = () => {
|
const handleAddServer = () => {
|
||||||
setLoading(true);
|
// setLoading(true);
|
||||||
let data;
|
// let data;
|
||||||
fetch(`${serverIp}/System/Ping`, {
|
// fetch(`${serverIp}/System/Ping`, {
|
||||||
body: JSON.stringify(data),
|
// body: JSON.stringify(data),
|
||||||
})
|
// })
|
||||||
.then((res) => res.json())
|
// .then((res) => res.json())
|
||||||
.then((data) => {
|
// .then((data) => {
|
||||||
if (data == "Jellyfin Server") {
|
// if (data == "Jellyfin Server") {
|
||||||
addServer();
|
// addServer();
|
||||||
setLoading(false);
|
// setLoading(false);
|
||||||
return true;
|
// return true;
|
||||||
} else {
|
// } else {
|
||||||
enqueueSnackbar(
|
// enqueueSnackbar(
|
||||||
"The server address does not seem be a jellyfin server",
|
// "The server address does not seem be a jellyfin server",
|
||||||
{ variant: "error" },
|
// { variant: "error" },
|
||||||
);
|
// );
|
||||||
setLoading(false);
|
// setLoading(false);
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
.catch((error) => {
|
// .catch((error) => {
|
||||||
setLoading(false);
|
// setLoading(false);
|
||||||
enqueueSnackbar(
|
// enqueueSnackbar(
|
||||||
"Unable to verify whether the give address is a valid Jellyfin server",
|
// "Unable to verify whether the give address is a valid Jellyfin server",
|
||||||
{ variant: "error" },
|
// { variant: "error" },
|
||||||
);
|
// );
|
||||||
console.error(error);
|
// console.error(error);
|
||||||
});
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Container
|
<Container maxWidth="sm" className={"centered serverContainer"}>
|
||||||
maxWidth="sm"
|
|
||||||
className={
|
|
||||||
checkingServer
|
|
||||||
? "centered serverContainer loading"
|
|
||||||
: "centered serverContainer"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Grid
|
<Grid
|
||||||
container
|
container
|
||||||
spacing={2}
|
spacing={2}
|
||||||
@@ -216,22 +243,9 @@ export const ServerSetup = (props) => {
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
// inputRef={serverIp}
|
// inputRef={serverIp}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
if (
|
|
||||||
event.target.value.charAt(
|
|
||||||
event.target.value.length - 1,
|
|
||||||
) == "/"
|
|
||||||
) {
|
|
||||||
setServerIp(
|
|
||||||
event.target.value.slice(
|
|
||||||
0,
|
|
||||||
-1,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
setServerIp(event.target.value);
|
setServerIp(event.target.value);
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
helperText="Add your server adddress with https:// or http://"
|
helperText="Add your server adddress with https:// or http://. Eg: https://demo.jellyfin.org"
|
||||||
></TextField>
|
></TextField>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xl={5} md={6} sx={{ width: "100%" }}>
|
<Grid item xl={5} md={6} sx={{ width: "100%" }}>
|
||||||
@@ -239,14 +253,14 @@ export const ServerSetup = (props) => {
|
|||||||
variant="contained"
|
variant="contained"
|
||||||
sx={{ width: "100%" }}
|
sx={{ width: "100%" }}
|
||||||
size="large"
|
size="large"
|
||||||
loading={loading}
|
loading={checkingServer}
|
||||||
endIcon={
|
endIcon={
|
||||||
<SvgIcon>
|
<SvgIcon>
|
||||||
<path d={mdiChevronRight}></path>
|
<path d={mdiChevronRight}></path>
|
||||||
</SvgIcon>
|
</SvgIcon>
|
||||||
}
|
}
|
||||||
loadingPosition="end"
|
loadingPosition="end"
|
||||||
onClick={handleAddServer}
|
onClick={() => checkServer()}
|
||||||
>
|
>
|
||||||
Add Server
|
Add Server
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
/** @format */
|
|
||||||
|
|
||||||
import { configureStore } from "@reduxjs/toolkit";
|
|
||||||
import sideBarReducer from "./utils/slice/sidemenu";
|
|
||||||
export default configureStore({
|
|
||||||
reducer: {
|
|
||||||
sidebar: sideBarReducer,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
@@ -46,13 +46,9 @@ body {
|
|||||||
height: fit-content;
|
height: fit-content;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow-y: visible;
|
overflow-y: hidden;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
// display: flex;
|
|
||||||
// flex-direction: column;
|
|
||||||
// justify-content: center;
|
|
||||||
// align-items: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.centered {
|
.centered {
|
||||||
|
|||||||
+18
-1
@@ -3,11 +3,28 @@
|
|||||||
* @param {number} ticks - C# ticks of a particular item
|
* @param {number} ticks - C# ticks of a particular item
|
||||||
* @return {number} Converted ticks to Milliseconds
|
* @return {number} Converted ticks to Milliseconds
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ticksToMs = (ticks) => {
|
const ticksToMs = (ticks) => {
|
||||||
return Math.round(ticks / 10000);
|
return Math.round(ticks / 10000);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @format
|
||||||
|
* @param {number} ticks - C# ticks of a particular item
|
||||||
|
* @return {number} Converted ticks to Seconds
|
||||||
|
*/
|
||||||
|
export const ticksToSec = (ticks) => {
|
||||||
|
return Math.round(ticksToMs(ticks) / 1000);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @format
|
||||||
|
* @param {number} sec - Sec of a particular item
|
||||||
|
* @return {number} Converted Seconds to C# ticks
|
||||||
|
*/
|
||||||
|
export const secToTicks = (ticks) => {
|
||||||
|
return Math.round(ticks * 10000000);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @format
|
* @format
|
||||||
* @param {number} ticks - C# ticks of a particular item
|
* @param {number} ticks - C# ticks of a particular item
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
/** @format */
|
|
||||||
|
|
||||||
import { createSlice } from "@reduxjs/toolkit";
|
|
||||||
export const sideBarSlice = createSlice({
|
|
||||||
name: "sidebar",
|
|
||||||
initialState: {
|
|
||||||
visible: false,
|
|
||||||
backdrop: true,
|
|
||||||
},
|
|
||||||
reducers: {
|
|
||||||
showSidemenu: (state) => {
|
|
||||||
state.visible = true;
|
|
||||||
},
|
|
||||||
hideSidemenu: (state) => {
|
|
||||||
state.visible = false;
|
|
||||||
},
|
|
||||||
setBackdrop: (state, action) => {
|
|
||||||
state.backdrop = action.payload;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const { showSidemenu, hideSidemenu, setBackdrop } = sideBarSlice.actions;
|
|
||||||
export default sideBarSlice.reducer;
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
import { create } from "zustand";
|
||||||
|
|
||||||
|
export const usePlaybackStore = create((set) => ({
|
||||||
|
url: "",
|
||||||
|
startPosition: 0,
|
||||||
|
itemId: "",
|
||||||
|
itemName: "",
|
||||||
|
setUrl: (aurl) => set((state) => ({ ...state, url: aurl })),
|
||||||
|
setPosition: (apos) => set((state) => ({ ...state, startPosition: apos })),
|
||||||
|
setItemId: (aid) => set((state) => ({ ...state, itemId: aid })),
|
||||||
|
setItemName: (anm) => set((state) => ({ ...state, itemName: anm })),
|
||||||
|
}));
|
||||||
Reference in new issue
Block a user