Compare commits

...
22 changed files with 1034 additions and 581 deletions

No files matched your search

+1 -1
View File
@@ -41,7 +41,7 @@ jobs:
- name: Install app dependencies and build web
# Remove `&& yarn build` if you build your frontend in `beforeBuildCommand`
run: npm install && npm build # Change this to npm, yarn or pnpm.
run: npm install && npm run build # Change this to npm, yarn or pnpm.
- name: Build the app
uses: tauri-apps/tauri-action@v0
+326 -333
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "jellyplayer",
"private": true,
"version": "0.0.0",
"version": "1.0.0-alpha0",
"type": "module",
"scripts": {
"dev": "vite",
File renamed without changes.

Before

Width:  |  Height:  |  Size: 289 KiB

After

Width:  |  Height:  |  Size: 289 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

+57
View File
@@ -0,0 +1,57 @@
<svg width="1197" height="247" viewBox="0 0 1197 247" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g clip-path="url(#clip0_504_8)">
<path d="M169.982 114.384C171.569 115.293 172.888 116.605 173.805 118.187C174.722 119.769 175.205 121.566 175.205 123.395C175.205 125.224 174.722 127.021 173.805 128.603C172.888 130.185 171.569 131.497 169.982 132.406L87.6225 180.207C80.8918 184.117 71.6631 179.65 71.6631 171.196V123.395V75.5942C71.6631 67.1397 80.8918 62.673 87.6225 66.583L128.802 90.4834L169.982 114.384Z" fill="url(#pattern0)"/>
<g filter="url(#filter0_d_504_8)">
<path d="M71.6631 123.395V171.196C71.6631 179.65 80.8918 184.117 87.6225 180.207L169.982 132.406C171.569 131.497 172.888 130.185 173.805 128.603C174.722 127.021 175.205 125.224 175.205 123.395C175.205 121.566 174.722 119.769 173.805 118.187C172.888 116.605 171.569 115.293 169.982 114.384L128.802 90.4834M71.6631 123.395V75.5942C71.6631 67.1397 80.8918 62.673 87.6225 66.583L128.802 90.4834M71.6631 123.395L128.802 90.4834" stroke="white" stroke-width="10" shape-rendering="crispEdges"/>
</g>
<g clip-path="url(#clip1_504_8)">
<path d="M268.49 132.788C263.093 132.788 258.076 131.572 253.438 129.139C248.801 126.63 245 123.209 242.035 118.876C239.071 114.543 237.322 109.754 236.79 104.509H241.009C241.541 108.994 243.1 113.099 245.684 116.824C248.269 120.473 251.538 123.362 255.491 125.49C259.52 127.543 263.853 128.569 268.49 128.569C273.584 128.569 278.259 127.315 282.516 124.806C286.773 122.297 290.156 118.838 292.665 114.429C295.173 110.02 296.428 105.079 296.428 99.6052V55.9316H260.85V51.7125H300.533V99.6052C300.533 105.839 299.089 111.502 296.2 116.596C293.387 121.613 289.51 125.566 284.569 128.455C279.703 131.344 274.344 132.788 268.49 132.788Z" fill="white"/>
<path d="M326.901 51.7125H382.775V55.9316H331.12V88.0881H376.048V92.3073H331.12V126.858H382.775V131.078H326.901V51.7125Z" fill="white"/>
<path d="M414.16 131.078V51.7125H418.38V126.858H473.684V131.078H414.16Z" fill="white"/>
<path d="M498.569 131.078V51.7125H502.789V126.858H558.093V131.078H498.569Z" fill="white"/>
<path d="M579.444 51.7125L607.609 94.1318L635.546 51.7125H640.564L609.662 98.5789V131.078H605.442V98.5789L574.426 51.7125H579.444Z" fill="white"/>
<path d="M669.782 131.078H665.563V51.7125H697.492C702.813 51.7125 707.716 52.8528 712.201 55.1334C716.763 57.414 720.374 60.6448 723.034 64.826C725.695 69.0071 727.025 73.8344 727.025 79.3078C727.025 84.5532 725.657 89.3805 722.92 93.7897C720.26 98.1988 716.611 101.582 711.973 103.938C707.944 105.991 703.117 107.017 697.492 107.017H669.782V131.078ZM669.782 102.798H697.492C702.357 102.798 706.348 102.038 709.465 100.517C713.494 98.6169 716.725 95.7662 719.157 91.9652C721.59 88.1642 722.806 83.945 722.806 79.3078C722.806 74.7466 721.59 70.5655 719.157 66.7645C716.725 62.9635 713.456 60.1127 709.351 58.2122C706.234 56.6918 702.281 55.9316 697.492 55.9316H669.782V102.798Z" fill="white"/>
<path d="M751.797 131.078V51.7125H756.016V126.858H811.32V131.078H751.797Z" fill="white"/>
<path d="M898.124 131.078H823.32L860.722 50.002L898.124 131.078Z" fill="url(#paint0_linear_504_8)"/>
<path d="M917.08 51.7125L945.245 94.1318L973.183 51.7125H978.2L947.298 98.5789V131.078H943.079V98.5789L912.062 51.7125H917.08Z" fill="white"/>
<path d="M1002.17 51.7125H1058.05V55.9316H1006.39V88.0881H1051.32V92.3073H1006.39V126.858H1058.05V131.078H1002.17V51.7125Z" fill="white"/>
<path d="M1131.17 54.3352C1135.73 56.4637 1139.3 59.6186 1141.89 63.7997C1144.55 67.9808 1145.88 72.618 1145.88 77.7114C1145.88 83.641 1144.05 88.9624 1140.4 93.6756C1136.83 98.3129 1131.24 102.013 1125.62 103.534L1085.78 51.7125H1116C1119.35 51.7125 1122.2 51.9405 1124.55 52.3966C1126.99 52.7767 1129.19 53.4229 1131.17 54.3352Z" fill="url(#paint1_linear_504_8)"/>
<path d="M1146.79 131.078L1125.62 103.534H1085.78V131.078H1146.79Z" fill="url(#paint2_linear_504_8)"/>
<path d="M256.77 180.696H242.154L238.95 187.788H236.97L248.562 162.588H250.398L261.99 187.788H260.01L256.77 180.696ZM256.086 179.148L249.462 164.604L242.874 179.148H256.086ZM303.243 187.788L303.207 166.224L292.659 184.44H291.759L281.211 166.296V187.788H279.411V162.588H280.959L292.227 182.064L303.495 162.588H305.007L305.043 187.788H303.243ZM326.321 187.968C323.849 187.968 321.617 187.416 319.625 186.312C317.633 185.184 316.061 183.648 314.909 181.704C313.781 179.76 313.217 177.588 313.217 175.188C313.217 172.788 313.781 170.616 314.909 168.672C316.061 166.728 317.633 165.204 319.625 164.1C321.617 162.972 323.849 162.408 326.321 162.408C328.793 162.408 331.025 162.96 333.017 164.064C335.009 165.168 336.569 166.692 337.697 168.636C338.849 170.58 339.425 172.764 339.425 175.188C339.425 177.612 338.849 179.796 337.697 181.74C336.569 183.684 335.009 185.208 333.017 186.312C331.025 187.416 328.793 187.968 326.321 187.968ZM326.321 186.276C328.433 186.276 330.341 185.796 332.045 184.836C333.749 183.876 335.093 182.556 336.077 180.876C337.061 179.172 337.553 177.276 337.553 175.188C337.553 173.1 337.061 171.216 336.077 169.536C335.093 167.832 333.749 166.5 332.045 165.54C330.341 164.58 328.433 164.1 326.321 164.1C324.209 164.1 322.289 164.58 320.561 165.54C318.857 166.5 317.513 167.832 316.529 169.536C315.545 171.216 315.053 173.1 315.053 175.188C315.053 177.276 315.545 179.172 316.529 180.876C317.513 182.556 318.857 183.876 320.561 184.836C322.289 185.796 324.209 186.276 326.321 186.276ZM347.593 162.588H357.565C360.181 162.588 362.497 163.128 364.513 164.208C366.553 165.288 368.137 166.788 369.265 168.708C370.393 170.604 370.957 172.764 370.957 175.188C370.957 177.612 370.393 179.784 369.265 181.704C368.137 183.6 366.553 185.088 364.513 186.168C362.497 187.248 360.181 187.788 357.565 187.788H347.593V162.588ZM357.421 186.132C359.749 186.132 361.801 185.676 363.577 184.764C365.353 183.828 366.721 182.532 367.681 180.876C368.641 179.22 369.121 177.324 369.121 175.188C369.121 173.052 368.641 171.156 367.681 169.5C366.721 167.844 365.353 166.56 363.577 165.648C361.801 164.712 359.749 164.244 357.421 164.244H349.429V186.132H357.421ZM396.523 186.132V187.788H379.135V162.588H395.983V164.244H380.971V174.18H394.399V175.8H380.971V186.132H396.523ZM422.513 187.788L416.501 179.364C415.613 179.484 414.797 179.544 414.053 179.544H406.853V187.788H405.017V162.588H414.053C417.221 162.588 419.705 163.344 421.505 164.856C423.305 166.344 424.205 168.42 424.205 171.084C424.205 173.076 423.689 174.756 422.657 176.124C421.649 177.468 420.197 178.416 418.301 178.968L424.601 187.788H422.513ZM414.053 177.924C416.741 177.924 418.793 177.336 420.209 176.16C421.625 174.96 422.333 173.268 422.333 171.084C422.333 168.9 421.625 167.22 420.209 166.044C418.793 164.844 416.741 164.244 414.053 164.244H406.853V177.924H414.053ZM453.247 162.588V187.788H451.735L434.563 165.9V187.788H432.727V162.588H434.275L451.411 184.476V162.588H453.247ZM477.162 187.968C475.794 187.968 474.51 187.656 473.31 187.032C472.134 186.384 471.186 185.496 470.466 184.368L471.582 183.144C472.278 184.176 473.094 184.968 474.03 185.52C474.99 186.048 476.034 186.312 477.162 186.312C478.842 186.312 480.09 185.832 480.906 184.872C481.746 183.888 482.166 182.388 482.166 180.372V164.244H472.878V162.588H484.002V180.372C484.002 182.892 483.426 184.788 482.274 186.06C481.122 187.332 479.418 187.968 477.162 187.968ZM511.765 186.132V187.788H494.377V162.588H511.225V164.244H496.213V174.18H509.641V175.8H496.213V186.132H511.765ZM520.259 162.588H522.095V186.132H536.603V187.788H520.259V162.588ZM543.118 162.588H544.954V186.132H559.462V187.788H543.118V162.588ZM571.081 179.112V187.788H569.245V179.112L559.093 162.588H561.109L570.217 177.42L579.325 162.588H581.233L571.081 179.112ZM588.843 164.244V175.008H602.271V176.664H588.843V187.788H587.007V162.588H603.855V164.244H588.843ZM611.518 162.588H613.354V187.788H611.518V162.588ZM644.455 162.588V187.788H642.943L625.771 165.9V187.788H623.935V162.588H625.483L642.619 184.476V162.588H644.455ZM676.758 187.968C674.286 187.968 672.054 187.416 670.062 186.312C668.094 185.208 666.534 183.684 665.382 181.74C664.254 179.796 663.69 177.612 663.69 175.188C663.69 172.764 664.254 170.58 665.382 168.636C666.534 166.692 668.094 165.168 670.062 164.064C672.054 162.96 674.286 162.408 676.758 162.408C678.582 162.408 680.262 162.708 681.798 163.308C683.334 163.884 684.642 164.748 685.722 165.9L684.57 167.088C682.554 165.096 679.974 164.1 676.83 164.1C674.718 164.1 672.798 164.58 671.07 165.54C669.342 166.5 667.986 167.832 667.002 169.536C666.018 171.216 665.526 173.1 665.526 175.188C665.526 177.276 666.018 179.172 667.002 180.876C667.986 182.556 669.342 183.876 671.07 184.836C672.798 185.796 674.718 186.276 676.83 186.276C679.95 186.276 682.53 185.268 684.57 183.252L685.722 184.44C684.642 185.592 683.322 186.468 681.762 187.068C680.226 187.668 678.558 187.968 676.758 187.968ZM693.671 162.588H695.507V186.132H710.015V187.788H693.671V162.588ZM716.53 162.588H718.366V187.788H716.53V162.Line truncated
</g>
</g>
<defs>
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlink:href="#image0_504_8" transform="matrix(0 -0.000244141 0.000274658 0 -0.0625001 1)"/>
</pattern>
<filter id="filter0_d_504_8" x="-21.3369" y="-25.8237" width="293.542" height="306.437" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dx="2" dy="4"/>
<feGaussianBlur stdDeviation="45"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_504_8"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_504_8" result="shape"/>
</filter>
<linearGradient id="paint0_linear_504_8" x1="879.722" y1="91.7373" x2="824.111" y2="130.497" gradientUnits="userSpaceOnUse">
<stop stop-color="#FB2576"/>
<stop offset="1" stop-color="#150050"/>
</linearGradient>
<linearGradient id="paint1_linear_504_8" x1="1138.4" y1="59.7188" x2="1086.16" y2="130.497" gradientUnits="userSpaceOnUse">
<stop stop-color="#FB2576"/>
<stop offset="1" stop-color="#150050"/>
</linearGradient>
<linearGradient id="paint2_linear_504_8" x1="1138.4" y1="59.7188" x2="1086.16" y2="130.497" gradientUnits="userSpaceOnUse">
<stop stop-color="#FB2576"/>
<stop offset="1" stop-color="#150050"/>
</linearGradient>
<clipPath id="clip0_504_8">
<rect width="1196.79" height="246.79" fill="white"/>
</clipPath>
<clipPath id="clip1_504_8">
<rect width="910" height="146.786" fill="white" transform="translate(236.79 50.002)"/>
</clipPath>
<image id="image0_504_8" width="4096" height="4096" xlink:href="data:image/png;base64,iVBORw0KG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s+cH066eZ3TqmruOO9bTv2Zk8x3EzNx4Drc817crvw711gFurYDhw9qcbsQYRu+sxB/iV4i6/reT10ymkOef3lswNEqyVGcw+LjlkcVnucXs5j+DjX6a+9eZvuGAoEtswFA76Kx/iRPDWL/95a3GwCcH5HbuY7w0JO6snuvcyNn46LwMSa5OULDK31dfvoZrw40Nr0Y/ZlhdhMAZwOAU/PsA7GI/l7w/+tOjNqA4Obp2Vyg8XYu+L82BThZ+8+9QcA/PSMeZ7a+vJzJfLeftZz10ae4lOucSXndWV6+rS9bTxaz4vKuIRm7rVGNUdeLxJzWor8BwEWEN6ZlUdmLXnYuu0BaPcSOd0kcCz4boP4ldQZL5tfHOUaY+fX4iG4JKu522vIuZJV/VIeJzw5Y79Lv45JjZNSqYom4tNgZzr0+YfWRGkYxonJVD4yjVfON6+c9Xc2FqK68umRld8uv1B/Cg52AMzMomutoDdquQ/Wy3otymeVn1h4zp2Z9MP2P+GDsZdft1XPenF61ic7kqu6yGkLPvRHfim+kNhD+0evrbPxMbnZgyXCuYmFsM7JMLLine truncated
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.9 MiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 393 KiB

After

Width:  |  Height:  |  Size: 393 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

+102
View File
@@ -0,0 +1,102 @@
<!-- @format -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<main>
<img src="./assetsStatic/LogoBig.png" alt="" srcset="">
</main>
<div class="loading">
<div class="indicator"></div>
</div>
<div class="background"></div>
<style>
html,
body {
overflow: hidden;
height: 100vh;
width: 100vw;
margin: 0;
padding: 0;
background: black;
}
.background {
position: fixed;
z-index: 0;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: calc(100vw + 5em);
height: calc(100vh + 5em);
background-image: url("./assetsStatic/meshbackground.png");
background-size: cover;
filter: brightness(0.3);
}
main {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 1;
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
img {
width: 100%;
object-fit: contain;
}
.loading {
position: fixed;
bottom: 0;
left: 0;
width: 100vw;
background: hsla(255, 100%, 4%, 0.5);
z-index: 1;
height: 14px;
overflow: hidden;
}
.indicator {
background: hsl(337, 96%, 56%);
width: 100%;
height: 100%;
/* transform: scaleX(0.5); */
transform-origin: left;
animation: loading 1s infinite;
}
@keyframes loading {
0% {
transform: scaleX(0) translateX(-100%);
transform-origin: left;
}
100% {
transform: scaleX(1) translateX(100%);
transform-origin: left;
}
/* 100% {
transform: scaleX(0) translateX(-100%);
transform-origin: left;
} */
}
</style>
</body>
</html>
+7 -7
View File
@@ -1,11 +1,11 @@
[package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
default-run = "app"
name = "jellyplayer"
version = "1.0.0"
description = "A Modern Jellyfin Client"
authors = ["prayag17", "JellyPlayer contributors (https://github.com/prayag17/JellyPlayer/graphs/contributors)"]
license = "GPL-3.0-only"
repository = "https://github.com/prayag17/JellyPlayer/"
default-run = "jellyplayer"
edition = "2021"
rust-version = "1.59"
+14
View File
@@ -3,8 +3,22 @@
windows_subsystem = "windows"
)]
use tauri::Manager;
// Create the command:
// This command must be async so that it doesn't run on the main thread.
#[tauri::command]
async fn close_splashscreen(window: tauri::Window) {
// Close splashscreen
if let Some(splashscreen) = window.get_window("splashscreen") {
splashscreen.close().unwrap();
}
// Show main window
window.get_window("main").unwrap().show().unwrap();
}
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![close_splashscreen])
.plugin(tauri_plugin_store::Builder::default().build())
.run(tauri::generate_context!())
.expect("error while running tauri application");
+13 -2
View File
@@ -8,7 +8,7 @@
},
"package": {
"productName": "JellyPlayer",
"version": "0.1.0"
"version": "../package.json"
},
"tauri": {
"allowlist": {
@@ -57,9 +57,20 @@
{
"fullscreen": false,
"height": 600,
"width": 800,
"resizable": true,
"title": "JellyPlayer",
"width": 800
"visible": false,
"center": true
},
{
"width": 800,
"height": 300,
"center": true,
"decorations": false,
"resizable": false,
"url": "splash.html",
"label": "splashscreen"
}
]
}
+178 -72
View File
@@ -1,6 +1,6 @@
/** @format */
import { useState, useEffect, useContext } from "react";
import { useState, useMemo } from "react";
import { ThemeProvider } from "@mui/material/styles";
import { SnackbarProvider } from "notistack";
import { useCookies, Cookies } from "react-cookie";
@@ -16,6 +16,8 @@ import { AnimatePresence, motion } from "framer-motion";
import { EventEmitter as event } from "./eventEmitter.js";
import { relaunch } from "@tauri-apps/api/process";
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
// Theming
@@ -23,6 +25,16 @@ import CssBaseline from "@mui/material/CssBaseline";
import { theme } from "./theme";
import "./styles/global.scss";
// MUI
import Dialog from "@mui/material/Dialog";
import DialogActions from "@mui/material/DialogActions";
import DialogContent from "@mui/material/DialogContent";
import DialogContentText from "@mui/material/DialogContentText";
import DialogTitle from "@mui/material/DialogTitle";
import Button from "@mui/material/Button";
import Box from "@mui/material/Box";
import CircularProgress from "@mui/material/CircularProgress";
// Routes
import { ServerSetup, ServerList } from "./routes/setup/server/root";
import { Home } from "./routes/home/root";
@@ -39,6 +51,8 @@ import "@fontsource/open-sans";
import { Jellyfin } from "@jellyfin/sdk";
import { version as appVer } from "../package.json";
import { v4 as uuidv4 } from "uuid";
import { delServer, getServer } from "./utils/store/servers.js";
import { getUser } from "./utils/store/user.js";
const jellyfin = new Jellyfin({
clientInfo: {
@@ -98,77 +112,177 @@ const AnimationWrapper = () => {
);
};
function App({ hideLoader }) {
function App() {
const [userCookies] = useCookies(["user"]);
const navigate = useNavigate();
const cookies = new Cookies();
const serverAvailable = () => {
try {
const currentServer = cookies.get("currentServer");
const serverList = cookies.get("servers");
let currentServerIp = "";
serverList.map((item, index) => {
currentServerIp = item[currentServer];
});
const [serverReachable, setServerReachable] = useState(true);
const [checkingServer, setChecking] = useState(false);
if (currentServer == undefined) {
return false;
} else {
if (!window.api) {
event.emit(
"create-jellyfin-api",
currentServerIp.serverAddress,
);
}
return true;
}
} catch (error) {
const serverAvailable = async () => {
const server = await getServer();
if (server == null) {
console.log("server not found");
return false;
}
};
const userSaved = () => {
try {
userCookies.user[0];
return true;
} catch (error) {
return false;
}
};
const userAvailable = async () => {
const users = await getUserApi(window.api).getPublicUsers();
try {
if (users.data.length >= 1) {
return true;
} else {
return false;
}
} catch (error) {
return false;
}
};
const HandleLoginRoutes = () => {
if (userSaved()) {
navigate("/home");
} else {
userAvailable().then((res) => {
if (res) {
navigate("/login/users");
} else if (!res) {
navigate("/login/manual");
}
});
if (!window.api) {
console.log("Creating Jf api (without accessToken)");
event.emit("create-jellyfin-api", server.Ip);
}
return true;
}
};
const usersAvailable = async () => {
const users = await getUserApi(window.api).getPublicUsers();
if (users.data.length >= 1) {
return true;
} else {
return false;
}
};
const userSaved = async () => {
const user = await getUser();
console.log("User store => ", user);
if (user == null) {
return false;
} else {
return true;
}
};
const pingServer = () => {
setChecking(true);
let data;
fetch(`${window.api.basePath}/System/Ping`, {
body: JSON.stringify(data),
})
.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" },
);
setServerReachable(false);
setChecking(false);
}
})
.catch((error) => {
setServerReachable(false);
console.error(error);
setChecking(false);
});
};
const userLogin = async () => {
const user = await getUser();
const auth = await api.authenticateUserByName(
user.Name,
user.Password,
);
sessionStorage.setItem("accessToken", auth.data.AccessToken);
event.emit("set-api-accessToken", window.api.basePath);
navigate("/home");
};
const LogicalRoutes = () => {
serverAvailable().then(async (server) => {
if (server == true) {
pingServer();
if (serverReachable == true) {
userSaved().then((user_available) => {
if (user_available == true) {
userLogin();
} else {
usersAvailable().then(
(users_list_available) => {
if (users_list_available == true) {
navigate("/login/users");
} else {
navigate("/login/manual");
}
},
);
}
});
}
} else {
navigate("/setup/server");
setChecking(false);
}
});
};
const LoginLogicalRoutes = () => {
usersAvailable().then((users_list_available) => {
if (users_list_available == true) {
navigate("/login/users");
} else {
navigate("/login/manual");
}
});
};
const handleRelaunch = async () => {
await relaunch();
};
const handleRemoveServer = async () => {
await delServer();
};
const location = useLocation();
return (
<SnackbarProvider maxSnack={5}>
<ThemeProvider theme={theme}>
{checkingServer && (
<Box
sx={{
display: "flex",
width: "100%",
height: "100%",
justifyContent: "center",
alignItems: "center",
}}
>
<CircularProgress />
</Box>
)}
{/* Show Dialog if server not reachable */}
<Dialog
open={!serverReachable}
onClose={handleRelaunch}
aria-labelledby="alert-dialog-text"
aria-describedby="alert-dialog-desc"
maxWidth="md"
sx={{
padding: "1em",
}}
>
<DialogTitle id="alert-dialog-text">
Unable to reach server
</DialogTitle>
<DialogContent>
<DialogContentText id="alert-dialog-desc">
Unable to connect to the jellyfin server.
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={handleRemoveServer}>
Remove Server
</Button>
<Button onClick={handleRelaunch}>
Restart JellyPlayer
</Button>
</DialogActions>
</Dialog>
<AnimatePresence>
<CssBaseline />
<Routes key={location.pathname} location={location}>
@@ -199,23 +313,15 @@ function App({ hideLoader }) {
/>
{/* Logical Routes */}
<Route
exact
path="/login"
element={
<HandleLoginRoutes></HandleLoginRoutes>
}
/>
<Route
path="/"
element={
serverAvailable() ? (
<Navigate to="/login" />
) : (
<Navigate to="/setup/server" />
)
}
element={<LogicalRoutes />}
/>
<Route
exact
path="/login"
element={<LoginLogicalRoutes />}
/>
</Route>
</Routes>
+1 -1
View File
@@ -10,7 +10,7 @@ import "./avatar.module.scss";
export const AvatarCard = ({ userName, userId, userImageAvailable }) => {
return (
<ButtonBase className="card square">
<ButtonBase className="card square" sx={{ borderRadius: "10px" }}>
<div className="card-image-container">
{userImageAvailable ? (
<div
+2
View File
@@ -12,11 +12,13 @@
flex-direction: column;
gap: 0.5em;
margin-bottom: 0.5em;
overflow: hidden;
.card-image {
position: absolute;
inset: 0;
&-container {
font-size: 5em;
z-index: 0;
}
&-icon {
font-size: 1.5em !important;
+8
View File
@@ -6,6 +6,8 @@ import ReactDOM from "react-dom/client";
import { BrowserRouter as Router } from "react-router-dom";
import { CookiesProvider } from "react-cookie";
import { invoke } from "@tauri-apps/api/tauri";
import App from "./App";
ReactDOM.createRoot(document.getElementById("root")).render(
@@ -17,3 +19,9 @@ ReactDOM.createRoot(document.getElementById("root")).render(
</CookiesProvider>
</React.StrictMode>,
);
document.addEventListener("DOMContentLoaded", () => {
// This will wait for the window to load, but you could
// run this function on whatever trigger you want
invoke("close_splashscreen");
});
+86 -55
View File
@@ -1,7 +1,10 @@
/** @format */
import { useState, useEffect } from "react";
import { Cookies } from "react-cookie";
import { EventEmitter as event } from "../../eventEmitter";
import { getServer } from "../../utils/store/servers";
import { getUser } from "../../utils/store/user";
import { theme } from "../../theme";
import "./home.module.scss";
@@ -23,6 +26,7 @@ import Divider from "@mui/material/Divider";
import Paper from "@mui/material/Paper";
import Typography from "@mui/material/Typography";
import useScrollTrigger from "@mui/material/useScrollTrigger";
import Tooltip from "@mui/material/Tooltip";
import Carousel from "react-material-ui-carousel";
@@ -41,6 +45,7 @@ import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
import { useNavigate } from "react-router-dom";
const drawerWidth = 320;
@@ -61,7 +66,7 @@ const MiniDrawer = styled(MuiDrawer, {
boxSizing: "border-box",
backgroundColor: theme.palette.primary.background.dark,
overflowX: "hidden",
width: `calc(${theme.spacing(7)} + 1px)`,
width: `calc(${theme.spacing(7)} + 10px)`,
}));
const AppBar = styled(MuiAppBar, {
@@ -86,12 +91,12 @@ export const Home = () => {
Name: "",
});
const navigate = useNavigate();
const excludeTypes = ["boxsets", "playlists", "livetv", "channels"];
const [latestMedia, setLatestMedia] = useState([]);
const [drawerState, setDrawerState] = useState(false);
const cookies = new Cookies();
const scrollTrigger = useScrollTrigger({ threshold: 5 });
@@ -105,6 +110,7 @@ export const Home = () => {
const handleLogout = async () => {
await window.api.logout();
navigate("/login");
console.log("logged out user");
};
@@ -134,18 +140,48 @@ export const Home = () => {
return userviews;
};
const authUser = async () => {
const server = await getServer();
const user = await getUser();
event.emit("create-jellyfin-api", server.Ip);
const auth = await api.authenticateUserByName(
user.Name,
user.Password,
);
sessionStorage.setItem("accessToken", auth.data.AccessToken);
event.emit("set-api-accessToken", window.api.basePath);
};
useEffect(() => {
currentUser().then((usr) => {
setUser(usr.data);
userLibs().then((libs) => {
setUserLibraries(libs.data.Items);
setSkeletonStateSideMenu(true);
// TODO Implement a better way to check and create api object when page reloaded. Hint: Maybe use session api or something (*route - home*)
if (!window.api) {
authUser().then(() => {
currentUser().then((usr) => {
setUser(usr.data);
userLibs().then((libs) => {
setUserLibraries(libs.data.Items);
setSkeletonStateSideMenu(true);
});
getLatestMedia(usr.data).then((media) => {
console.log("Using this");
setLatestMedia(media.data);
setSkeletonStateCarousel(true);
});
});
});
getLatestMedia(usr.data).then((media) => {
setLatestMedia(media.data);
setSkeletonStateCarousel(true);
} else {
currentUser().then((usr) => {
setUser(usr.data);
userLibs().then((libs) => {
setUserLibraries(libs.data.Items);
setSkeletonStateSideMenu(true);
});
getLatestMedia(usr.data).then((media) => {
setLatestMedia(media.data);
setSkeletonStateCarousel(true);
});
});
});
}
}, []);
return (
@@ -184,12 +220,13 @@ export const Home = () => {
sx: {
backgroundColor: "inherit",
border: "none",
width: `calc(${theme.spacing(7)} + 10px)`,
},
}}
>
<DrawerHeader
className="Mui-DrawerHeader"
sx={{ position: "relative", height: "20vh" }}
sx={{ position: "relative" }}
>
{/* <div>
<Avatar src={""}/>
@@ -214,60 +251,54 @@ export const Home = () => {
<List sx={{ border: "none" }}>
{userLibraries.map((library, index) => {
return (
<ListItem
disablePadding
<Tooltip
title={library.Name}
placement="right"
arrow
followCursor
key={index}
>
<ListItemButton
sx={{
minHeight: 48,
justifyContent:
drawerState
? "initial"
: "center",
px: 2.5,
}}
>
<ListItemIcon
<ListItem disablePadding>
<ListItemButton
sx={{
minWidth: 0,
mr: drawerState
? 3
: "auto",
minHeight: 48,
justifyContent:
"center",
drawerState
? "initial"
: "center",
px: 2.5,
}}
>
{
MediaCollectionTypeIconCollection[
library
.CollectionType
]
}
</ListItemIcon>
</ListItemButton>
</ListItem>
<ListItemIcon
sx={{
minWidth: 0,
mr: drawerState
? 3
: "auto",
justifyContent:
"center",
}}
>
{
MediaCollectionTypeIconCollection[
library
.CollectionType
]
}
</ListItemIcon>
</ListItemButton>
</ListItem>
</Tooltip>
);
})}
</List>
) : (
<>
<Skeleton
height={50}
variant="rectangular"
animation="wave"
></Skeleton>
<br />
<Skeleton
height={50}
variant="rectangular"
animation="wave"
></Skeleton>
<br />
<Skeleton
height={50}
variant="rectangular"
animation="wave"
height="100%"
variant="rounded"
width="calc(100% - 10px )"
sx={{ margin: "5px" }}
></Skeleton>
</>
)}
+2
View File
@@ -7,9 +7,11 @@
width: min(60vw, 45em);
}
&Card {
border-radius: $border-radius-default;
display: flex;
flex-flow: column;
flex: 1 1 0px;
overflow: hidden;
}
&Icon {
font-size: 5em;
+151 -77
View File
@@ -1,10 +1,12 @@
/** @format */
import { useState, useEffect } from "react";
import { useState, useEffect, useMemo } from "react";
import { Cookies, useCookies } from "react-cookie";
import { useNavigate, useParams, Link } from "react-router-dom";
import { EventEmitter as event } from "../../eventEmitter.js";
import { motion } from "framer-motion";
import { getServer } from "../../utils/store/servers.js";
import { saveUser } from "../../utils/store/user.js";
// import Icon from "mdi-material-ui";
import { MdiEyeOffOutline } from "../../components/icons/mdiEyeOffOutline";
@@ -22,6 +24,9 @@ import IconButton from "@mui/material/IconButton";
import LoadingButton from "@mui/lab/LoadingButton";
import Button from "@mui/material/Button";
import { useSnackbar } from "notistack";
import FormGroup from "@mui/material/FormGroup";
import FormControlLabel from "@mui/material/FormControlLabel";
import Checkbox from "@mui/material/Checkbox";
import { AvatarCard, AvatarImage } from "../../components/avatar/avatar.jsx";
import { AppBarBackOnly } from "../../components/appBar/backOnly.jsx";
@@ -34,11 +39,15 @@ import "./login.module.scss";
export const LoginWithImage = () => {
const { userName, userId } = useParams();
const [password, setPassword] = useState({
showpass: false,
});
const [loading, setLoading] = useState(false);
const [rememberMe, setRememberMe] = useState(true);
const navigate = useNavigate();
const { enqueueSnackbar } = useSnackbar();
const handlePassword = (prop) => (event) => {
@@ -73,12 +82,19 @@ export const LoginWithImage = () => {
setLoading(true);
const user = await authUser();
sessionStorage.setItem("accessToken", user.data.AccessToken);
if (rememberMe == true) {
saveUser(userName, password.password);
}
event.emit("set-api-accessToken", window.api.basePath);
// setAccessToken(user.data.AccessToken)
setLoading(false);
navigate(`/home`);
};
const handleCheckRememberMe = (event) => {
setRememberMe(event.target.checked);
};
return (
<>
<AppBarBackOnly />
@@ -90,7 +106,13 @@ export const LoginWithImage = () => {
alignItems="center"
spacing={2}
>
<Grid item marginBottom={2}>
<Grid
container
direction="column"
justifyContent="center"
alignItems="center"
marginBottom={2}
>
<Typography
textAlign="center"
variant="h3"
@@ -116,39 +138,53 @@ export const LoginWithImage = () => {
</Typography>
</Grid>
<Grid item minWidth="100%">
<br />
<FormControl variant="outlined" fullWidth>
<InputLabel htmlFor="user-password">
Password:
</InputLabel>
<OutlinedInput
id="user-password"
type={
password.showpass
? "text"
: "password"
}
variant="outlined"
onChange={handlePassword("password")}
label="Password:"
endAdornment={
<InputAdornment position="end">
<IconButton
onClick={
handleShowPassword
}
aria-label="toggle password visibility"
>
{password.showpass ? (
<MdiEyeOffOutline />
) : (
<MdiEyeOutline />
)}
</IconButton>
</InputAdornment>
<FormGroup>
<FormControl variant="outlined" fullWidth>
<InputLabel htmlFor="user-password">
Password:
</InputLabel>
<OutlinedInput
id="user-password"
type={
password.showpass
? "text"
: "password"
}
variant="outlined"
onChange={handlePassword(
"password",
)}
label="Password:"
endAdornment={
<InputAdornment position="end">
<IconButton
onClick={
handleShowPassword
}
aria-label="toggle password visibility"
>
{password.showpass ? (
<MdiEyeOffOutline />
) : (
<MdiEyeOutline />
)}
</IconButton>
</InputAdornment>
}
/>
</FormControl>
<FormControlLabel
control={
<Checkbox
checked={rememberMe}
onChange={
handleCheckRememberMe
}
/>
}
label="Remember me"
/>
</FormControl>
</FormGroup>
</Grid>
<Grid item minWidth="100%">
<LoadingButton
@@ -172,10 +208,6 @@ export const LoginWithImage = () => {
export const UserLogin = () => {
const [userList, setUsers] = useState([]);
const navigate = useNavigate();
const cookies = new Cookies();
const currentServer = cookies.get("currentServer");
const serverList = cookies.get("servers");
const handleChangeServer = () => {
navigate("/servers/list");
@@ -189,18 +221,36 @@ export const UserLogin = () => {
return users;
// return {};
};
useEffect(() => {
getUsers().then((users) => {
setUsers(users.data);
console.log(userList);
});
const createApi = async () => {
const server = await getServer();
event.emit("create-jellyfin-api", server.Ip);
};
useMemo(() => {
// TODO Implement a better way to check and create api object when page reloaded. Hint: Maybe use session api or something (*route - login*)
if (!window.api) {
createApi().then(() => {
getUsers().then((users) => {
setUsers(users.data);
console.log(userList);
});
});
} else {
getUsers().then((users) => {
setUsers(users.data);
console.log(userList);
});
}
}, []);
return (
<>
<AppBarBackOnly />
<Container maxWidth="md" className="centered">
<h1 color="white">WIP-user login</h1>
<Typography variant="h3" sx={{ marginBottom: "1em" }}>
Users
</Typography>
<div className="userList">
{userList.map((item, index) => {
return (
@@ -251,6 +301,8 @@ export const UserLogin = () => {
export const UserLoginManual = () => {
const [loading, setLoading] = useState(false);
const [rememberMe, setRememberMe] = useState(true);
const navigate = useNavigate();
const { enqueueSnackbar } = useSnackbar();
@@ -297,12 +349,19 @@ export const UserLoginManual = () => {
setLoading(true);
const user = await authUser();
sessionStorage.setItem("accessToken", user.data.AccessToken);
if (rememberMe == true) {
saveUser(userName, password.password);
}
event.emit("set-api-accessToken", window.api.basePath);
// setAccessToken(user.data.AccessToken)
setLoading(false);
navigate(`/home`);
};
const handleCheckRememberMe = (event) => {
setRememberMe(event.target.checked);
};
return (
<>
<AppBarBackOnly />
@@ -338,42 +397,57 @@ export const UserLoginManual = () => {
</FormControl>
</Grid>
<Grid sx={{ width: "100%" }} item xl={5} md={6}>
<FormControl
sx={{ width: "100%" }}
variant="outlined"
>
<InputLabel htmlFor="user-password">
Password:
</InputLabel>
<OutlinedInput
fullWidth
id="user-password"
type={
password.showpass
? "text"
: "password"
}
<FormGroup>
<FormControl
sx={{ width: "100%" }}
variant="outlined"
onChange={handlePassword("password")}
label="Password:"
endAdornment={
<InputAdornment position="end">
<IconButton
onClick={
handleShowPassword
}
aria-label="toggle password visibility"
>
{password.showpass ? (
<MdiEyeOffOutline />
) : (
<MdiEyeOutline />
)}
</IconButton>
</InputAdornment>
>
<InputLabel htmlFor="user-password">
Password:
</InputLabel>
<OutlinedInput
fullWidth
id="user-password"
type={
password.showpass
? "text"
: "password"
}
variant="outlined"
onChange={handlePassword(
"password",
)}
label="Password:"
endAdornment={
<InputAdornment position="end">
<IconButton
onClick={
handleShowPassword
}
aria-label="toggle password visibility"
>
{password.showpass ? (
<MdiEyeOffOutline />
) : (
<MdiEyeOutline />
)}
</IconButton>
</InputAdornment>
}
/>
</FormControl>
<FormControlLabel
control={
<Checkbox
checked={rememberMe}
onChange={
handleCheckRememberMe
}
/>
}
label="Remember me"
/>
</FormControl>
</FormGroup>
</Grid>
<Grid item xl={5} md={6} sx={{ width: "100%" }}>
<LoadingButton
+26 -32
View File
@@ -2,11 +2,13 @@
import { useState, useEffect } from "react";
import { Cookies, useCookies } from "react-cookie";
import { Navigate } from "react-router-dom";
import { useNavigate } from "react-router-dom";
import { v4 as uuidv4 } from "uuid";
import { EventEmitter as event } from "../../../eventEmitter.js";
import { setServer } from "../../../utils/store/servers.js";
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
// MUI
import TextField from "@mui/material/TextField";
@@ -14,8 +16,6 @@ import Typography from "@mui/material/Typography";
import Grid from "@mui/material/Grid";
import LoadingButton from "@mui/lab/LoadingButton";
import SvgIcon from "@mui/material/SvgIcon";
import Button from "@mui/material/Button";
import LinearProgress from "@mui/material/LinearProgress";
import Container from "@mui/material/Container";
import { mdiChevronRight } from "@mdi/js";
@@ -126,57 +126,53 @@ export const ServerList = () => {
export const ServerSetup = (props) => {
const [serverIp, setServerIp] = useState("");
const [checkingServer, setServerCheckState] = useState(false);
const [isJfServer, setIsJfServerState] = useState(false);
const { enqueueSnackbar } = useSnackbar();
const [serverlistCookies, setServerList] = useCookies(["servers"]);
const [currentServer, setCurrentServer] = useCookies(["currentServer"]);
const cookies = new Cookies();
const navigate = useNavigate();
const [loading, setLoading] = useState(false);
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 () => {
event.emit("create-jellyfin-api", serverIp);
let sysInfo = await getSystemApi(window.api).getPublicSystemInfo();
sysInfo = sysInfo.data;
let initServerList = cookies.get("servers");
if (initServerList == null) {
initServerList = [];
// Set Server Config to Tauri store
sysInfo.Ip = serverIp;
setServer(sysInfo);
const usersAvailablity = await usersAvailable();
if (usersAvailablity == true) {
console.log(usersAvailablity);
navigate("/login/users");
} else {
initServerList = JSON.parse(initServerList);
navigate("/login/manual");
}
let serverConf = {
serverName: sysInfo.ServerName,
id: sysInfo.Id,
jellyfinVersion: sysInfo.Version,
serverAddress: serverIp,
};
let jfId = sysInfo.Id;
let server = {};
server[sysInfo.Id] = serverConf;
server = JSON.stringify([...initServerList, server]);
setServerList("servers", server, { path: "/" });
setCurrentServer("currentServer", sysInfo.Id, { path: "/" });
setIsJfServerState(true);
};
const handleAddServer = () => {
setLoading(true);
let data;
// setServerCheckState(true);
fetch(`${serverIp}/System/Ping`, {
body: JSON.stringify(data),
})
.then((res) => res.json())
.then((data) => {
if (data == "Jellyfin Server") {
console.log(true);
// setServerCheckState(false);
addServer();
setLoading(false);
return true;
} else {
// setServerCheckState(false);
enqueueSnackbar(
"The server address does not seem be a jellyfin server",
{ variant: "error" },
@@ -186,7 +182,6 @@ export const ServerSetup = (props) => {
}
})
.catch((error) => {
// setServerCheckState(false);
setLoading(false);
enqueueSnackbar(
"Unable to verify whether the give address is a valid Jellyfin server",
@@ -198,9 +193,8 @@ export const ServerSetup = (props) => {
return (
<>
{isJfServer && <Navigate to="/login" />}
<Container
maxWidth="md"
maxWidth="sm"
className={
checkingServer
? "centered serverContainer loading"
@@ -215,7 +209,7 @@ export const ServerSetup = (props) => {
alignItems="center"
>
<Grid item xl={5} md={6} sx={{ marginBottom: "1em" }}>
<JellyplayerLogo className="logo" />
<Typography variant="h3">Add Server</Typography>
</Grid>
<Grid item xl={5} md={6} sx={{ width: "100%" }}>
<TextField
+31
View File
@@ -0,0 +1,31 @@
/** @format */
import { Store } from "tauri-plugin-store-api";
const servers = new Store(".servers.dat");
/**
* Set server in .servers.dat
* @param {object} data - Server info
*/
const setServer = (data) => {
let server = servers.set("server", data);
};
/**
* Get Server list
* @returns {object} server
*/
const getServer = async () => {
let server = await servers.get("server");
return server;
};
/**
* Delete the given server from client storage
*/
const delServer = async () => {
await servers.delete("server");
};
export { setServer, getServer, delServer };
+28
View File
@@ -0,0 +1,28 @@
/** @format */
import { Store } from "tauri-plugin-store-api";
const user = new Store(".user.dat");
/**
* Set User details to .user.dat
* @param {string} userName - User's name
* @param {string} userPassword - User's Password
*/
const saveUser = (userName, userPassword) => {
let details = user.set("user", {
Name: userName,
Password: userPassword,
});
};
/**
* Get saved user fro .user.dat
* @return {object}
*/
const getUser = async () => {
let details = await user.get("user");
return details;
};
export { saveUser, getUser };