Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c477f62f69 | ||
|
|
0af246cff2 | ||
|
|
e095863afa | ||
|
|
a290e83c19 | ||
|
|
f8545d2182 | ||
|
|
2b3c02b261 | ||
|
|
9ce5f84fc5 | ||
|
|
60f1667dc2 | ||
|
|
3add9d9f89 | ||
|
|
50921dbc5f | ||
|
|
faa9e844e1 | ||
|
|
dd03a2dbe9 | ||
|
|
8842cc994c | ||
|
|
fcd92f2760 | ||
|
|
63e6bda233 | ||
|
|
d6d81f2b4d | ||
|
|
81d188ac5a | ||
|
|
537176b77d | ||
|
|
1dddbca3b2 | ||
|
|
16c6a26a2e | ||
|
|
bc3ddc3f24 | ||
|
|
e28917f8d3 | ||
|
|
2482a83698 | ||
|
|
6e22c545b1 | ||
|
|
27e2ee971d | ||
|
|
c58d656449 | ||
|
|
a7b2f2361c | ||
|
|
7361dee0c5 | ||
|
|
255ce91be4 | ||
|
|
a780dd77c8 | ||
|
|
9d4a02c33a | ||
|
|
df8afbf5e1 | ||
|
|
2f95e95e2e | ||
|
|
aa47e2fda5 | ||
|
|
09bcee155c | ||
|
|
cdd1a0a85b | ||
|
|
b76cbd0068 | ||
|
|
27dd21400b | ||
|
|
d44848516a | ||
|
|
f5c6e97355 | ||
|
|
9ca0f529a8 | ||
|
|
339f86517c | ||
|
|
4ba08867ba | ||
|
|
71f3cb6325 | ||
|
|
7e7535edfb | ||
|
|
0e774ebc8c | ||
|
|
268339c410 | ||
|
|
6643b9ea7e | ||
|
|
9706ce0ed7 | ||
|
|
cc8c6e187a | ||
|
|
4302d00bba | ||
|
|
a4ec70d44c | ||
|
|
8c9e5aec18 | ||
|
|
1125ef2539 | ||
|
|
48d0354a3f | ||
|
|
5f394c0d86 | ||
|
|
28954a38ba | ||
|
|
ebd6d49ce9 | ||
|
|
6220696e18 | ||
|
|
7ec4e59821 | ||
|
|
2fb3fb83e9 | ||
|
|
4549547012 | ||
|
|
e0c77fb7c6 | ||
|
|
686d1597af | ||
|
|
92bd2d5b0e | ||
|
|
f238e367ba | ||
|
|
0749b3f59a | ||
|
|
b0fc4f7f51 | ||
|
|
674bde06df | ||
|
|
52faaef201 | ||
|
|
3d75c08979 | ||
|
|
f799aa5e11 |
No files matched your search
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es2021": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:react/recommended"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": "latest",
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
"react",
|
||||||
|
"react-refresh"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"no-mixed-spaces-and-tabs": "off",
|
||||||
|
"react/prop-types": "off",
|
||||||
|
"react-refresh/only-export-components": "warn"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -53,7 +53,7 @@ jobs:
|
|||||||
${{ runner.os }}-pnpm-store-
|
${{ runner.os }}-pnpm-store-
|
||||||
|
|
||||||
- name: Sync node version and setup cache
|
- name: Sync node version and setup cache
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "lts/*"
|
node-version: "lts/*"
|
||||||
cache: "pnpm" # Set this to npm, yarn or pnpm.
|
cache: "pnpm" # Set this to npm, yarn or pnpm.
|
||||||
@@ -63,10 +63,12 @@ jobs:
|
|||||||
run: pnpm install --no-frozen-lockfile && pnpm run build # Change this to npm, yarn or pnpm.
|
run: pnpm install --no-frozen-lockfile && pnpm run build # Change this to npm, yarn or pnpm.
|
||||||
|
|
||||||
- name: Build the app
|
- name: Build the app
|
||||||
uses: tauri-apps/tauri-action@v0
|
uses: tauri-apps/tauri-action@vdev
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY}}
|
||||||
|
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD}}
|
||||||
with:
|
with:
|
||||||
tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
|
tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
|
||||||
releaseName: "App Name v__VERSION__" # tauri-action replaces \_\_VERSION\_\_ with the app version.
|
releaseName: "App Name v__VERSION__" # tauri-action replaces \_\_VERSION\_\_ with the app version.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||

|

|
||||||
|
|
||||||
# 📝 Prerequisites
|
# 📝 Prerequisites
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
# 📃 Roadmap
|
# 📃 Roadmap
|
||||||
|
|
||||||
- Checkout [GitHub Project](https://github.com/users/prayag17/projects/3)
|
- Checkout [GitHub Project](https://github.com/users/prayag17/projects/3)
|
||||||
> **Note** : There is no current due date for alpha 1 release
|
|
||||||
|
|
||||||
# 🎊 Special thanks to
|
# 🎊 Special thanks to
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,34 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Jellyplayer</title>
|
<title>Jellyplayer</title>
|
||||||
|
<script src="http://localhost:8097"></script>
|
||||||
|
<style>
|
||||||
|
.app-loading {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
background: hsl(256, 100%, 4%);
|
||||||
|
z-index: 100000;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-loading-logo {
|
||||||
|
width: 65vw;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<div class="app-loading">
|
||||||
|
<img src="./assetsStatic/LogoBig.svg" class="app-loading-logo" />
|
||||||
|
</div>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<svg style="width:0;height:0;position:absolute;" aria-hidden="true" focusable="false">
|
<svg style="width:0;height:0;position:absolute;" aria-hidden="true" focusable="false">
|
||||||
<linearGradient id="clr-gradient-default" x2="1" y2="1">
|
<linearGradient id="clr-gradient-default" x2="1" y2="1">
|
||||||
|
|||||||
@@ -4,28 +4,30 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preinstall": "npx only-allow pnpm",
|
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"tauri": "tauri"
|
"tauri": "tauri",
|
||||||
|
"lint": "eslint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.11.1",
|
"@emotion/react": "^11.11.1",
|
||||||
"@emotion/styled": "^11.11.0",
|
"@emotion/styled": "^11.11.0",
|
||||||
"@fontsource/noto-sans": "^5.0.12",
|
"@fontsource-variable/jetbrains-mono": "^5.0.18",
|
||||||
"@jellyfin/sdk": "^0.8.2",
|
"@fontsource/noto-sans": "^5.0.17",
|
||||||
"@mdi/js": "^7.2.96",
|
"@jellyfin/sdk": "0.8.2",
|
||||||
"@mui/lab": "5.0.0-alpha.146",
|
"@mdi/js": "^7.3.67",
|
||||||
"@mui/material": "^5.14.10",
|
"@mui/lab": "5.0.0-alpha.155",
|
||||||
"@tanstack/react-query": "^4.35.3",
|
"@mui/material": "^5.14.15",
|
||||||
"@tanstack/react-query-devtools": "^4.35.3",
|
"@tanstack/react-query": "^5.0.5",
|
||||||
"@tauri-apps/api": "^1.4.0",
|
"@tanstack/react-query-devtools": "^5.4.2",
|
||||||
"axios": "^1.5.0",
|
"@tauri-apps/api": "^1.5.1",
|
||||||
|
"axios": "^1.6.0",
|
||||||
"axios-tauri-api-adapter": "^0.2.0",
|
"axios-tauri-api-adapter": "^0.2.0",
|
||||||
"blurhash": "^2.0.5",
|
"blurhash": "^2.0.5",
|
||||||
"events": "^3.3.0",
|
"events": "^3.3.0",
|
||||||
"framer-motion": "^10.16.4",
|
"framer-motion": "^10.16.4",
|
||||||
|
"material-symbols": "^0.14.0",
|
||||||
"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",
|
||||||
@@ -33,21 +35,24 @@
|
|||||||
"react-error-boundary": "^4.0.11",
|
"react-error-boundary": "^4.0.11",
|
||||||
"react-multi-carousel": "^2.8.4",
|
"react-multi-carousel": "^2.8.4",
|
||||||
"react-player": "^2.13.0",
|
"react-player": "^2.13.0",
|
||||||
"react-router-dom": "^6.16.0",
|
"react-router-dom": "^6.17.0",
|
||||||
"react-use-konami": "^1.1.0",
|
"react-use-konami": "^1.1.0",
|
||||||
"tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log#v1",
|
"tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log#v1",
|
||||||
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
|
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
|
||||||
"uuid": "^9.0.1",
|
"uuid": "^9.0.1",
|
||||||
"vite-plugin-svgr": "^4.0.0",
|
"vite-plugin-svgr": "^4.1.0",
|
||||||
"wavesurfer.js": "^7.3.2",
|
"wavesurfer.js": "^7.4.2",
|
||||||
"zustand": "^4.4.1"
|
"zustand": "^4.4.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tauri-apps/cli": "^1.4.0",
|
"@tauri-apps/cli": "^1.5.6",
|
||||||
"@vitejs/plugin-react": "^4.1.0",
|
"@vitejs/plugin-react": "^4.1.0",
|
||||||
|
"eslint": "^8.52.0",
|
||||||
|
"eslint-plugin-react": "^7.33.2",
|
||||||
|
"eslint-plugin-react-refresh": "^0.4.3",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"sass": "^1.68.0",
|
"sass": "^1.69.5",
|
||||||
"vite": "^4.4.9",
|
"vite": "^5.0.5",
|
||||||
"vite-plugin-compression": "^0.5.1"
|
"vite-plugin-compression": "^0.5.1"
|
||||||
},
|
},
|
||||||
"license": "GPL-3.0-only"
|
"license": "GPL-3.0-only"
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 30 KiB |
@@ -1,20 +1,20 @@
|
|||||||
<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">
|
<svg width="1196" height="246" viewBox="0 0 1196 246" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
<rect x="50" y="50" width="146.79" height="146.79" fill="url(#pattern0)"/>
|
<rect x="50" y="50.0024" width="145.46" height="145.46" fill="url(#pattern0)"/>
|
||||||
<g clip-path="url(#clip0_504_8)">
|
<g clip-path="url(#clip0_504_8)">
|
||||||
<rect x="236.79" y="50.6626" width="860" height="81.4648" fill="url(#pattern1)"/>
|
<rect x="235.46" y="50" width="860" height="81.4648" fill="url(#pattern1)"/>
|
||||||
<path d="M236.97 187.127L248.562 161.927H250.398L261.99 187.127H260.01L249.066 163.079H249.858L238.95 187.127H236.97ZM241.218 180.035L241.83 178.487H256.914L257.526 180.035H241.218ZM279.411 187.127V161.927H280.959L292.659 182.123H291.831L303.495 161.927H305.007L305.043 187.127H303.243L303.207 164.699H303.711L292.659 183.779H291.759L280.671 164.699H281.211V187.127H279.411ZM326.321 187.307C324.449 187.307 322.709 186.995 321.101 186.371C319.517 185.723 318.125 184.823 316.925 183.671C315.749 182.495 314.837 181.139 314.189 179.603C313.541 178.043 313.217 176.351 313.217 174.527C313.217 172.703 313.541 171.023 314.189 169.487C314.837 167.927 315.749 166.571 316.925 165.419C318.125 164.243 319.517 163.343 321.101 162.719C322.709 162.071 324.449 161.747 326.321 161.747C328.193 161.747 329.921 162.071 331.505 162.719C333.113 163.343 334.505 164.231 335.681 165.383C336.857 166.535 337.769 167.891 338.417 169.451C339.089 170.987 339.425 172.679 339.425 174.527C339.425 176.375 339.089 178.079 338.417 179.639C337.769 181.175 336.857 182.519 335.681 183.671C334.505 184.823 333.113 185.723 331.505 186.371C329.921 186.995 328.193 187.307 326.321 187.307ZM326.321 185.615C327.929 185.615 329.417 185.339 330.785 184.787C332.153 184.235 333.341 183.455 334.349 182.447C335.357 181.439 336.137 180.263 336.689 178.919C337.265 177.575 337.553 176.111 337.553 174.527C337.553 172.919 337.265 171.455 336.689 170.135C336.137 168.791 335.357 167.615 334.349 166.607C333.341 165.599 332.153 164.819 330.785 164.267C329.417 163.715 327.929 163.439 326.321 163.439C324.713 163.439 323.225 163.715 321.857 164.267C320.489 164.819 319.289 165.599 318.257 166.607C317.249 167.615 316.457 168.791 315.881 170.135C315.329 171.455 315.053 172.919 315.053 174.527C315.053 176.111 315.329 177.575 315.881 178.919C316.457 180.263 317.249 181.439 318.257 182.447C319.289 183.455 320.489 184.235 321.857 184.787C323.225 185.339 324.713 185.615 326.321 185.615ZM347.593 187.127V161.927H357.565C360.229 161.927 362.569 162.467 364.585 163.547C366.601 164.627 368.161 166.115 369.265 168.011C370.393 169.907 370.957 172.079 370.957 174.527C370.957 176.975 370.393 179.147 369.265 181.043C368.161 182.939 366.601 184.427 364.585 185.507C362.569 186.587 360.229 187.127 357.565 187.127H347.593ZM349.429 185.471H357.421C359.797 185.471 361.861 185.003 363.613 184.067C365.365 183.131 366.721 181.847 367.681 180.215C368.641 178.559 369.121 176.663 369.121 174.527C369.121 172.391 368.641 170.507 367.681 168.875C366.721 167.219 365.365 165.923 363.613 164.987C361.861 164.051 359.797 163.583 357.421 163.583H349.429V185.471ZM380.755 173.519H394.399V175.139H380.755V173.519ZM380.971 185.471H396.523V187.127H379.135V161.927H395.983V163.583H380.971V185.471ZM405.017 187.127V161.927H414.053C416.165 161.927 417.977 162.263 419.489 162.935C421.001 163.607 422.165 164.579 422.981 165.851C423.797 167.099 424.205 168.623 424.205 170.423C424.205 172.175 423.797 173.687 422.981 174.959C422.165 176.207 421.001 177.179 419.489 177.875C417.977 178.547 416.165 178.883 414.053 178.883H406.025L406.853 178.019V187.127H405.017ZM422.513 187.127L415.961 177.983H418.049L424.601 187.127H422.513ZM406.853 178.127L406.025 177.263H414.053C416.765 177.263 418.817 176.663 420.209 175.463C421.625 174.263 422.333 172.583 422.333 170.423C422.333 168.239 421.625 166.559 420.209 165.383C418.817 164.183 416.765 163.583 414.053 163.583H406.025L406.853 162.683V178.127ZM432.727 187.127V161.927H434.275L452.239 184.859H451.411V161.927H453.247V187.127H451.735L433.735 164.195H434.563V187.127H432.727ZM477.162 187.307C475.794 187.307 474.51 186.995 473.31 186.371C472.134 185.723 471.186 184.835 470.466 183.707L471.582 182.483C472.278 183.515 473.094 184.307 474.03 184.859C474.99 185.387 476.034 185.651 477.162 185.651C480.498 185.651 482.166 183.671 482.166 179.711V163.583H472.878V161.927H484.002V179.711C484.002 182.231 483.426 184.127 482.274 185.399C481.122 186.671 479.418 187.307 477.162 187.307ZM495.997 173.519H509.641V175.139H495.997V173.519ZM496.213 185.471H511.765V187.127H494.377V161.927H511.225V163.583H496.213V185.471ZM520.259 187.127V161.927H522.095V185.471H536.603V187.127H520.259ZM543.118 187.127V161.927H544.954V185.471H559.462V187.127H543.118ZM569.245 187.127V177.983L569.677 179.171L559.093 161.927H561.109L570.721 177.587H569.713L579.325 161.927H581.233L570.649 179.171L571.081 177.983V187.127H569.245ZM588.627 174.347H602.271V176.003H588.627V174.347ZM588.843 187.127H587.007V161.927H603.855V163.583H588.843V187.127ZM611.518 187.127V161.927H613.354V187.127H611.518ZM623.935 187.127V161.927H625.483L643.447 184.859H642.619V161.927H644.455V187.127H642.943L624.943 164.195H625.771V187.127H623.935ZM676.758 187.307C674.886 187.307 673.146 186.995 671.538 186.371C669.954 185.723 668.574 184.823 667.398 183.671C666.222 182.519 665.31 181.175 664.662 179.639C664.014 178.079 663.69 176.375 663.69 174.527C663.69 172.679 664.014 170.987 664.662 169.451C665.31 167.891 666.222 166.535 667.398 165.383C668.598 164.231 669.99 163.34Line truncated
|
<path d="M235.64 186.465L247.232 161.265H249.068L260.66 186.465H258.68L247.736 162.417H248.528L237.62 186.465H235.64ZM239.888 179.373L240.5 177.825H255.584L256.196 179.373H239.888ZM278.081 186.465V161.265H279.629L291.329 181.461H290.501L302.165 161.265H303.677L303.713 186.465H301.913L301.877 164.037H302.381L291.329 183.117H290.429L279.341 164.037H279.881V186.465H278.081ZM324.991 186.645C323.119 186.645 321.379 186.333 319.771 185.709C318.187 185.061 316.795 184.161 315.595 183.009C314.419 181.833 313.507 180.477 312.859 178.941C312.211 177.381 311.887 175.689 311.887 173.865C311.887 172.041 312.211 170.361 312.859 168.825C313.507 167.265 314.419 165.909 315.595 164.757C316.795 163.581 318.187 162.681 319.771 162.057C321.379 161.409 323.119 161.085 324.991 161.085C326.863 161.085 328.591 161.409 330.175 162.057C331.783 162.681 333.175 163.569 334.351 164.721C335.527 165.873 336.439 167.229 337.087 168.789C337.759 170.325 338.095 172.017 338.095 173.865C338.095 175.713 337.759 177.417 337.087 178.977C336.439 180.513 335.527 181.857 334.351 183.009C333.175 184.161 331.783 185.061 330.175 185.709C328.591 186.333 326.863 186.645 324.991 186.645ZM324.991 184.953C326.599 184.953 328.087 184.677 329.455 184.125C330.823 183.573 332.011 182.793 333.019 181.785C334.027 180.777 334.807 179.601 335.359 178.257C335.935 176.913 336.223 175.449 336.223 173.865C336.223 172.257 335.935 170.793 335.359 169.473C334.807 168.129 334.027 166.953 333.019 165.945C332.011 164.937 330.823 164.157 329.455 163.605C328.087 163.053 326.599 162.777 324.991 162.777C323.383 162.777 321.895 163.053 320.527 163.605C319.159 164.157 317.959 164.937 316.927 165.945C315.919 166.953 315.127 168.129 314.551 169.473C313.999 170.793 313.723 172.257 313.723 173.865C313.723 175.449 313.999 176.913 314.551 178.257C315.127 179.601 315.919 180.777 316.927 181.785C317.959 182.793 319.159 183.573 320.527 184.125C321.895 184.677 323.383 184.953 324.991 184.953ZM346.263 186.465V161.265H356.235C358.899 161.265 361.239 161.805 363.255 162.885C365.271 163.965 366.831 165.453 367.935 167.349C369.063 169.245 369.627 171.417 369.627 173.865C369.627 176.313 369.063 178.485 367.935 180.381C366.831 182.277 365.271 183.765 363.255 184.845C361.239 185.925 358.899 186.465 356.235 186.465H346.263ZM348.099 184.809H356.091C358.467 184.809 360.531 184.341 362.283 183.405C364.035 182.469 365.391 181.185 366.351 179.553C367.311 177.897 367.791 176.001 367.791 173.865C367.791 171.729 367.311 169.845 366.351 168.213C365.391 166.557 364.035 165.261 362.283 164.325C360.531 163.389 358.467 162.921 356.091 162.921H348.099V184.809ZM379.425 172.857H393.069V174.477H379.425V172.857ZM379.641 184.809H395.193V186.465H377.805V161.265H394.653V162.921H379.641V184.809ZM403.687 186.465V161.265H412.723C414.835 161.265 416.647 161.601 418.159 162.273C419.671 162.945 420.835 163.917 421.651 165.189C422.467 166.437 422.875 167.961 422.875 169.761C422.875 171.513 422.467 173.025 421.651 174.297C420.835 175.545 419.671 176.517 418.159 177.213C416.647 177.885 414.835 178.221 412.723 178.221H404.695L405.523 177.357V186.465H403.687ZM421.183 186.465L414.631 177.321H416.719L423.271 186.465H421.183ZM405.523 177.465L404.695 176.601H412.723C415.435 176.601 417.487 176.001 418.879 174.801C420.295 173.601 421.003 171.921 421.003 169.761C421.003 167.577 420.295 165.897 418.879 164.721C417.487 163.521 415.435 162.921 412.723 162.921H404.695L405.523 162.021V177.465ZM431.397 186.465V161.265H432.945L450.909 184.197H450.081V161.265H451.917V186.465H450.405L432.405 163.533H433.233V186.465H431.397ZM475.832 186.645C474.464 186.645 473.18 186.333 471.98 185.709C470.804 185.061 469.856 184.173 469.136 183.045L470.252 181.821C470.948 182.853 471.764 183.645 472.7 184.197C473.66 184.725 474.704 184.989 475.832 184.989C479.168 184.989 480.836 183.009 480.836 179.049V162.921H471.548V161.265H482.672V179.049C482.672 181.569 482.096 183.465 480.944 184.737C479.792 186.009 478.088 186.645 475.832 186.645ZM494.667 172.857H508.311V174.477H494.667V172.857ZM494.883 184.809H510.435V186.465H493.047V161.265H509.895V162.921H494.883V184.809ZM518.929 186.465V161.265H520.765V184.809H535.273V186.465H518.929ZM541.788 186.465V161.265H543.624V184.809H558.132V186.465H541.788ZM567.915 186.465V177.321L568.347 178.509L557.763 161.265H559.779L569.391 176.925H568.383L577.995 161.265H579.903L569.319 178.509L569.751 177.321V186.465H567.915ZM587.297 173.685H600.941V175.341H587.297V173.685ZM587.513 186.465H585.677V161.265H602.525V162.921H587.513V186.465ZM610.188 186.465V161.265H612.024V186.465H610.188ZM622.605 186.465V161.265H624.153L642.117 184.197H641.289V161.265H643.125V186.465H641.613L623.613 163.533H624.441V186.465H622.605ZM675.427 186.645C673.555 186.645 671.815 186.333 670.207 185.709C668.623 185.061 667.243 184.161 666.067 183.009C664.891 181.857 663.979 180.513 663.331 178.977C662.683 177.417 662.359 175.713 662.359 173.865C662.359 172.017 662.683 170.325 663.331 168.789C663.979 167.229 664.891 165.873 666.067 164.721C667.267 163.569 668.659 16Line truncated
|
||||||
</g>
|
</g>
|
||||||
<defs>
|
<defs>
|
||||||
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
|
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
|
||||||
<use xlink:href="#image0_504_8" transform="scale(0.000806452)"/>
|
<use xlink:href="#image0_504_8" transform="scale(0.000661376)"/>
|
||||||
</pattern>
|
</pattern>
|
||||||
<pattern id="pattern1" patternContentUnits="objectBoundingBox" width="1" height="1">
|
<pattern id="pattern1" patternContentUnits="objectBoundingBox" width="1" height="1">
|
||||||
<use xlink:href="#image1_504_8" transform="scale(0.000244141 0.00257732)"/>
|
<use xlink:href="#image1_504_8" transform="scale(0.000244141 0.00257732)"/>
|
||||||
</pattern>
|
</pattern>
|
||||||
<clipPath id="clip0_504_8">
|
<clipPath id="clip0_504_8">
|
||||||
<rect width="910" height="145.465" fill="white" transform="translate(236.79 50.6626)"/>
|
<rect width="910" height="145.465" fill="white" transform="translate(235.46 50)"/>
|
||||||
</clipPath>
|
</clipPath>
|
||||||
<image id="image0_504_8" width="1240" height="1240" xlink:href="data:image/png;base64,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 truncated
|
<image id="image0_504_8" width="1512" height="1512" xlink:href="data:image/png;base64,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 truncated
|
||||||
<image id="image1_504_8" width="4096" height="388" xlink:href="data:image/png;base64,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 truncated
|
<image id="image1_504_8" width="4096" height="388" xlink:href="data:image/png;base64,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 truncated
|
||||||
</defs>
|
</defs>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 863 KiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 469 KiB After Width: | Height: | Size: 889 KiB |
@@ -1,22 +1,20 @@
|
|||||||
<svg width="1155" height="1264" viewBox="0 0 1155 1264" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
<svg width="1512" height="1512" viewBox="0 0 1512 1512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path d="M968.546 551.878C981.951 559.555 993.091 570.638 1000.84 584.005C1008.59 597.372 1012.67 612.549 1012.67 628C1012.67 643.451 1008.59 658.628 1000.84 671.995C993.091 685.362 981.951 696.445 968.546 704.122L272.816 1107.92C215.959 1140.95 138 1103.21 138 1031.79V628V224.205C138 152.787 215.959 115.054 272.816 148.084L620.681 349.981L968.546 551.878Z" fill="url(#pattern0)"/>
|
<rect width="1512" height="1512" rx="756" fill="url(#paint0_radial_33_14)"/>
|
||||||
<g filter="url(#filter0_d_33_14)">
|
<path d="M591.675 378.82C546.952 352.839 485.631 382.519 485.631 438.696V756.315L865.3 537.63L591.675 378.82Z" fill="url(#paint1_linear_33_14)"/>
|
||||||
<path d="M138 628V1031.79C138 1103.21 215.959 1140.95 272.816 1107.92L968.546 704.122C981.951 696.445 993.091 685.362 1000.84 671.995C1008.59 658.628 1012.67 643.451 1012.67 628C1012.67 612.549 1008.59 597.372 1000.84 584.005C993.091 570.638 981.951 559.555 968.546 551.878L620.681 349.981M138 628V224.205C138 152.787 215.959 115.054 272.816 148.084L620.681 349.981M138 628L620.681 349.981" stroke="white" stroke-width="100" shape-rendering="crispEdges"/>
|
<path d="M1164.33 721.71C1158.23 711.195 1149.47 702.478 1138.93 696.439L865.3 537.63L485.631 756.315V1073.93C485.631 1130.11 546.952 1159.79 591.675 1133.81L1138.93 816.192C1149.47 810.153 1158.23 801.435 1164.33 790.921C1170.42 780.407 1173.63 768.469 1173.63 756.315C1173.63 744.162 1170.42 732.224 1164.33 721.71Z" fill="url(#paint2_linear_33_14)"/>
|
||||||
</g>
|
<path d="M485.631 756.315V1073.93C485.631 1130.11 546.952 1159.79 591.675 1133.81L1138.93 816.192C1149.47 810.153 1158.23 801.435 1164.33 790.921C1170.42 780.407 1173.63 768.469 1173.63 756.315C1173.63 744.162 1170.42 732.224 1164.33 721.71C1158.23 711.195 1149.47 702.478 1138.93 696.439L865.3 537.63M485.631 756.315V438.696C485.631 382.519 546.952 352.839 591.675 378.82L865.3 537.63M485.631 756.315L865.3 537.63" stroke="white" stroke-width="84" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
<defs>
|
<defs>
|
||||||
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
|
<radialGradient id="paint0_radial_33_14" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(1512 1512) rotate(-135) scale(2138.29)">
|
||||||
<use xlink:href="#image0_33_14" transform="translate(-0.0625001 1) scale(0.000274658 0.000244141) rotate(-90)"/>
|
<stop/>
|
||||||
</pattern>
|
<stop offset="1" stop-color="#474747"/>
|
||||||
<filter id="filter0_d_33_14" x="0" y="0.237759" width="1154.67" height="1263.52" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
</radialGradient>
|
||||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
<linearGradient id="paint1_linear_33_14" x1="485.631" y1="369.315" x2="1173.63" y2="1143.82" gradientUnits="userSpaceOnUse">
|
||||||
<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"/>
|
<stop stop-color="#FB2576"/>
|
||||||
<feOffset dx="2" dy="4"/>
|
<stop offset="0.697961" stop-color="#150050"/>
|
||||||
<feGaussianBlur stdDeviation="45"/>
|
</linearGradient>
|
||||||
<feComposite in2="hardAlpha" operator="out"/>
|
<linearGradient id="paint2_linear_33_14" x1="485.631" y1="369.315" x2="1173.63" y2="1143.82" gradientUnits="userSpaceOnUse">
|
||||||
<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"/>
|
<stop stop-color="#FB2576"/>
|
||||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_33_14"/>
|
<stop offset="0.697961" stop-color="#150050"/>
|
||||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_33_14" result="shape"/>
|
</linearGradient>
|
||||||
</filter>
|
|
||||||
<image id="image0_33_14" width="4096" height="4096" xlink:href="data:image/png;base64,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 truncated
|
|
||||||
</defs>
|
</defs>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 4.9 MiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 451 KiB After Width: | Height: | Size: 451 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 25 KiB |
@@ -12,16 +12,17 @@ rust-version = "1.59"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tauri-build = { version = "1.4.1", features = [] }
|
tauri-build = { version = "1.5.0", features = [] }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
log = "^0.4.20"
|
log = "^0.4.20"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
tauri = { version = "1.5.0", features = [ "http-all", "devtools", "process-exit", "process-relaunch", "shell-all", "window-set-fullscreen", "http-all"] }
|
tauri = { version = "1.5.3", features = [ "updater", "http-all", "devtools", "process-exit", "process-relaunch", "shell-all", "window-set-fullscreen", "http-all"] }
|
||||||
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 = "v1" }
|
||||||
tauri-plugin-localhost = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
|
tauri-plugin-localhost = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
|
||||||
tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev", features = ["colored"] }
|
tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1", features = ["colored"] }
|
||||||
|
tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
|
||||||
portpicker = "0.1" # used in the example to pick a random free port
|
portpicker = "0.1" # used in the example to pick a random free port
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 411 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 88 KiB |
@@ -1,20 +1,7 @@
|
|||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
use tauri::Manager;
|
|
||||||
use tauri::{utils::config::AppUrl, WindowUrl};
|
use tauri::{utils::config::AppUrl, WindowUrl};
|
||||||
use tauri_plugin_log::{fern::colors::ColoredLevelConfig, LogTarget};
|
use tauri_plugin_log::{fern::colors::ColoredLevelConfig, LogTarget};
|
||||||
// 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();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Tauri by default uses HTTPS, so use the localhost plugin to downgrade back to
|
// 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
|
// HTTP. However, when running tauri dev, we already have a localhost server
|
||||||
// provided by vite, so don't enable it
|
// provided by vite, so don't enable it
|
||||||
@@ -52,10 +39,7 @@ fn main() {
|
|||||||
.build(),
|
.build(),
|
||||||
)
|
)
|
||||||
.plugin(tauri_plugin_store::Builder::default().build())
|
.plugin(tauri_plugin_store::Builder::default().build())
|
||||||
.invoke_handler(tauri::generate_handler![close_splashscreen])
|
.plugin(tauri_plugin_window_state::Builder::default().build())
|
||||||
.run(context)
|
.run(context)
|
||||||
.expect("error while running JellyPlayer");
|
.expect("error while running JellyPlayer");
|
||||||
// tauri::Builder::default()
|
|
||||||
// .run(tauri::generate_context!())
|
|
||||||
// .expect("error while running tauri application");
|
|
||||||
}
|
}
|
||||||
@@ -74,37 +74,49 @@
|
|||||||
"sidebarImage": "../public/installerSideBarImage.bmp",
|
"sidebarImage": "../public/installerSideBarImage.bmp",
|
||||||
"headerImage": "../public/installerHeaderImage.bmp",
|
"headerImage": "../public/installerHeaderImage.bmp",
|
||||||
"installerIcon": "icons/icon.ico"
|
"installerIcon": "icons/icon.ico"
|
||||||
|
},
|
||||||
|
"webviewInstallMode": {
|
||||||
|
"silent": true,
|
||||||
|
"type": "offlineInstaller"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"appimage": {
|
||||||
|
"bundleMediaFramework": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"security": {
|
"security": {
|
||||||
"csp": null
|
"csp": null,
|
||||||
|
"dangerousRemoteDomainIpcAccess": [
|
||||||
|
{
|
||||||
|
"domain": "**",
|
||||||
|
"windows": ["main"],
|
||||||
|
"enableTauriAPI": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"domain": "*",
|
||||||
|
"windows": ["main"],
|
||||||
|
"enableTauriAPI": true
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"updater": {
|
"updater": {
|
||||||
"active": false
|
"active": true,
|
||||||
|
"endpoints": [
|
||||||
|
"https://cdn.jsdelivr.net/gh/prayag17/jellyplayer@latest/updater.json"
|
||||||
|
],
|
||||||
|
"dialog": true,
|
||||||
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDE1MTczRTNFNjFGQ0JBOEMKUldTTXV2eGhQajRYRmNFSG5EYVF1VE1YaVA5Qjl2WGt6alFWOGo5UCs2SGprTGtNOC9WMC8wTjMK"
|
||||||
},
|
},
|
||||||
"windows": [
|
"windows": [
|
||||||
{
|
|
||||||
"width": 800,
|
|
||||||
"height": 300,
|
|
||||||
"center": true,
|
|
||||||
"decorations": false,
|
|
||||||
"resizable": false,
|
|
||||||
"url": "splash.html",
|
|
||||||
"label": "splashscreen",
|
|
||||||
"title": "JellyPlayer",
|
|
||||||
"visible": true,
|
|
||||||
"transparent": true
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"fullscreen": false,
|
"fullscreen": false,
|
||||||
"height": 600,
|
"height": 600,
|
||||||
"width": 800,
|
"width": 800,
|
||||||
"resizable": true,
|
"resizable": true,
|
||||||
"title": "JellyPlayer",
|
"title": "JellyPlayer",
|
||||||
"visible": false,
|
"visible": true,
|
||||||
"center": true
|
"center": true,
|
||||||
|
"label": "main"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,24 +5,21 @@ import React, { useState, useEffect } from "react";
|
|||||||
import useKonami from "react-use-konami";
|
import useKonami from "react-use-konami";
|
||||||
|
|
||||||
import { ThemeProvider } from "@mui/material/styles";
|
import { ThemeProvider } from "@mui/material/styles";
|
||||||
import { SnackbarProvider, useSnackbar } from "notistack";
|
import { SnackbarProvider } from "notistack";
|
||||||
import {
|
import {
|
||||||
Routes,
|
Routes,
|
||||||
Route,
|
Route,
|
||||||
useNavigate,
|
useNavigate,
|
||||||
useLocation,
|
useLocation,
|
||||||
Outlet,
|
Outlet,
|
||||||
|
Navigate,
|
||||||
} from "react-router-dom";
|
} from "react-router-dom";
|
||||||
import { AnimatePresence, motion } from "framer-motion";
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
|
|
||||||
import { EventEmitter as event } from "./eventEmitter.js";
|
|
||||||
|
|
||||||
import { relaunch } from "@tauri-apps/api/process";
|
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 { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|
||||||
|
|
||||||
// Theming
|
// Theming
|
||||||
import CssBaseline from "@mui/material/CssBaseline";
|
import CssBaseline from "@mui/material/CssBaseline";
|
||||||
import { theme } from "./theme";
|
import { theme } from "./theme";
|
||||||
@@ -39,7 +36,8 @@ import Slide from "@mui/material/Slide";
|
|||||||
import LinearProgress from "@mui/material/LinearProgress";
|
import LinearProgress from "@mui/material/LinearProgress";
|
||||||
|
|
||||||
// Routes
|
// Routes
|
||||||
import { ServerSetup, ServerList } from "./routes/setup/server";
|
import { ServerSetup } from "./routes/setup/server";
|
||||||
|
import ServerList from "./routes/setup/serverList/index.jsx";
|
||||||
import Home from "./routes/home";
|
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";
|
||||||
@@ -74,23 +72,11 @@ import "@fontsource/noto-sans/800.css";
|
|||||||
import "@fontsource/noto-sans/800-italic.css";
|
import "@fontsource/noto-sans/800-italic.css";
|
||||||
import "@fontsource/noto-sans/900.css";
|
import "@fontsource/noto-sans/900.css";
|
||||||
import "@fontsource/noto-sans/900-italic.css";
|
import "@fontsource/noto-sans/900-italic.css";
|
||||||
|
import "material-symbols";
|
||||||
// Jellyfin SDK TypeScript
|
import "@fontsource-variable/jetbrains-mono";
|
||||||
import {
|
|
||||||
Jellyfin,
|
|
||||||
VersionOutdatedIssue,
|
|
||||||
VersionUnsupportedIssue,
|
|
||||||
} from "@jellyfin/sdk";
|
|
||||||
import { version as appVer } from "../package.json";
|
|
||||||
import { v4 as uuidv4 } from "uuid";
|
|
||||||
import { delServer, getServer } from "./utils/storage/servers.js";
|
|
||||||
import { delUser, getUser } from "./utils/storage/user.js";
|
|
||||||
|
|
||||||
import { useBackdropStore } from "./utils/store/backdrop.js";
|
import { useBackdropStore } from "./utils/store/backdrop.js";
|
||||||
import {
|
import { usePlaybackDataLoadStore } from "./utils/store/playback.js";
|
||||||
usePlaybackDataLoadStore,
|
|
||||||
usePlaybackStore,
|
|
||||||
} from "./utils/store/playback.js";
|
|
||||||
import BoxSetTitlePage from "./routes/boxset/index.jsx";
|
import BoxSetTitlePage from "./routes/boxset/index.jsx";
|
||||||
import PersonTitlePage from "./routes/person/index.jsx";
|
import PersonTitlePage from "./routes/person/index.jsx";
|
||||||
import MusicAlbumTitlePage from "./routes/album/index.jsx";
|
import MusicAlbumTitlePage from "./routes/album/index.jsx";
|
||||||
@@ -100,43 +86,11 @@ import ArtistTitlePage from "./routes/artist/index.jsx";
|
|||||||
import EpisodeTitlePage from "./routes/episode/index.jsx";
|
import EpisodeTitlePage from "./routes/episode/index.jsx";
|
||||||
import PlaylistTitlePage from "./routes/playlist/index.jsx";
|
import PlaylistTitlePage from "./routes/playlist/index.jsx";
|
||||||
|
|
||||||
// Initial custom axios client to use tauri's http module
|
import { useApi } from "./utils/store/api.js";
|
||||||
import axios from "axios";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import axiosTauriApiAdapter from "axios-tauri-api-adapter";
|
import { CircularProgress } from "@mui/material";
|
||||||
const axiosClient = axios.create({
|
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||||
adapter: axiosTauriApiAdapter,
|
import { useCentralStore } from "./utils/store/central.js";
|
||||||
headers: { "Access-Control-Allow-Origin": "*" },
|
|
||||||
timeout: 60000,
|
|
||||||
});
|
|
||||||
|
|
||||||
const deviceId = localStorage.getItem("deviceId");
|
|
||||||
|
|
||||||
if (!deviceId) {
|
|
||||||
localStorage.setItem("deviceId", uuidv4());
|
|
||||||
}
|
|
||||||
|
|
||||||
const jellyfin = new Jellyfin({
|
|
||||||
clientInfo: {
|
|
||||||
name: "JellyPlayer",
|
|
||||||
version: appVer,
|
|
||||||
},
|
|
||||||
deviceInfo: {
|
|
||||||
name: "JellyPlayer",
|
|
||||||
id: deviceId,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
event.on("create-jellyfin-api", (serverAddress) => {
|
|
||||||
window.api = jellyfin.createApi(serverAddress, null, axiosClient);
|
|
||||||
// window.api = jellyfin.createApi(serverAddress);
|
|
||||||
});
|
|
||||||
event.on("set-api-accessToken", (serverAddress) => {
|
|
||||||
window.api = jellyfin.createApi(
|
|
||||||
serverAddress,
|
|
||||||
sessionStorage.getItem("accessToken"),
|
|
||||||
axiosClient,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
const anim = {
|
const anim = {
|
||||||
initial: {
|
initial: {
|
||||||
@@ -153,6 +107,39 @@ const anim = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const LoginRoute = () => {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
|
const usersList = useQuery({
|
||||||
|
queryKey: ["public-users"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getUserApi(api).getPublicUsers();
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
enabled: Boolean(api),
|
||||||
|
});
|
||||||
|
if (usersList.isSuccess && !usersList.isFetching) {
|
||||||
|
if (usersList.data.length > 0) {
|
||||||
|
navigate("/login/users");
|
||||||
|
} else {
|
||||||
|
navigate("/login/manual");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
position: "fixed",
|
||||||
|
top: "50%",
|
||||||
|
left: "50%",
|
||||||
|
transform: "translate(-50%, -50%)",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<CircularProgress size={72} thickness={1.4} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const AnimationWrapper = () => {
|
const AnimationWrapper = () => {
|
||||||
return (
|
return (
|
||||||
<motion.div
|
<motion.div
|
||||||
@@ -172,125 +159,10 @@ const AnimationWrapper = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
const [serverReachable, setServerReachable] = useState(true);
|
|
||||||
|
|
||||||
const [playbackDataLoading] = usePlaybackDataLoadStore((state) => [
|
const [playbackDataLoading] = usePlaybackDataLoadStore((state) => [
|
||||||
state.isLoading,
|
state.isPending,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const { enqueueSnackbar } = useSnackbar();
|
|
||||||
|
|
||||||
const createApi = async () => {
|
|
||||||
const server = await getServer();
|
|
||||||
event.emit("create-jellyfin-api", server.Ip);
|
|
||||||
};
|
|
||||||
|
|
||||||
const serverAvailable = async () => {
|
|
||||||
const server = await getServer();
|
|
||||||
|
|
||||||
if (server == null) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const usersAvailable = async () => {
|
|
||||||
const users = await getUserApi(window.api).getPublicUsers();
|
|
||||||
if (users.status == 200 || users.data.length >= 1) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const userSaved = async () => {
|
|
||||||
const user = await getUser();
|
|
||||||
if (user == null) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const pingServer = async () => {
|
|
||||||
const server = await getServer();
|
|
||||||
try {
|
|
||||||
const result = await axios.get(
|
|
||||||
new URL(`${server.Ip}/System/Ping`).href,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (result.data == "Jellyfin Server") {
|
|
||||||
event.emit("create-jellyfin-api", server.Ip);
|
|
||||||
setServerReachable(true);
|
|
||||||
} else {
|
|
||||||
setServerReachable(false);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
setServerReachable(false);
|
|
||||||
enqueueSnackbar("Unable to verfiy server address.", {
|
|
||||||
variant: "error",
|
|
||||||
});
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
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);
|
|
||||||
};
|
|
||||||
|
|
||||||
const LogicalRoutes = () => {
|
|
||||||
serverAvailable().then(async (server) => {
|
|
||||||
if (server == true) {
|
|
||||||
createApi().then(() => {
|
|
||||||
pingServer();
|
|
||||||
if (serverReachable == true) {
|
|
||||||
userSaved().then((user_available) => {
|
|
||||||
if (user_available == true) {
|
|
||||||
navigate("/home");
|
|
||||||
} else {
|
|
||||||
usersAvailable().then(
|
|
||||||
(users_list_available) => {
|
|
||||||
if (
|
|
||||||
users_list_available ==
|
|
||||||
true
|
|
||||||
) {
|
|
||||||
navigate("/login/users");
|
|
||||||
} else {
|
|
||||||
navigate(
|
|
||||||
"/login/manual",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
navigate("/setup/server");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const LoginLogicalRoutes = () => {
|
|
||||||
usersAvailable().then((users_list_available) => {
|
|
||||||
if (users_list_available == true) {
|
|
||||||
navigate("/login/users");
|
|
||||||
} else {
|
|
||||||
navigate("/login/manual");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleRelaunch = async (event, reason) => {
|
const handleRelaunch = async (event, reason) => {
|
||||||
if (reason && reason == "backdropClick") {
|
if (reason && reason == "backdropClick") {
|
||||||
return;
|
return;
|
||||||
@@ -298,35 +170,13 @@ function App() {
|
|||||||
await relaunch();
|
await relaunch();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRemoveServer = async () => {
|
|
||||||
await delServer();
|
|
||||||
await delUser();
|
|
||||||
await relaunch();
|
|
||||||
};
|
|
||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
}, [location.key]);
|
}, [location.key]);
|
||||||
|
|
||||||
if (!window.api) {
|
const [audioPlayerVisible] = useAudioPlayback((state) => [state.display]);
|
||||||
serverAvailable().then((available) => {
|
|
||||||
if (available) {
|
|
||||||
createApi().then(
|
|
||||||
userSaved().then((userSavedBool) => {
|
|
||||||
if (userSavedBool) {
|
|
||||||
userLogin();
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const [audioPlayerVisible, currentAudioIndex] = useAudioPlayback(
|
|
||||||
(state) => [state.display, state.currentTrack],
|
|
||||||
);
|
|
||||||
|
|
||||||
const [backdropUrl, backdropId] = useBackdropStore((state) => [
|
const [backdropUrl, backdropId] = useBackdropStore((state) => [
|
||||||
state.backdropUrl,
|
state.backdropUrl,
|
||||||
@@ -355,6 +205,23 @@ function App() {
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const [initialRoute] = useCentralStore((state) => [state.initialRoute]);
|
||||||
|
|
||||||
|
const navigate = useNavigate();
|
||||||
|
if (!initialRoute) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
position: "fixed",
|
||||||
|
top: "50%",
|
||||||
|
left: "50%",
|
||||||
|
transform: "translate(-50%, -50%)",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<CircularProgress size={72} thickness={1.4} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
} else if (initialRoute) {
|
||||||
return (
|
return (
|
||||||
<SnackbarProvider maxSnack={5}>
|
<SnackbarProvider maxSnack={5}>
|
||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
@@ -382,7 +249,6 @@ function App() {
|
|||||||
height="315"
|
height="315"
|
||||||
src="https://www.youtube.com/embed/dQw4w9WgXcQ?autoplay=1&disablekb=1"
|
src="https://www.youtube.com/embed/dQw4w9WgXcQ?autoplay=1&disablekb=1"
|
||||||
title="EasterEgg"
|
title="EasterEgg"
|
||||||
frameborder="0"
|
|
||||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||||
></iframe>
|
></iframe>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
@@ -407,33 +273,7 @@ function App() {
|
|||||||
</Slide>
|
</Slide>
|
||||||
|
|
||||||
{/* Show Dialog if server not reachable */}
|
{/* 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>
|
|
||||||
<div className="app-backdrop-container">
|
<div className="app-backdrop-container">
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
<motion.img
|
<motion.img
|
||||||
@@ -445,28 +285,35 @@ function App() {
|
|||||||
opacity: 0,
|
opacity: 0,
|
||||||
}}
|
}}
|
||||||
animate={{
|
animate={{
|
||||||
opacity: backdropLoading ? 0 : 0.5,
|
opacity: backdropLoading ? 0 : 0.6,
|
||||||
}}
|
}}
|
||||||
exit={{
|
exit={{
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
}}
|
}}
|
||||||
transition={{
|
transition={{
|
||||||
duration: 0.5,
|
duration: 0.8,
|
||||||
ease: "easeInOut",
|
ease: "easeInOut",
|
||||||
}}
|
}}
|
||||||
onLoad={() => setBackdropLoading(false)}
|
onLoadCapture={() => {
|
||||||
|
setBackdropLoading(true);
|
||||||
|
}}
|
||||||
|
onLoad={() => {
|
||||||
|
setBackdropLoading(false);
|
||||||
|
}}
|
||||||
loading="eager"
|
loading="eager"
|
||||||
style={{
|
style={{
|
||||||
transition: "opacity 1s",
|
transition: "opacity 0.8s",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
className={
|
||||||
|
audioPlayerVisible ? "audio-playing" : ""
|
||||||
|
}
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
width: "100vw",
|
width: "100vw",
|
||||||
paddingBottom: audioPlayerVisible ? "8em" : "0",
|
|
||||||
transition: "padding 250ms",
|
transition: "padding 250ms",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -474,14 +321,74 @@ function App() {
|
|||||||
<SideMenu />
|
<SideMenu />
|
||||||
<AppBar />
|
<AppBar />
|
||||||
<AudioPlayer key={audioPlayerVisible} />
|
<AudioPlayer key={audioPlayerVisible} />
|
||||||
<Routes key={location.key} location={location}>
|
<Routes location={location}>
|
||||||
<Route element={<AnimationWrapper />}>
|
<Route
|
||||||
|
// key={location.key}
|
||||||
|
element={<AnimationWrapper />}
|
||||||
|
>
|
||||||
<Route
|
<Route
|
||||||
path="/"
|
path="/"
|
||||||
element={<LogicalRoutes />}
|
exact
|
||||||
|
element={
|
||||||
|
<Navigate to={initialRoute} />
|
||||||
|
}
|
||||||
|
// element={<></>}
|
||||||
|
/>
|
||||||
|
<Route
|
||||||
|
path="/error"
|
||||||
|
element={
|
||||||
|
<Dialog
|
||||||
|
open
|
||||||
|
onClose={handleRelaunch}
|
||||||
|
aria-labelledby="alert-dialog-text"
|
||||||
|
aria-describedby="alert-dialog-desc"
|
||||||
|
maxWidth="md"
|
||||||
|
>
|
||||||
|
<DialogTitle id="alert-dialog-text">
|
||||||
|
Unable to reach
|
||||||
|
server
|
||||||
|
</DialogTitle>
|
||||||
|
<DialogContent>
|
||||||
|
<DialogContentText id="alert-dialog-desc">
|
||||||
|
Unable to
|
||||||
|
connect to the
|
||||||
|
jellyfin
|
||||||
|
server.
|
||||||
|
</DialogContentText>
|
||||||
|
</DialogContent>
|
||||||
|
<DialogActions>
|
||||||
|
<Button
|
||||||
|
onClick={() =>
|
||||||
|
navigate(
|
||||||
|
"/servers/list",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Change Server
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant="outlined"
|
||||||
|
onClick={
|
||||||
|
handleRelaunch
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Restart
|
||||||
|
JellyPlayer
|
||||||
|
</Button>
|
||||||
|
</DialogActions>
|
||||||
|
</Dialog>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<Route
|
||||||
|
path="/login/index"
|
||||||
|
exact
|
||||||
|
element={<LoginRoute />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route path="/home" element={<Home />} />
|
<Route
|
||||||
|
path="/home"
|
||||||
|
element={<Home />}
|
||||||
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/setup/server"
|
path="/setup/server"
|
||||||
element={<ServerSetup />}
|
element={<ServerSetup />}
|
||||||
@@ -558,23 +465,22 @@ function App() {
|
|||||||
path="/settings"
|
path="/settings"
|
||||||
element={<Settings />}
|
element={<Settings />}
|
||||||
/>
|
/>
|
||||||
<Route path="/about" element={<About />} />
|
<Route
|
||||||
|
path="/about"
|
||||||
|
element={<About />}
|
||||||
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/player"
|
path="/player"
|
||||||
element={<VideoPlayer />}
|
element={<VideoPlayer />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
|
||||||
path="/login"
|
|
||||||
element={<LoginLogicalRoutes />}
|
|
||||||
/>
|
|
||||||
</Route>
|
</Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
</div>
|
</div>
|
||||||
<ReactQueryDevtools />
|
<ReactQueryDevtools buttonPosition="bottom-left" />
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</SnackbarProvider>
|
</SnackbarProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
After Width: | Height: | Size: 889 KiB |
@@ -0,0 +1,20 @@
|
|||||||
|
<svg width="1512" height="1512" viewBox="0 0 1512 1512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect width="1512" height="1512" rx="756" fill="url(#paint0_radial_33_14)"/>
|
||||||
|
<path d="M591.675 378.82C546.952 352.839 485.631 382.519 485.631 438.696V756.315L865.3 537.63L591.675 378.82Z" fill="url(#paint1_linear_33_14)"/>
|
||||||
|
<path d="M1164.33 721.71C1158.23 711.195 1149.47 702.478 1138.93 696.439L865.3 537.63L485.631 756.315V1073.93C485.631 1130.11 546.952 1159.79 591.675 1133.81L1138.93 816.192C1149.47 810.153 1158.23 801.435 1164.33 790.921C1170.42 780.407 1173.63 768.469 1173.63 756.315C1173.63 744.162 1170.42 732.224 1164.33 721.71Z" fill="url(#paint2_linear_33_14)"/>
|
||||||
|
<path d="M485.631 756.315V1073.93C485.631 1130.11 546.952 1159.79 591.675 1133.81L1138.93 816.192C1149.47 810.153 1158.23 801.435 1164.33 790.921C1170.42 780.407 1173.63 768.469 1173.63 756.315C1173.63 744.162 1170.42 732.224 1164.33 721.71C1158.23 711.195 1149.47 702.478 1138.93 696.439L865.3 537.63M485.631 756.315V438.696C485.631 382.519 546.952 352.839 591.675 378.82L865.3 537.63M485.631 756.315L865.3 537.63" stroke="white" stroke-width="84" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<defs>
|
||||||
|
<radialGradient id="paint0_radial_33_14" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(1512 1512) rotate(-135) scale(2138.29)">
|
||||||
|
<stop/>
|
||||||
|
<stop offset="1" stop-color="#474747"/>
|
||||||
|
</radialGradient>
|
||||||
|
<linearGradient id="paint1_linear_33_14" x1="485.631" y1="369.315" x2="1173.63" y2="1143.82" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#FB2576"/>
|
||||||
|
<stop offset="0.697961" stop-color="#150050"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="paint2_linear_33_14" x1="485.631" y1="369.315" x2="1173.63" y2="1143.82" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#FB2576"/>
|
||||||
|
<stop offset="0.697961" stop-color="#150050"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,25 @@
|
|||||||
|
<svg width="5020" height="475" viewBox="0 0 5020 475" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<path d="M184.178 464.934C154.522 464.934 126.954 458.251 101.475 444.885C75.9955 431.101 55.1108 412.305 38.8208 388.496C22.5308 364.688 12.9239 338.373 10 309.552H33.182C36.1058 334.196 44.6685 356.751 58.8701 377.218C73.0716 397.268 91.0324 413.14 112.752 424.835C134.89 436.113 158.699 441.752 184.178 441.752C212.163 441.752 237.852 434.86 261.242 421.076C284.633 407.292 303.22 388.287 317.004 364.061C330.788 339.835 337.68 312.685 337.68 282.611V42.6462H142.2V19.4642H360.236V282.611C360.236 316.862 352.299 347.98 336.427 375.965C320.972 403.533 299.67 425.253 272.52 441.125C245.788 456.998 216.34 464.934 184.178 464.934Z" fill="black"/>
|
||||||
|
<path d="M984.562 455.536V19.4642H1007.74V432.354H1311.62V455.536H984.562Z" fill="black"/>
|
||||||
|
<path d="M1448.35 455.536V19.4642H1471.53V432.354H1775.4V455.536H1448.35Z" fill="black"/>
|
||||||
|
<path d="M2389.08 455.536H2365.9V19.4642H2541.33C2570.57 19.4642 2597.51 25.7296 2622.15 38.2604C2647.21 50.7912 2667.05 68.5432 2681.67 91.5163C2696.29 114.489 2703.6 141.013 2703.6 171.087C2703.6 199.908 2696.08 226.431 2681.05 250.657C2666.43 274.883 2646.38 293.471 2620.9 306.419C2598.76 317.697 2572.24 323.336 2541.33 323.336H2389.08V455.536ZM2389.08 300.154H2541.33C2568.06 300.154 2589.99 295.977 2607.11 287.623C2629.25 277.181 2647 261.517 2660.37 240.633C2673.74 219.748 2680.42 196.566 2680.42 171.087C2680.42 146.025 2673.74 123.052 2660.37 102.167C2647 81.2828 2629.04 65.6193 2606.49 55.177C2589.36 46.8231 2567.64 42.6462 2541.33 42.6462H2389.08V300.154Z" fill="black"/>
|
||||||
|
<path d="M2839.71 455.536V19.4642H2862.89V432.354H3166.76V455.536H2839.71Z" fill="black"/>
|
||||||
|
<path d="M3747.86 19.4642L3902.61 252.537L4056.11 19.4642H4083.68L3913.89 276.972V455.536H3890.71V276.972L3720.29 19.4642H3747.86Z" fill="black"/>
|
||||||
|
<path d="M4215.4 19.4642H4522.41V42.6462H4238.58V219.33H4485.44V242.512H4238.58V432.354H4522.41V455.536H4215.4V19.4642Z" fill="black"/>
|
||||||
|
<path d="M2200.97 19.4642H2228.54L2058.74 276.972V455.536H2035.56V276.972L1865.14 19.4642H1892.71L2047.47 252.537L2200.97 19.4642Z" fill="black"/>
|
||||||
|
<path d="M505.113 19.4642H812.117V42.6462H528.295V219.33H775.152V242.512H528.295V432.354H812.117V455.536H505.113V19.4642Z" fill="black"/>
|
||||||
|
<mask id="mask0_941_19" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="3232" y="10" width="1778" height="446">
|
||||||
|
<path d="M4924.16 33.8748C4949.23 45.5702 4968.86 62.9044 4983.06 85.8775C4997.68 108.851 5004.99 134.33 5004.99 162.315C5004.99 194.895 4994.96 224.134 4974.91 250.031C4955.28 275.51 4924.58 295.842 4893.67 304.196L4674.8 19.4644H4840.83C4859.21 19.4644 4874.88 20.7174 4887.83 23.2236C4901.19 25.312 4913.3 28.8624 4924.16 33.8748Z" fill="black"/>
|
||||||
|
<path d="M5010 455.536L4893.67 304.196H4674.8V455.536H5010Z" fill="black"/>
|
||||||
|
<path d="M3643.7 455.536H3232.69L3438.2 10.0662L3643.7 455.536Z" fill="black"/>
|
||||||
|
</mask>
|
||||||
|
<g mask="url(#mask0_941_19)">
|
||||||
|
<rect x="3232" y="10" width="1778" height="446" fill="url(#pattern0)"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
|
||||||
|
<use xlink:href="#image0_941_19" transform="matrix(0 -0.000973278 0.000244141 0 0 2.49327)"/>
|
||||||
|
</pattern>
|
||||||
|
<image id="image0_941_19" width="4096" height="4096" xlink:href="data:image/png;base64,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 truncated
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 3.7 MiB |
|
After Width: | Height: | Size: 89 KiB |
@@ -1,28 +1,23 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
|
|
||||||
import { AnimatePresence, motion } from "framer-motion";
|
|
||||||
|
|
||||||
import { relaunch } from "@tauri-apps/api/process";
|
import { relaunch } from "@tauri-apps/api/process";
|
||||||
|
|
||||||
import MuiAppBar from "@mui/material/AppBar";
|
import MuiAppBar from "@mui/material/AppBar";
|
||||||
import TextField from "@mui/material/TextField";
|
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import Toolbar from "@mui/material/Toolbar";
|
import Toolbar from "@mui/material/Toolbar";
|
||||||
import Avatar from "@mui/material/Avatar";
|
import Avatar from "@mui/material/Avatar";
|
||||||
import Box from "@mui/material/Box";
|
|
||||||
import ListItemIcon from "@mui/material/ListItemIcon";
|
import ListItemIcon from "@mui/material/ListItemIcon";
|
||||||
import Menu from "@mui/material/Menu";
|
import Menu from "@mui/material/Menu";
|
||||||
import MenuItem from "@mui/material/MenuItem";
|
import MenuItem from "@mui/material/MenuItem";
|
||||||
import CircularProgress from "@mui/material/CircularProgress";
|
|
||||||
import useScrollTrigger from "@mui/material/useScrollTrigger";
|
import useScrollTrigger from "@mui/material/useScrollTrigger";
|
||||||
|
|
||||||
import { MdiMagnify } from "../icons/mdiMagnify";
|
import { red } from "@mui/material/colors";
|
||||||
|
|
||||||
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 { useIsMutating, useQuery } from "@tanstack/react-query";
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
|
|
||||||
import "./appBar.module.scss";
|
import "./appBar.module.scss";
|
||||||
import { MdiAccount } from "../icons/mdiAccount";
|
import { MdiAccount } from "../icons/mdiAccount";
|
||||||
@@ -36,9 +31,12 @@ import { delServer } from "../../utils/storage/servers";
|
|||||||
import { delUser } from "../../utils/storage/user";
|
import { delUser } from "../../utils/storage/user";
|
||||||
import { MdiDelete } from "../icons/mdiDelete";
|
import { MdiDelete } from "../icons/mdiDelete";
|
||||||
|
|
||||||
import logo from "../../assets/logo.png";
|
import { MdiLogoutVariant } from "../icons/mdiLogoutVariant";
|
||||||
|
import { EventEmitter as event } from "../../eventEmitter";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
export const AppBar = () => {
|
export const AppBar = () => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const [display, setDisplay] = useState(false);
|
const [display, setDisplay] = useState(false);
|
||||||
@@ -49,12 +47,17 @@ export const AppBar = () => {
|
|||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
enabled: display,
|
enabled: display,
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
});
|
});
|
||||||
|
useEffect(() => {
|
||||||
|
if (user.isError) {
|
||||||
|
console.error(user.error);
|
||||||
|
}
|
||||||
|
}, [user]);
|
||||||
|
|
||||||
const trigger = useScrollTrigger({
|
const trigger = useScrollTrigger({
|
||||||
disableHysteresis: true,
|
disableHysteresis: true,
|
||||||
@@ -70,17 +73,31 @@ export const AppBar = () => {
|
|||||||
setAnchorEl(null);
|
setAnchorEl(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const [setDrawerOpen] = useDrawerStore((state) => [state.setOpen]);
|
const [setDrawerOpen] = useDrawerStore((state) => [state.setOpen]);
|
||||||
|
|
||||||
const handleDrawerOpen = () => {
|
const handleDrawerOpen = () => {
|
||||||
setDrawerOpen(true);
|
setDrawerOpen(true);
|
||||||
};
|
};
|
||||||
|
const handleLogout = async () => {
|
||||||
|
console.log("Logging out user...");
|
||||||
|
await api.logout();
|
||||||
|
delUser();
|
||||||
|
sessionStorage.removeItem("accessToken");
|
||||||
|
event.emit("create-jellyfin-api", api.basePath);
|
||||||
|
queryClient.clear();
|
||||||
|
setAnchorEl(null);
|
||||||
|
navigate("/login/index");
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
location.pathname.includes("login") ||
|
location.pathname.includes("login") ||
|
||||||
location.pathname.includes("setup") ||
|
location.pathname.includes("setup") ||
|
||||||
|
location.pathname.includes("server") ||
|
||||||
location.pathname.includes("player") ||
|
location.pathname.includes("player") ||
|
||||||
|
location.pathname.includes("error") ||
|
||||||
location.pathname === "/"
|
location.pathname === "/"
|
||||||
) {
|
) {
|
||||||
setDisplay(false);
|
setDisplay(false);
|
||||||
@@ -106,6 +123,7 @@ export const AppBar = () => {
|
|||||||
style={{
|
style={{
|
||||||
backgroundColor: "transparent",
|
backgroundColor: "transparent",
|
||||||
paddingRight: "0 !important",
|
paddingRight: "0 !important",
|
||||||
|
width: "fit-content",
|
||||||
}}
|
}}
|
||||||
className={trigger ? "appBar backdropVisible" : "appBar"}
|
className={trigger ? "appBar backdropVisible" : "appBar"}
|
||||||
elevation={0}
|
elevation={0}
|
||||||
@@ -113,51 +131,33 @@ export const AppBar = () => {
|
|||||||
<Toolbar
|
<Toolbar
|
||||||
sx={{
|
sx={{
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
paddingLeft: "20px !important",
|
padding: "13px !important",
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: "flex",
|
display: "flex",
|
||||||
gap: "1em",
|
gap: "1.2em",
|
||||||
alignItems: "center",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<IconButton
|
|
||||||
color="inherit"
|
|
||||||
aria-label="open drawer"
|
|
||||||
onClick={handleDrawerOpen}
|
|
||||||
>
|
|
||||||
<MdiMenu />
|
|
||||||
</IconButton>
|
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() => navigate(-1)}
|
onClick={() => navigate(-1)}
|
||||||
sx={{
|
disabled={!backButtonVisible}
|
||||||
transition: "transform 0.2s",
|
|
||||||
transform: backButtonVisible
|
|
||||||
? "scale(1)"
|
|
||||||
: "scale(0)",
|
|
||||||
transformOrigin: "left",
|
|
||||||
ml: 2,
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<MdiArrowLeft />
|
<div className="material-symbols-rounded">
|
||||||
</IconButton>
|
arrow_back
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display: "flex", gap: "1.2em" }}>
|
</IconButton>
|
||||||
|
|
||||||
<IconButton onClick={() => navigate("/search")}>
|
<IconButton onClick={() => navigate("/search")}>
|
||||||
<MdiMagnify />
|
<div className="material-symbols-rounded">
|
||||||
|
search
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton disabled>
|
<IconButton onClick={() => navigate("/favorite")}>
|
||||||
<MdiHeartOutline />
|
<div className="material-symbols-rounded">
|
||||||
|
favorite
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton sx={{ p: 0 }} onClick={handleMenuOpen}>
|
||||||
sx={{ p: 0 }}
|
|
||||||
onClick={handleMenuOpen}
|
|
||||||
>
|
|
||||||
{user.isSuccess &&
|
{user.isSuccess &&
|
||||||
(user.data.PrimaryImageTag ==
|
(user.data.PrimaryImageTag == undefined ? (
|
||||||
undefined ? (
|
|
||||||
<Avatar
|
<Avatar
|
||||||
className="appBar-avatar"
|
className="appBar-avatar"
|
||||||
alt={user.data.Name}
|
alt={user.data.Name}
|
||||||
@@ -168,7 +168,7 @@ export const AppBar = () => {
|
|||||||
<Avatar
|
<Avatar
|
||||||
className="appBar-avatar"
|
className="appBar-avatar"
|
||||||
src={
|
src={
|
||||||
window.api.basePath +
|
api.basePath +
|
||||||
"/Users/" +
|
"/Users/" +
|
||||||
user.data.Id +
|
user.data.Id +
|
||||||
"/Images/Primary"
|
"/Images/Primary"
|
||||||
@@ -184,39 +184,48 @@ export const AppBar = () => {
|
|||||||
open={openMenu}
|
open={openMenu}
|
||||||
onClose={handleMenuClose}
|
onClose={handleMenuClose}
|
||||||
sx={{ mt: 1 }}
|
sx={{ mt: 1 }}
|
||||||
|
disableScrollLock
|
||||||
>
|
>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
onClick={() => navigate("/settings")}
|
onClick={() => navigate("/settings")}
|
||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<MdiCog />
|
<div className="material-symbols-rounded">
|
||||||
|
settings
|
||||||
|
</div>
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
Settings
|
Settings
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem onClick={() => navigate("/about")}>
|
||||||
onClick={() => navigate("/about")}
|
|
||||||
disabled
|
|
||||||
>
|
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<MdiInformation />
|
<div className="material-symbols-rounded">
|
||||||
|
info
|
||||||
|
</div>
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
About
|
About
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
<MenuItem onClick={handleLogout}>
|
||||||
|
<ListItemIcon>
|
||||||
|
<div className="material-symbols-rounded">
|
||||||
|
logout
|
||||||
|
</div>
|
||||||
|
</ListItemIcon>
|
||||||
|
Logout
|
||||||
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
await delServer();
|
navigate("/servers/list");
|
||||||
await delUser();
|
|
||||||
await relaunch();
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<MdiDelete />
|
<div className="material-symbols-rounded appBar-icon">
|
||||||
|
dns
|
||||||
|
</div>
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
Remove Server
|
Select Server
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
</div>
|
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
</MuiAppBar>
|
</MuiAppBar>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
.appBar {
|
.appBar {
|
||||||
|
top: 8px !important;
|
||||||
|
right: 8px !important;
|
||||||
|
border-radius: 10000px;
|
||||||
transition: background-color $transition-time-fast,
|
transition: background-color $transition-time-fast,
|
||||||
backdrop-filter $transition-time-fast,
|
backdrop-filter $transition-time-fast,
|
||||||
box-shadow $transition-time-default !important;
|
box-shadow $transition-time-default !important;
|
||||||
&.backdropVisible {
|
&.backdropVisible {
|
||||||
background-color: $clr-background-dark-opacity-0_8 !important;
|
background-color: rgb(0 0 0 / 0.6) !important;
|
||||||
backdrop-filter: blur(30px);
|
backdrop-filter: blur(10px);
|
||||||
}
|
}
|
||||||
&-avatar {
|
&-avatar {
|
||||||
background: $clr-gradient-dark;
|
background: $clr-gradient-dark;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
@@ -7,7 +8,10 @@ import { MdiAccount } from "../icons/mdiAccount";
|
|||||||
|
|
||||||
import "./avatar.module.scss";
|
import "./avatar.module.scss";
|
||||||
|
|
||||||
export const AvatarImage = ({ userId, userImageTags }) => {
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
|
export const AvatarImage = ({ userId }) => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
return (
|
return (
|
||||||
<Box className="avatar-image-container">
|
<Box className="avatar-image-container">
|
||||||
<div
|
<div
|
||||||
@@ -15,7 +19,7 @@ export const AvatarImage = ({ userId, userImageTags }) => {
|
|||||||
style={{
|
style={{
|
||||||
backgroundImage:
|
backgroundImage:
|
||||||
"url('" +
|
"url('" +
|
||||||
window.api.basePath +
|
api.basePath +
|
||||||
"/Users/" +
|
"/Users/" +
|
||||||
userId +
|
userId +
|
||||||
"/Images/Primary')",
|
"/Images/Primary')",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import { useEffect } from "react";
|
import React from "react";
|
||||||
|
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
|
|
||||||
@@ -13,6 +13,8 @@ import { MdiHeartOutline } from "../icons/mdiHeartOutline";
|
|||||||
import { useSnackbar } from "notistack";
|
import { useSnackbar } from "notistack";
|
||||||
import CircularProgress from "@mui/material/CircularProgress";
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
|
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
const LikeButton = ({
|
const LikeButton = ({
|
||||||
itemId,
|
itemId,
|
||||||
isFavorite,
|
isFavorite,
|
||||||
@@ -21,18 +23,18 @@ const LikeButton = ({
|
|||||||
itemName,
|
itemName,
|
||||||
color = "white",
|
color = "white",
|
||||||
}) => {
|
}) => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const { enqueueSnackbar } = useSnackbar();
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
|
|
||||||
const handleLiking = async () => {
|
const handleLiking = async () => {
|
||||||
let result;
|
|
||||||
if (isFavorite) {
|
if (isFavorite) {
|
||||||
result = await getUserLibraryApi(window.api).unmarkFavoriteItem({
|
await getUserLibraryApi(api).unmarkFavoriteItem({
|
||||||
userId: userId,
|
userId: userId,
|
||||||
itemId: itemId,
|
itemId: itemId,
|
||||||
});
|
});
|
||||||
} else if (!isFavorite) {
|
} else if (!isFavorite) {
|
||||||
result = await getUserLibraryApi(window.api).markFavoriteItem({
|
await getUserLibraryApi(api).markFavoriteItem({
|
||||||
userId: userId,
|
userId: userId,
|
||||||
itemId: itemId,
|
itemId: itemId,
|
||||||
});
|
});
|
||||||
@@ -40,7 +42,7 @@ const LikeButton = ({
|
|||||||
};
|
};
|
||||||
const mutation = useMutation({
|
const mutation = useMutation({
|
||||||
mutationFn: handleLiking,
|
mutationFn: handleLiking,
|
||||||
onError: (error, a, context) => {
|
onError: (error) => {
|
||||||
enqueueSnackbar(`${error}`, {
|
enqueueSnackbar(`${error}`, {
|
||||||
variant: "error",
|
variant: "error",
|
||||||
});
|
});
|
||||||
@@ -70,13 +72,13 @@ const LikeButton = ({
|
|||||||
>
|
>
|
||||||
<CircularProgress
|
<CircularProgress
|
||||||
style={{
|
style={{
|
||||||
opacity: mutation.isLoading ? 1 : 0,
|
opacity: mutation.isPending ? 1 : 0,
|
||||||
transition: "opacity 200ms",
|
transition: "opacity 200ms",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
if (!mutation.isLoading) {
|
if (!mutation.isPending) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
mutation.mutate();
|
mutation.mutate();
|
||||||
}
|
}
|
||||||
@@ -90,14 +92,27 @@ const LikeButton = ({
|
|||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
opacity: mutation.isLoading ? 0.5 : 1,
|
opacity: mutation.isPending ? 0.5 : 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isFavorite ? (
|
<div
|
||||||
<MdiHeart sx={{ color: pink[700] }} />
|
className="material-symbols-rounded"
|
||||||
) : (
|
style={
|
||||||
<MdiHeartOutline sx={{ color: color }} />
|
isFavorite
|
||||||
)}
|
? {
|
||||||
|
fontVariationSettings:
|
||||||
|
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||||
|
color: pink[700],
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
fontVariationSettings:
|
||||||
|
'"FILL" 0, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||||
|
color: "white",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>
|
||||||
|
favorite
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import { useEffect } from "react";
|
import React from "react";
|
||||||
|
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import CircularProgress from "@mui/material/CircularProgress";
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
@@ -12,19 +12,22 @@ import { green } from "@mui/material/colors";
|
|||||||
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||||
import { MdiCheck } from "../icons/mdiCheck";
|
import { MdiCheck } from "../icons/mdiCheck";
|
||||||
import { useSnackbar } from "notistack";
|
import { useSnackbar } from "notistack";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
|
const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const { enqueueSnackbar } = useSnackbar();
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
|
|
||||||
const handleMarking = async () => {
|
const handleMarking = async () => {
|
||||||
if (!isPlayed) {
|
if (!isPlayed) {
|
||||||
await getPlaystateApi(window.api).markPlayedItem({
|
await getPlaystateApi(api).markPlayedItem({
|
||||||
userId: userId,
|
userId: userId,
|
||||||
itemId: itemId,
|
itemId: itemId,
|
||||||
});
|
});
|
||||||
} else if (isPlayed) {
|
} else if (isPlayed) {
|
||||||
await getPlaystateApi(window.api).markUnplayedItem({
|
await getPlaystateApi(api).markUnplayedItem({
|
||||||
userId: userId,
|
userId: userId,
|
||||||
itemId: itemId,
|
itemId: itemId,
|
||||||
});
|
});
|
||||||
@@ -61,13 +64,13 @@ const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
|
|||||||
>
|
>
|
||||||
<CircularProgress
|
<CircularProgress
|
||||||
style={{
|
style={{
|
||||||
opacity: mutation.isLoading ? 1 : 0,
|
opacity: mutation.isPending ? 1 : 0,
|
||||||
transition: "opacity 200ms",
|
transition: "opacity 200ms",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
if (!mutation.isLoading) {
|
if (!mutation.isPending) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
mutation.mutate();
|
mutation.mutate();
|
||||||
}
|
}
|
||||||
@@ -81,14 +84,17 @@ const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
|
|||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
opacity: mutation.isLoading ? 0.5 : 1,
|
opacity: mutation.isPending ? 0.5 : 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<MdiCheck
|
<div
|
||||||
sx={{
|
className="material-symbols-rounded"
|
||||||
|
style={{
|
||||||
color: isPlayed ? green[400] : "white",
|
color: isPlayed ? green[400] : "white",
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
done
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Button from "@mui/material/Button";
|
import Button from "@mui/material/Button";
|
||||||
import Fab from "@mui/material/Fab";
|
import Fab from "@mui/material/Fab";
|
||||||
import LinearProgress from "@mui/material/LinearProgress";
|
import LinearProgress from "@mui/material/LinearProgress";
|
||||||
import { MdiPlayOutline } from "../icons/mdiPlayOutline";
|
import Typography from "@mui/material/Typography";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
setItem,
|
||||||
usePlaybackDataLoadStore,
|
usePlaybackDataLoadStore,
|
||||||
usePlaybackStore,
|
usePlaybackStore,
|
||||||
} from "../../utils/store/playback";
|
} from "../../utils/store/playback";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
import { useMutation } from "@tanstack/react-query";
|
||||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
|
||||||
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||||
import {
|
import {
|
||||||
@@ -22,6 +24,7 @@ import {
|
|||||||
import { useSnackbar } from "notistack";
|
import { useSnackbar } from "notistack";
|
||||||
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
||||||
import { getPlaylistsApi } from "@jellyfin/sdk/lib/utils/api/playlists-api";
|
import { getPlaylistsApi } from "@jellyfin/sdk/lib/utils/api/playlists-api";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
const PlayButton = ({
|
const PlayButton = ({
|
||||||
itemId,
|
itemId,
|
||||||
@@ -42,6 +45,8 @@ const PlayButton = ({
|
|||||||
playlistItemId = "",
|
playlistItemId = "",
|
||||||
trackIndex,
|
trackIndex,
|
||||||
}) => {
|
}) => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [
|
const [
|
||||||
setUrl,
|
setUrl,
|
||||||
@@ -49,16 +54,28 @@ const PlayButton = ({
|
|||||||
setDuration,
|
setDuration,
|
||||||
setItemId,
|
setItemId,
|
||||||
setItemName,
|
setItemName,
|
||||||
setSubtitleTracksStore,
|
setAudioStreamIndex,
|
||||||
setSelectedSubtitleTrack,
|
setVideoStreamIndex,
|
||||||
|
setSubtitleStreamIndex,
|
||||||
|
setMediaSourceId,
|
||||||
|
setUserId,
|
||||||
|
setMediaContainer,
|
||||||
|
setSeriesId,
|
||||||
|
setEpisodeIndex,
|
||||||
] = usePlaybackStore((state) => [
|
] = usePlaybackStore((state) => [
|
||||||
state.setUrl,
|
state.setUrl,
|
||||||
state.setPosition,
|
state.setPosition,
|
||||||
state.setDuration,
|
state.setDuration,
|
||||||
state.setItemId,
|
state.setItemId,
|
||||||
state.setItemName,
|
state.setItemName,
|
||||||
state.setSubtitleTracks,
|
state.setAudioStreamIndex,
|
||||||
state.setSelectedSubtitleTrack,
|
state.setVideoStreamIndex,
|
||||||
|
state.setSubtitleStreamIndex,
|
||||||
|
state.setMediaSourceId,
|
||||||
|
state.setUserId,
|
||||||
|
state.setMediaContainer,
|
||||||
|
state.setSeriesId,
|
||||||
|
state.setEpisodeIndex,
|
||||||
]);
|
]);
|
||||||
const [
|
const [
|
||||||
setAudioUrl,
|
setAudioUrl,
|
||||||
@@ -76,7 +93,7 @@ const PlayButton = ({
|
|||||||
state.setPlaylistItemId,
|
state.setPlaylistItemId,
|
||||||
]);
|
]);
|
||||||
const setPlaybackDataLoading = usePlaybackDataLoadStore(
|
const setPlaybackDataLoading = usePlaybackDataLoadStore(
|
||||||
(state) => state.setIsLoading,
|
(state) => state.setisPending,
|
||||||
);
|
);
|
||||||
|
|
||||||
const { enqueueSnackbar } = useSnackbar();
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
@@ -86,8 +103,15 @@ const PlayButton = ({
|
|||||||
mutationFn: async () => {
|
mutationFn: async () => {
|
||||||
setPlaybackDataLoading(true);
|
setPlaybackDataLoading(true);
|
||||||
let result;
|
let result;
|
||||||
if (itemType == "Series") {
|
if (playlistItem) {
|
||||||
result = await getTvShowsApi(window.api).getEpisodes({
|
result = await getPlaylistsApi(api).getPlaylistItems({
|
||||||
|
userId: userId,
|
||||||
|
playlistId: playlistItemId,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
switch (itemType) {
|
||||||
|
case BaseItemKind.Series:
|
||||||
|
result = await getTvShowsApi(api).getEpisodes({
|
||||||
seriesId: itemId,
|
seriesId: itemId,
|
||||||
limit: 1,
|
limit: 1,
|
||||||
startIndex: 0,
|
startIndex: 0,
|
||||||
@@ -95,16 +119,19 @@ const PlayButton = ({
|
|||||||
ItemFields.MediaSources,
|
ItemFields.MediaSources,
|
||||||
ItemFields.MediaStreams,
|
ItemFields.MediaStreams,
|
||||||
],
|
],
|
||||||
|
enableUserData: true,
|
||||||
});
|
});
|
||||||
} else if (itemType == BaseItemKind.Playlist || playlistItem) {
|
break;
|
||||||
result = await getPlaylistsApi(window.api).getPlaylistItems(
|
case BaseItemKind.Playlist:
|
||||||
{
|
result = await getPlaylistsApi(
|
||||||
|
api,
|
||||||
|
).getPlaylistItems({
|
||||||
userId: userId,
|
userId: userId,
|
||||||
playlistId: playlistItemId,
|
playlistId: playlistItemId,
|
||||||
},
|
});
|
||||||
);
|
break;
|
||||||
} else if (itemType == BaseItemKind.MusicAlbum) {
|
case BaseItemKind.MusicAlbum:
|
||||||
result = await getItemsApi(window.api).getItems({
|
result = await getItemsApi(api).getItems({
|
||||||
parentId: itemId,
|
parentId: itemId,
|
||||||
userId: userId,
|
userId: userId,
|
||||||
fields: [
|
fields: [
|
||||||
@@ -114,8 +141,9 @@ const PlayButton = ({
|
|||||||
sortOrder: SortOrder.Ascending,
|
sortOrder: SortOrder.Ascending,
|
||||||
sortBy: "IndexNumber",
|
sortBy: "IndexNumber",
|
||||||
});
|
});
|
||||||
} else if (itemType == BaseItemKind.MusicArtist) {
|
break;
|
||||||
result = await getItemsApi(window.api).getItems({
|
case BaseItemKind.MusicArtist:
|
||||||
|
result = await getItemsApi(api).getItems({
|
||||||
artistIds: [itemId],
|
artistIds: [itemId],
|
||||||
recursive: true,
|
recursive: true,
|
||||||
includeItemTypes: [BaseItemKind.Audio],
|
includeItemTypes: [BaseItemKind.Audio],
|
||||||
@@ -125,10 +153,15 @@ const PlayButton = ({
|
|||||||
ItemFields.MediaStreams,
|
ItemFields.MediaStreams,
|
||||||
],
|
],
|
||||||
sortOrder: SortOrder.Ascending,
|
sortOrder: SortOrder.Ascending,
|
||||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
sortBy: [
|
||||||
|
"PremiereDate",
|
||||||
|
"ProductionYear",
|
||||||
|
"SortName",
|
||||||
|
],
|
||||||
});
|
});
|
||||||
} else {
|
break;
|
||||||
result = await getItemsApi(window.api).getItems({
|
default:
|
||||||
|
result = await getItemsApi(api).getItems({
|
||||||
ids: [itemId],
|
ids: [itemId],
|
||||||
userId: userId,
|
userId: userId,
|
||||||
fields: [
|
fields: [
|
||||||
@@ -138,35 +171,138 @@ const PlayButton = ({
|
|||||||
sortOrder: SortOrder.Ascending,
|
sortOrder: SortOrder.Ascending,
|
||||||
sortBy: "IndexNumber",
|
sortBy: "IndexNumber",
|
||||||
});
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
onSuccess: (item) => {
|
onSuccess: (item) => {
|
||||||
if (audio) {
|
console.log(item.Items[0].MediaSources);
|
||||||
|
if (trackIndex) {
|
||||||
|
setPlaylistItemId(playlistItemId);
|
||||||
setCurrentTrack(trackIndex);
|
setCurrentTrack(trackIndex);
|
||||||
setAudioTracks(item.Items);
|
setAudioTracks(item.Items);
|
||||||
setAudioUrl(
|
setAudioUrl(
|
||||||
`${window.api.basePath}/Audio/${item.Items[trackIndex].Id}/universal?deviceId=${window.api.deviceInfo.id}&userId=${userId}&api_key=${window.api.accessToken}`,
|
`${api.basePath}/Audio/${item.Items[trackIndex].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${userId}&api_key=${api.accessToken}`,
|
||||||
);
|
);
|
||||||
setAudioItem(item.Items[trackIndex]);
|
setAudioItem(item.Items[trackIndex]);
|
||||||
setPlaylistItemId(playlistItemId);
|
setAudioDisplay(true);
|
||||||
|
} else if (audio) {
|
||||||
|
setAudioItem(item.Items[0]);
|
||||||
|
setAudioTracks(item.Items);
|
||||||
|
setAudioUrl(
|
||||||
|
`${api.basePath}/Audio/${item.Items[0].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${userId}&api_key=${api.accessToken}`,
|
||||||
|
);
|
||||||
setAudioDisplay(true);
|
setAudioDisplay(true);
|
||||||
} else {
|
} else {
|
||||||
setUrl(
|
setUserId(userId);
|
||||||
`${window.api.basePath}/Videos/${item.Items[0].Id}/stream.
|
|
||||||
${item.Items[0].MediaSources[0].Container}
|
|
||||||
?Static=true&mediaSourceId=${item.Items[0].Id}&deviceId=${window.api.deviceInfo.id}&api_key=${window.api.accessToken}&Tag=${item.Items[0].MediaSources[0].ETag}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`,
|
|
||||||
);
|
|
||||||
setPosition(item.Items[0].UserData?.PlaybackPositionTicks);
|
|
||||||
setItemName(
|
|
||||||
item.Items[0].Type == "Episode"
|
|
||||||
? `${item.Items[0].SeriesName} S${item.Items[0].ParentIndexNumber}:E${item.Items[0].IndexNumber} ${item.Items[0].Name}`
|
|
||||||
: item.Items[0].Name,
|
|
||||||
);
|
|
||||||
setItemId(item.Items[0].Id);
|
setItemId(item.Items[0].Id);
|
||||||
setDuration(item.Items[0].RunTimeTicks);
|
setDuration(item.Items[0].RunTimeTicks);
|
||||||
// setSubtitleTracksStore(subtitleTracks);
|
|
||||||
setSelectedSubtitleTrack(currentSubTrack);
|
if (item.Items[0].Type == BaseItemKind.Episode) {
|
||||||
|
setSeriesId(item.Items[0].SeriesId);
|
||||||
|
// setEpisodeIndex(item.Ite)
|
||||||
|
}
|
||||||
|
|
||||||
|
setMediaContainer(item.Items[0].MediaSources[0].Container);
|
||||||
|
// Set all required stream index
|
||||||
|
setAudioStreamIndex(currentAudioTrack);
|
||||||
|
setVideoStreamIndex(currentVideoTrack);
|
||||||
|
setSubtitleStreamIndex(currentSubTrack);
|
||||||
|
|
||||||
|
setMediaSourceId(item.Items[0].Id);
|
||||||
|
setItem(item.Items[0]);
|
||||||
|
|
||||||
|
switch (item.Items[0].Type) {
|
||||||
|
case BaseItemKind.Movie:
|
||||||
|
if (item.Items[0].ImageBlurHashes.Logo) {
|
||||||
|
setItemName(
|
||||||
|
<div className="video-osd-name">
|
||||||
|
<img
|
||||||
|
src={`${api.basePath}/Items/${item.Items[0].Id}/Images/Logo`}
|
||||||
|
className="video-osd-name-logo"
|
||||||
|
onLoad={(e) => {
|
||||||
|
e.target.style.opacity = 1;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
setItemName(
|
||||||
|
<div className="video-osd-name">
|
||||||
|
<Typography variant="h6">
|
||||||
|
{item.Items[0].Name}
|
||||||
|
</Typography>
|
||||||
|
</div>,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case BaseItemKind.Episode:
|
||||||
|
if (item.Items[0].ImageBlurHashes.Logo) {
|
||||||
|
setItemName(
|
||||||
|
<div className="video-osd-name">
|
||||||
|
<img
|
||||||
|
src={`${api.basePath}/Items/${item.Items[0].SeriesId}/Images/Logo`}
|
||||||
|
className="video-osd-name-logo"
|
||||||
|
onLoad={(e) => {
|
||||||
|
e.target.style.opacity = 1;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
S
|
||||||
|
{
|
||||||
|
item.Items[0]
|
||||||
|
.ParentIndexNumber
|
||||||
|
}
|
||||||
|
:E
|
||||||
|
{
|
||||||
|
item.Items[0].IndexNumber
|
||||||
|
}{" "}
|
||||||
|
{item.Items[0].Name}
|
||||||
|
</Typography>
|
||||||
|
</div>,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
setItemName(
|
||||||
|
<div className="video-osd-name">
|
||||||
|
<Typography variant="h6">
|
||||||
|
{item.Items[0].SeriesName}
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
S
|
||||||
|
{
|
||||||
|
item.Items[0]
|
||||||
|
.ParentIndexNumber
|
||||||
|
}
|
||||||
|
:E
|
||||||
|
{
|
||||||
|
item.Items[0].IndexNumber
|
||||||
|
}{" "}
|
||||||
|
{item.Items[0].Name}
|
||||||
|
</Typography>
|
||||||
|
</div>,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
setItemName(
|
||||||
|
<div className="video-osd-name">
|
||||||
|
<Typography variant="h6">
|
||||||
|
{item.Items[0].Name}
|
||||||
|
</Typography>
|
||||||
|
</div>,
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
setPosition(item.Items[0].UserData?.PlaybackPositionTicks);
|
||||||
|
|
||||||
|
setUrl(
|
||||||
|
`${api.basePath}/Videos/${item.Items[0].Id}/stream.
|
||||||
|
${item.Items[0].MediaSources[0].Container}
|
||||||
|
?Static=true&mediaSourceId=${item.Items[0].Id}&deviceId=${api.deviceInfo.id}&api_key=${api.accessToken}&Tag=${item.Items[0].MediaSources[0].ETag}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`,
|
||||||
|
);
|
||||||
|
|
||||||
navigate(`/player`);
|
navigate(`/player`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -194,7 +330,14 @@ const PlayButton = ({
|
|||||||
size={size}
|
size={size}
|
||||||
{...buttonProps}
|
{...buttonProps}
|
||||||
>
|
>
|
||||||
<MdiPlayOutline {...iconProps} />
|
<div
|
||||||
|
className="material-symbols-rounded em-4"
|
||||||
|
style={{
|
||||||
|
fontSize: "3em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
play_arrow
|
||||||
|
</div>
|
||||||
</Fab>
|
</Fab>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -203,7 +346,16 @@ const PlayButton = ({
|
|||||||
className={className}
|
className={className}
|
||||||
variant="contained"
|
variant="contained"
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
startIcon={<MdiPlayOutline />}
|
startIcon={
|
||||||
|
<div
|
||||||
|
className="material-symbols-rounded"
|
||||||
|
style={{
|
||||||
|
fontSize: "2em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
play_arrow
|
||||||
|
</div>
|
||||||
|
}
|
||||||
{...buttonProps}
|
{...buttonProps}
|
||||||
sx={{
|
sx={{
|
||||||
position: "relative",
|
position: "relative",
|
||||||
|
|||||||
@@ -1,32 +1,17 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import PropTypes from "prop-types";
|
import React from "react";
|
||||||
|
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
import MuiCard from "@mui/material/Card";
|
import MuiCard from "@mui/material/Card";
|
||||||
import CardActionArea from "@mui/material/CardActionArea";
|
import CardActionArea from "@mui/material/CardActionArea";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import LinearProgress from "@mui/material/LinearProgress";
|
|
||||||
|
|
||||||
import { Blurhash } from "react-blurhash";
|
import { Blurhash } from "react-blurhash";
|
||||||
|
|
||||||
import { TypeIconCollectionCard } from "../utils/iconsCollection";
|
|
||||||
import "./card.module.scss";
|
|
||||||
import { MdiCheck } from "../icons/mdiCheck";
|
|
||||||
|
|
||||||
import LikeButton from "../buttons/likeButton";
|
|
||||||
import MarkPlayedButton from "../buttons/markPlayedButton";
|
|
||||||
import PlayButton from "../buttons/playButton";
|
|
||||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
|
||||||
import { MdiAccountTie } from "../icons/mdiAccountTie";
|
import { MdiAccountTie } from "../icons/mdiAccountTie";
|
||||||
|
|
||||||
const cardImageAspectRatios = {
|
import "./card.module.scss";
|
||||||
thumb: 1.777,
|
import { useApi } from "../../utils/store/api";
|
||||||
portrait: 0.666,
|
|
||||||
square: 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
const availableSpecialRoutes = [BaseItemKind.Series];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Props
|
* @typedef {Object} Props
|
||||||
@@ -56,20 +41,17 @@ export const ActorCard = ({
|
|||||||
onClick,
|
onClick,
|
||||||
disablePadding,
|
disablePadding,
|
||||||
}) => {
|
}) => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const defaultOnClick = () => {
|
const defaultOnClick = () => {
|
||||||
navigate(`/person/${item.Id}`);
|
navigate(`/person/${item.Id}`);
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<CardActionArea
|
<div
|
||||||
style={{
|
className="card card-actor"
|
||||||
padding: disablePadding ? 0 : "0.6em",
|
elevation={0}
|
||||||
borderRadius: "calc(0.6em + 6px)",
|
onClick={onClick ? onClick : defaultOnClick}
|
||||||
}}
|
|
||||||
className="card-container"
|
|
||||||
onClick={!!onClick ? onClick : defaultOnClick}
|
|
||||||
>
|
>
|
||||||
<MuiCard className="card card-actor" elevation={0}>
|
|
||||||
<div className="card-box">
|
<div className="card-box">
|
||||||
<div
|
<div
|
||||||
className="card-image-container"
|
className="card-image-container"
|
||||||
@@ -88,11 +70,13 @@ export const ActorCard = ({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<div className="card-image-icon-container">
|
<div className="card-image-icon-container">
|
||||||
<MdiAccountTie className="card-image-icon" />
|
<div className="material-symbols-rounded">
|
||||||
|
person
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<img
|
<img
|
||||||
src={window.api.getItemImageUrl(
|
src={api.getItemImageUrl(
|
||||||
!!seriesId ? item.SeriesId : item.Id,
|
seriesId ? item.SeriesId : item.Id,
|
||||||
"Primary",
|
"Primary",
|
||||||
{
|
{
|
||||||
quality: 80,
|
quality: 80,
|
||||||
@@ -134,7 +118,6 @@ export const ActorCard = ({
|
|||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</MuiCard>
|
</div>
|
||||||
</CardActionArea>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import PropTypes from "prop-types";
|
import React from "react";
|
||||||
|
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ import LinearProgress from "@mui/material/LinearProgress";
|
|||||||
|
|
||||||
import { Blurhash } from "react-blurhash";
|
import { Blurhash } from "react-blurhash";
|
||||||
|
|
||||||
import { TypeIconCollectionCard } from "../utils/iconsCollection";
|
import { getTypeIcon } from "../utils/iconsCollection";
|
||||||
import "./card.module.scss";
|
import "./card.module.scss";
|
||||||
import { MdiCheck } from "../icons/mdiCheck";
|
import { MdiCheck } from "../icons/mdiCheck";
|
||||||
|
|
||||||
@@ -18,6 +18,7 @@ import LikeButton from "../buttons/likeButton";
|
|||||||
import MarkPlayedButton from "../buttons/markPlayedButton";
|
import MarkPlayedButton from "../buttons/markPlayedButton";
|
||||||
import PlayButton from "../buttons/playButton";
|
import PlayButton from "../buttons/playButton";
|
||||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
const cardImageAspectRatios = {
|
const cardImageAspectRatios = {
|
||||||
thumb: 1.777,
|
thumb: 1.777,
|
||||||
@@ -73,6 +74,7 @@ export const Card = ({
|
|||||||
disablePadding,
|
disablePadding,
|
||||||
overrideIcon,
|
overrideIcon,
|
||||||
}) => {
|
}) => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const defaultOnClick = () => {
|
const defaultOnClick = () => {
|
||||||
if (availableSpecialRoutes.includes(item.Type)) {
|
if (availableSpecialRoutes.includes(item.Type)) {
|
||||||
@@ -86,15 +88,12 @@ export const Card = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<CardActionArea
|
<div
|
||||||
style={{
|
className="card"
|
||||||
padding: disablePadding ? 0 : "0.6em",
|
elevation={0}
|
||||||
borderRadius: "calc(0.6em + 6px)",
|
tabIndex={0}
|
||||||
}}
|
onClick={onClick ? onClick : defaultOnClick}
|
||||||
className="card-container"
|
|
||||||
onClick={!!onClick ? onClick : defaultOnClick}
|
|
||||||
>
|
>
|
||||||
<MuiCard className="card" elevation={0}>
|
|
||||||
<div className="card-box">
|
<div className="card-box">
|
||||||
<div
|
<div
|
||||||
className="card-image-container"
|
className="card-image-container"
|
||||||
@@ -112,12 +111,14 @@ export const Card = ({
|
|||||||
: 0,
|
: 0,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<MdiCheck />
|
<div className="material-symbols-rounded">
|
||||||
|
done
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className={`card-indicator text`}
|
className={`card-indicator text`}
|
||||||
style={{
|
style={{
|
||||||
opacity: !!item.UserData
|
opacity: item.UserData
|
||||||
?.UnplayedItemCount
|
?.UnplayedItemCount
|
||||||
? 1
|
? 1
|
||||||
: 0,
|
: 0,
|
||||||
@@ -128,15 +129,12 @@ export const Card = ({
|
|||||||
padding="0.1em 0.4em"
|
padding="0.1em 0.4em"
|
||||||
fontWeight={400}
|
fontWeight={400}
|
||||||
>
|
>
|
||||||
{
|
{item.UserData?.UnplayedItemCount}
|
||||||
item.UserData
|
|
||||||
?.UnplayedItemCount
|
|
||||||
}
|
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{!!imageBlurhash && (
|
{/* {!!imageBlurhash && (
|
||||||
<Blurhash
|
<Blurhash
|
||||||
hash={imageBlurhash}
|
hash={imageBlurhash}
|
||||||
width={128}
|
width={128}
|
||||||
@@ -145,18 +143,18 @@ export const Card = ({
|
|||||||
resolutionY={24}
|
resolutionY={24}
|
||||||
className="card-image-blurhash"
|
className="card-image-blurhash"
|
||||||
/>
|
/>
|
||||||
)}
|
)} */}
|
||||||
<div className="card-image-icon-container">
|
<div className="card-image-icon-container">
|
||||||
{!!overrideIcon
|
{overrideIcon
|
||||||
? TypeIconCollectionCard[overrideIcon]
|
? getTypeIcon(overrideIcon)
|
||||||
: TypeIconCollectionCard[item.Type]}
|
: getTypeIcon(item.Type)}
|
||||||
</div>
|
</div>
|
||||||
<img
|
<img
|
||||||
src={
|
src={
|
||||||
overrideIcon == "User"
|
overrideIcon == "User"
|
||||||
? `${window.api.basePath}/Users/${item.Id}/Images/Primary`
|
? `${api.basePath}/Users/${item.Id}/Images/Primary`
|
||||||
: window.api.getItemImageUrl(
|
: api.getItemImageUrl(
|
||||||
!!seriesId
|
seriesId
|
||||||
? item.SeriesId
|
? item.SeriesId
|
||||||
: item.AlbumId
|
: item.AlbumId
|
||||||
? item.AlbumId
|
? item.AlbumId
|
||||||
@@ -195,25 +193,20 @@ export const Card = ({
|
|||||||
audio={
|
audio={
|
||||||
item.Type ==
|
item.Type ==
|
||||||
BaseItemKind.MusicAlbum ||
|
BaseItemKind.MusicAlbum ||
|
||||||
item.Type ==
|
item.Type == BaseItemKind.Audio ||
|
||||||
BaseItemKind.Audio ||
|
|
||||||
item.Type ==
|
item.Type ==
|
||||||
BaseItemKind.AudioBook ||
|
BaseItemKind.AudioBook ||
|
||||||
item.Type ==
|
item.Type == BaseItemKind.Playlist
|
||||||
BaseItemKind.Playlist
|
|
||||||
}
|
}
|
||||||
playlistItem={
|
playlistItem={
|
||||||
item.Type ==
|
item.Type == BaseItemKind.Playlist
|
||||||
BaseItemKind.Playlist
|
|
||||||
}
|
}
|
||||||
playlistItemId={item.Id}
|
playlistItemId={item.Id}
|
||||||
/>
|
/>
|
||||||
<LikeButton
|
<LikeButton
|
||||||
itemId={item.Id}
|
itemId={item.Id}
|
||||||
itemName={item.Name}
|
itemName={item.Name}
|
||||||
isFavorite={
|
isFavorite={item.UserData?.IsFavorite}
|
||||||
item.UserData?.IsFavorite
|
|
||||||
}
|
|
||||||
queryKey={queryKey}
|
queryKey={queryKey}
|
||||||
userId={userId}
|
userId={userId}
|
||||||
/>
|
/>
|
||||||
@@ -269,7 +262,6 @@ export const Card = ({
|
|||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</MuiCard>
|
</div>
|
||||||
</CardActionArea>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
overflow: visible !important;
|
overflow: visible !important;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
|
padding: 0.4em;
|
||||||
&-box {
|
&-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -17,7 +18,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
transition: opacity $transition-time-fast;
|
transition: all $transition-time-fast;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -25,28 +26,32 @@
|
|||||||
&-container {
|
&-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: $border-radius-default;
|
border-radius: 8px;
|
||||||
box-shadow: 0 4px 8px rgb(0 0 0 / 0.2);
|
box-shadow: 0 4px 8px rgb(0 0 0 / 0.2);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
height: auto;
|
height: auto;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
}
|
}
|
||||||
&-icon {
|
&-icon {
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
font-size: 5.4em !important;
|
font-size: 5.4em !important;
|
||||||
fill: url(#clr-gradient-default) !important;
|
fill: url(#clr-gradient-default) !important;
|
||||||
color: transparent;
|
|
||||||
&-container {
|
&-container {
|
||||||
background: $clr-gradient-dark;
|
background: rgb(255 255 255 / 0.1);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
transition: filter $transition-time-default;
|
||||||
|
.material-symbols-rounded {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
color: rgb(255 255 255 / 0.5);
|
||||||
|
font-size: 4em !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-blurhash {
|
&-blurhash {
|
||||||
@@ -56,6 +61,8 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
height: 100% !important;
|
height: 100% !important;
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-overlay {
|
&-overlay {
|
||||||
@@ -64,7 +71,6 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
background: rgb(0 0 0 / 0.6);
|
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity $transition-time-default;
|
transition: opacity $transition-time-default;
|
||||||
@@ -72,14 +78,28 @@
|
|||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
&:hover,
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
|
.card-image {
|
||||||
|
filter: brightness(0.6);
|
||||||
|
}
|
||||||
|
.card-image-icon-container {
|
||||||
|
filter: brightness(0.6);
|
||||||
}
|
}
|
||||||
&-container:hover,
|
|
||||||
&-container:focus,
|
|
||||||
&-container:focus-within {
|
|
||||||
.card-overlay {
|
.card-overlay {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
&-play-button {
|
&-play-button {
|
||||||
position: absolute !important;
|
position: absolute !important;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
@@ -102,11 +122,6 @@
|
|||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
box-shadow: 0 0 5px rgb(0 0 0 / 0.2);
|
box-shadow: 0 0 5px rgb(0 0 0 / 0.2);
|
||||||
}
|
}
|
||||||
&-text {
|
|
||||||
&-container {
|
|
||||||
height: 15%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-episode {
|
&-episode {
|
||||||
.card-box {
|
.card-box {
|
||||||
height: unset !important;
|
height: unset !important;
|
||||||
@@ -114,6 +129,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&-actor {
|
&-actor {
|
||||||
|
transition: all $transition-time-default;
|
||||||
|
border-radius: 10px;
|
||||||
|
// padding: 1em !important;
|
||||||
|
&:hover {
|
||||||
|
background: rgb(255 255 255 / 0.1) !important;
|
||||||
|
}
|
||||||
.card-image-container {
|
.card-image-container {
|
||||||
border-radius: 100% !important;
|
border-radius: 100% !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
import React from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
import MuiCard from "@mui/material/Card";
|
import MuiCard from "@mui/material/Card";
|
||||||
@@ -14,9 +15,9 @@ import { MdiCheck } from "../icons/mdiCheck";
|
|||||||
import LikeButton from "../buttons/likeButton";
|
import LikeButton from "../buttons/likeButton";
|
||||||
import MarkPlayedButton from "../buttons/markPlayedButton";
|
import MarkPlayedButton from "../buttons/markPlayedButton";
|
||||||
import PlayButton from "../buttons/playButton";
|
import PlayButton from "../buttons/playButton";
|
||||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
|
||||||
import { MdiTelevisionClassic } from "../icons/mdiTelevisionClassic";
|
import { MdiTelevisionClassic } from "../icons/mdiTelevisionClassic";
|
||||||
import { getRuntimeCompact } from "../../utils/date/time";
|
import { getRuntimeCompact } from "../../utils/date/time";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Props
|
* @typedef {Object} Props
|
||||||
@@ -44,20 +45,17 @@ export const EpisodeCard = ({
|
|||||||
userId,
|
userId,
|
||||||
onClick,
|
onClick,
|
||||||
}) => {
|
}) => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const defaultOnClick = () => {
|
const defaultOnClick = () => {
|
||||||
navigate(`/episode/${item.Id}`);
|
navigate(`/episode/${item.Id}`);
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<CardActionArea
|
<div
|
||||||
style={{
|
className="card card-episode"
|
||||||
padding: "0.6em",
|
elevation={0}
|
||||||
borderRadius: "calc(0.6em + 6px)",
|
onClick={onClick ? onClick : defaultOnClick}
|
||||||
}}
|
|
||||||
className="card-container"
|
|
||||||
onClick={!!onClick ? onClick : defaultOnClick}
|
|
||||||
>
|
>
|
||||||
<MuiCard className="card card-episode" elevation={0}>
|
|
||||||
<div className="card-box">
|
<div className="card-box">
|
||||||
<div
|
<div
|
||||||
className="card-image-container"
|
className="card-image-container"
|
||||||
@@ -69,12 +67,12 @@ export const EpisodeCard = ({
|
|||||||
<div
|
<div
|
||||||
className="card-indicator check"
|
className="card-indicator check"
|
||||||
style={{
|
style={{
|
||||||
opacity: item.UserData?.Played
|
opacity: item.UserData?.Played ? 1 : 0,
|
||||||
? 1
|
|
||||||
: 0,
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<MdiCheck />
|
<div className="material-symbols-rounded">
|
||||||
|
done
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{!!imageBlurhash && (
|
{!!imageBlurhash && (
|
||||||
@@ -88,18 +86,16 @@ export const EpisodeCard = ({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<div className="card-image-icon-container">
|
<div className="card-image-icon-container">
|
||||||
<MdiTelevisionClassic className="card-image-icon" />
|
<div className="material-symbols-rounded">
|
||||||
|
tv_gen
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<img
|
<img
|
||||||
src={window.api.getItemImageUrl(
|
src={api.getItemImageUrl(item.Id, "Primary", {
|
||||||
item.Id,
|
|
||||||
"Primary",
|
|
||||||
{
|
|
||||||
quality: 90,
|
quality: 90,
|
||||||
fillHeight: 512,
|
fillHeight: 512,
|
||||||
fillWidth: 512,
|
fillWidth: 512,
|
||||||
},
|
})}
|
||||||
)}
|
|
||||||
style={{
|
style={{
|
||||||
height: "100%",
|
height: "100%",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
@@ -208,7 +204,6 @@ export const EpisodeCard = ({
|
|||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</MuiCard>
|
</div>
|
||||||
</CardActionArea>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
import { useState } from "react";
|
import React, { 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";
|
||||||
@@ -77,13 +77,17 @@ export const CardScroller = ({
|
|||||||
className="card-scroller-button"
|
className="card-scroller-button"
|
||||||
onClick={() => carouselRef.previous()}
|
onClick={() => carouselRef.previous()}
|
||||||
>
|
>
|
||||||
<MdiChevronLeft />
|
<div className="material-symbols-rounded">
|
||||||
|
chevron_left
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
className="card-scroller-button"
|
className="card-scroller-button"
|
||||||
onClick={() => carouselRef.next()}
|
onClick={() => carouselRef.next()}
|
||||||
>
|
>
|
||||||
<MdiChevronRight />
|
<div className="material-symbols-rounded">
|
||||||
|
chevron_right
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 1em;
|
bottom: 1em;
|
||||||
width: calc(100vw - 2em);
|
width: calc(100vw - 8em);
|
||||||
left: 1em;
|
left: 1em;
|
||||||
right: 1em;
|
right: 1em;
|
||||||
gap: 1em;
|
gap: 1em;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { AnimatePresence, motion } from "framer-motion";
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
|
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
@@ -40,7 +40,7 @@ const Carousel = ({ content, onChange }) => {
|
|||||||
}}
|
}}
|
||||||
disabled={currentSlide == 0}
|
disabled={currentSlide == 0}
|
||||||
>
|
>
|
||||||
<MdiChevronLeft />
|
<div className="material-symbols-rounded">arrow_left</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
<motion.div
|
<motion.div
|
||||||
@@ -93,37 +93,20 @@ const Carousel = ({ content, onChange }) => {
|
|||||||
background: " rgb(200 200 200 / 0.05)",
|
background: " rgb(200 200 200 / 0.05)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<MdiChevronRight />
|
<div className="material-symbols-rounded">arrow_right</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<div className="carousel-indicator-container">
|
<div className="carousel-indicator-container">
|
||||||
<div
|
|
||||||
className={
|
|
||||||
currentSlide == 0
|
|
||||||
? "carousel-indicator active"
|
|
||||||
: "carousel-indicator"
|
|
||||||
}
|
|
||||||
style={{
|
|
||||||
background:
|
|
||||||
currentSlide == 0
|
|
||||||
? "white"
|
|
||||||
: "rgb(255 255 255 / 0.5)",
|
|
||||||
}}
|
|
||||||
onClick={() => {
|
|
||||||
setDirection("left");
|
|
||||||
setCurrentSlide(0);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
{content.map((item, index) => (
|
{content.map((item, index) => (
|
||||||
<div
|
<div
|
||||||
className={
|
className={
|
||||||
currentSlide == index + 1
|
currentSlide == index
|
||||||
? "carousel-indicator active"
|
? "carousel-indicator active"
|
||||||
: "carousel-indicator"
|
: "carousel-indicator"
|
||||||
}
|
}
|
||||||
key={index}
|
key={index}
|
||||||
style={{
|
style={{
|
||||||
background:
|
background:
|
||||||
currentSlide == index + 1
|
currentSlide == index
|
||||||
? "white"
|
? "white"
|
||||||
: "rgb(255 255 255 / 0.5)",
|
: "rgb(255 255 255 / 0.5)",
|
||||||
}}
|
}}
|
||||||
@@ -133,7 +116,7 @@ const Carousel = ({ content, onChange }) => {
|
|||||||
} else if (currentSlide <= index) {
|
} else if (currentSlide <= index) {
|
||||||
setDirection("right");
|
setDirection("right");
|
||||||
}
|
}
|
||||||
setCurrentSlide(index + 1);
|
setCurrentSlide(index);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import CarouselSlideError from "../errors/carousel";
|
|||||||
import { MdiStar } from "../icons/mdiStar";
|
import { MdiStar } from "../icons/mdiStar";
|
||||||
import { endsAt, getRuntime } from "../../utils/date/time";
|
import { endsAt, getRuntime } from "../../utils/date/time";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { MediaTypeIconCollection } from "../utils/iconsCollection";
|
import { MediaTypeIconCollection, getTypeIcon } from "../utils/iconsCollection";
|
||||||
import { MdiChevronRight } from "../icons/mdiChevronRight";
|
import { MdiChevronRight } from "../icons/mdiChevronRight";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
@@ -27,6 +27,7 @@ import MarkPlayedButton from "../buttons/markPlayedButton";
|
|||||||
import { useCarouselStore } from "../../utils/store/carousel";
|
import { useCarouselStore } from "../../utils/store/carousel";
|
||||||
import PlayButton from "../buttons/playButton";
|
import PlayButton from "../buttons/playButton";
|
||||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
const availableSpecialRoutes = [
|
const availableSpecialRoutes = [
|
||||||
BaseItemKind.Series,
|
BaseItemKind.Series,
|
||||||
@@ -45,12 +46,13 @@ const availableSpecialRoutes = [
|
|||||||
* @returns {React.Component}
|
* @returns {React.Component}
|
||||||
*/
|
*/
|
||||||
const CarouselSlide = ({ item }) => {
|
const CarouselSlide = ({ item }) => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
@@ -59,7 +61,7 @@ const CarouselSlide = ({ item }) => {
|
|||||||
const handleMoreInfo = () => {
|
const handleMoreInfo = () => {
|
||||||
if (availableSpecialRoutes.includes(item.Type)) {
|
if (availableSpecialRoutes.includes(item.Type)) {
|
||||||
navigate(`/${item.Type.toLocaleLowerCase()}/${item.Id}`);
|
navigate(`/${item.Type.toLocaleLowerCase()}/${item.Id}`);
|
||||||
} else if (!!item.Role) {
|
} else if (item.Role) {
|
||||||
navigate(`/person/${item.Id}`);
|
navigate(`/person/${item.Id}`);
|
||||||
} else {
|
} else {
|
||||||
navigate(`/item/${item.Id}`);
|
navigate(`/item/${item.Id}`);
|
||||||
@@ -106,9 +108,9 @@ const CarouselSlide = ({ item }) => {
|
|||||||
<img
|
<img
|
||||||
className="hero-carousel-background-image"
|
className="hero-carousel-background-image"
|
||||||
src={
|
src={
|
||||||
!!item.ParentBackdropItemId
|
item.ParentBackdropItemId
|
||||||
? `${window.api.basePath}/Items/${item.ParentBackdropItemId}/Images/Backdrop`
|
? `${api.basePath}/Items/${item.ParentBackdropItemId}/Images/Backdrop`
|
||||||
: `${window.api.basePath}/Items/${item.Id}/Images/Backdrop`
|
: `${api.basePath}/Items/${item.Id}/Images/Backdrop`
|
||||||
}
|
}
|
||||||
style={{
|
style={{
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
@@ -121,15 +123,15 @@ const CarouselSlide = ({ item }) => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<div className="hero-carousel-background-icon-container">
|
<div className="hero-carousel-background-icon-container">
|
||||||
{MediaTypeIconCollection[item.Type]}
|
{getTypeIcon(item.Type)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<motion.div
|
<motion.div
|
||||||
initial={{
|
initial={{
|
||||||
transform:
|
transform:
|
||||||
animationDirection == "right"
|
animationDirection == "right"
|
||||||
? "translateX(40px)"
|
? "translateX(60px)"
|
||||||
: "translateX(-40px)",
|
: "translateX(-60px)",
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
}}
|
}}
|
||||||
animate={{
|
animate={{
|
||||||
@@ -139,8 +141,8 @@ const CarouselSlide = ({ item }) => {
|
|||||||
exit={{
|
exit={{
|
||||||
transform:
|
transform:
|
||||||
animationDirection == "right"
|
animationDirection == "right"
|
||||||
? "translateX(-40px)"
|
? "translateX(-60px)"
|
||||||
: "translateX(40px)",
|
: "translateX(60px)",
|
||||||
|
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
}}
|
}}
|
||||||
@@ -165,7 +167,7 @@ const CarouselSlide = ({ item }) => {
|
|||||||
<img
|
<img
|
||||||
className="hero-carousel-text-logo"
|
className="hero-carousel-text-logo"
|
||||||
src={
|
src={
|
||||||
window.api.basePath +
|
api.basePath +
|
||||||
"/Items/" +
|
"/Items/" +
|
||||||
item.Id +
|
item.Id +
|
||||||
"/Images/Logo?quality=80&tag=" +
|
"/Images/Logo?quality=80&tag=" +
|
||||||
@@ -199,7 +201,7 @@ const CarouselSlide = ({ item }) => {
|
|||||||
className="hero-carousel-info"
|
className="hero-carousel-info"
|
||||||
>
|
>
|
||||||
<Typography variant="subtitle1">
|
<Typography variant="subtitle1">
|
||||||
{!!item.ProductionYear
|
{item.ProductionYear
|
||||||
? item.ProductionYear
|
? item.ProductionYear
|
||||||
: "Unknown"}
|
: "Unknown"}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -215,7 +217,7 @@ const CarouselSlide = ({ item }) => {
|
|||||||
}}
|
}}
|
||||||
className="hero-carousel-info-rating"
|
className="hero-carousel-info-rating"
|
||||||
>
|
>
|
||||||
{!!item.CommunityRating ? (
|
{item.CommunityRating ? (
|
||||||
<>
|
<>
|
||||||
<MdiStar
|
<MdiStar
|
||||||
sx={{
|
sx={{
|
||||||
@@ -262,7 +264,6 @@ const CarouselSlide = ({ item }) => {
|
|||||||
{item.Overview}
|
{item.Overview}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
{/* TODO Link PLay and More info buttons in carousel */}
|
|
||||||
<Stack
|
<Stack
|
||||||
mt={3}
|
mt={3}
|
||||||
direction="row"
|
direction="row"
|
||||||
@@ -298,7 +299,16 @@ const CarouselSlide = ({ item }) => {
|
|||||||
size="large"
|
size="large"
|
||||||
color="white"
|
color="white"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
endIcon={<MdiChevronRight />}
|
endIcon={
|
||||||
|
<div
|
||||||
|
className="material-symbols-rounded"
|
||||||
|
style={{
|
||||||
|
fontSize: "2em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
chevron_right
|
||||||
|
</div>
|
||||||
|
}
|
||||||
onClick={handleMoreInfo}
|
onClick={handleMoreInfo}
|
||||||
>
|
>
|
||||||
More info
|
More info
|
||||||
@@ -326,4 +336,4 @@ const CarouselSlide = ({ item }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default memo(CarouselSlide);
|
export default CarouselSlide;
|
||||||
@@ -17,7 +17,7 @@ class ErrorBoundary extends React.Component {
|
|||||||
// in ErrorBoundary (created by App)
|
// in ErrorBoundary (created by App)
|
||||||
// in div (created by App)
|
// in div (created by App)
|
||||||
// in App
|
// in App
|
||||||
logErrorToMyService(error, info.componentStack);
|
console.error(`Err in ${info} - ${error}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
import React from "react";
|
||||||
import Paper from "@mui/material/Paper";
|
import Paper from "@mui/material/Paper";
|
||||||
import Stack from "@mui/material/Stack";
|
import Stack from "@mui/material/Stack";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import { MdiEmoticonDead } from "../icons/mdiEmoticonDead";
|
import { MdiEmoticonDead } from "../icons/mdiEmoticonDead";
|
||||||
import Divider from "@mui/material/Divider";
|
|
||||||
|
|
||||||
import { red } from "@mui/material/colors";
|
|
||||||
|
|
||||||
import slideBackground from "../../assets/errorbg.png";
|
import slideBackground from "../../assets/errorbg.png";
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
import React from "react";
|
||||||
|
/** @format */
|
||||||
|
import SvgIcon from "@mui/material/SvgIcon";
|
||||||
|
|
||||||
|
const Icon = (icon, extraProps) => {
|
||||||
|
return (
|
||||||
|
<SvgIcon {...extraProps}>
|
||||||
|
<path d={icon}></path>
|
||||||
|
</SvgIcon>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Icon;
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
import SvgIcon from "@mui/material/SvgIcon";
|
||||||
|
|
||||||
|
import { mdiHdr } from "@mdi/js";
|
||||||
|
|
||||||
|
export const MdiHdr = (props) => {
|
||||||
|
return (
|
||||||
|
<SvgIcon {...props}>
|
||||||
|
<path d={mdiHdr}></path>
|
||||||
|
</SvgIcon>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -1,17 +1,8 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import PropTypes from "prop-types";
|
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
|
||||||
import Paper from "@mui/material/Paper";
|
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 Typography from "@mui/material/Typography";
|
||||||
import IconButton from "@mui/material/IconButton";
|
|
||||||
import Stack from "@mui/material/Stack";
|
import Stack from "@mui/material/Stack";
|
||||||
import MuiLink from "@mui/material/Link";
|
import MuiLink from "@mui/material/Link";
|
||||||
|
|
||||||
@@ -19,25 +10,24 @@ import { Link } from "react-router-dom";
|
|||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
|
||||||
|
|
||||||
import { getRuntimeMusic } from "../../../utils/date/time";
|
import { getRuntimeMusic } from "../../../utils/date/time";
|
||||||
|
|
||||||
import { MdiClockOutline } from "../../icons/mdiClockOutline";
|
import { MdiClockOutline } from "../../icons/mdiClockOutline";
|
||||||
import { MdiHeart } from "../../icons/mdiHeart";
|
|
||||||
import { MdiHeartOutline } from "../../icons/mdiHeartOutline";
|
|
||||||
import { MdiAlbum } from "../../icons/mdiAlbum";
|
import { MdiAlbum } from "../../icons/mdiAlbum";
|
||||||
|
|
||||||
import "./albumArtist.scss";
|
import "./albumArtist.scss";
|
||||||
import { useAudioPlayback } from "../../../utils/store/audioPlayback";
|
import { useAudioPlayback } from "../../../utils/store/audioPlayback";
|
||||||
import LikeButton from "../../buttons/likeButton";
|
import LikeButton from "../../buttons/likeButton";
|
||||||
import { SortOrder } from "@jellyfin/sdk/lib/generated-client";
|
import { SortOrder } from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
import { useApi } from "../../../utils/store/api";
|
||||||
|
|
||||||
export const ArtistAlbum = ({ user, album, boxProps }) => {
|
export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
const albumTracks = useQuery({
|
const albumTracks = useQuery({
|
||||||
queryKey: ["artist", "album", album.Id],
|
queryKey: ["artist", "album", album.Id],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItems({
|
const result = await getItemsApi(api).getItems({
|
||||||
userId: user.Id,
|
userId: user.Id,
|
||||||
parentId: album.Id,
|
parentId: album.Id,
|
||||||
sortOrder: SortOrder.Ascending,
|
sortOrder: SortOrder.Ascending,
|
||||||
@@ -49,22 +39,6 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
|||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleLikingTrack = async (track) => {
|
|
||||||
let result;
|
|
||||||
if (track.UserData.IsFavorite) {
|
|
||||||
result = await getUserLibraryApi(window.api).unmarkFavoriteItem({
|
|
||||||
userId: user.Id,
|
|
||||||
itemId: track.Id,
|
|
||||||
});
|
|
||||||
} else if (!track.UserData.IsFavorite) {
|
|
||||||
result = await getUserLibraryApi(window.api).markFavoriteItem({
|
|
||||||
userId: user.Id,
|
|
||||||
itemId: track.Id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
albumTracks.refetch();
|
|
||||||
};
|
|
||||||
|
|
||||||
const [imgLoaded, setImgLoaded] = useState(false);
|
const [imgLoaded, setImgLoaded] = useState(false);
|
||||||
|
|
||||||
const [
|
const [
|
||||||
@@ -86,7 +60,7 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
|||||||
setAudioTracks(albumTracks.data.Items);
|
setAudioTracks(albumTracks.data.Items);
|
||||||
setCurrentAudioTrack(index);
|
setCurrentAudioTrack(index);
|
||||||
setAudioUrl(
|
setAudioUrl(
|
||||||
`${window.api.basePath}/Audio/${albumTracks.data.Items[index].Id}/universal?deviceId=${window.api.deviceInfo.id}&userId=${user.Id}&api_key=${window.api.accessToken}`,
|
`${api.basePath}/Audio/${albumTracks.data.Items[index].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${user.Id}&api_key=${api.accessToken}`,
|
||||||
);
|
);
|
||||||
setAudioItem(albumTracks.data.Items[index]);
|
setAudioItem(albumTracks.data.Items[index]);
|
||||||
setAudioDisplay(true);
|
setAudioDisplay(true);
|
||||||
@@ -105,7 +79,7 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
|||||||
{!!album.ImageTags?.Primary && (
|
{!!album.ImageTags?.Primary && (
|
||||||
<div className="album-image">
|
<div className="album-image">
|
||||||
<img
|
<img
|
||||||
src={`${window.api.basePath}/Items/${album.Id}/Images/Primary?fillHeight=532&fillWidth=532&quality=96`}
|
src={`${api.basePath}/Items/${album.Id}/Images/Primary?fillHeight=532&fillWidth=532&quality=96`}
|
||||||
style={{
|
style={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
@@ -156,8 +130,7 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
|||||||
className="item-detail-album-track"
|
className="item-detail-album-track"
|
||||||
style={{
|
style={{
|
||||||
padding: "0.75em 0 ",
|
padding: "0.75em 0 ",
|
||||||
background: "rgb(255 255 255 / 0.1)",
|
background: "hsl(256, 100%, 4%, 60%)",
|
||||||
boxShadow: "0 0 10px rgb(0 0 0 / 0.5)",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography
|
<Typography
|
||||||
@@ -200,7 +173,7 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
|||||||
justifySelf: "end",
|
justifySelf: "end",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{!!track.IndexNumber
|
{track.IndexNumber
|
||||||
? track.IndexNumber
|
? track.IndexNumber
|
||||||
: "-"}
|
: "-"}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
import React from "react";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { CardScroller } from "../../cardScroller/cardScroller";
|
import { CardScroller } from "../../cardScroller/cardScroller";
|
||||||
import { Card } from "../../card/card";
|
import { Card } from "../../card/card";
|
||||||
@@ -8,21 +8,23 @@ import { CardsSkeleton } from "../../skeleton/cards";
|
|||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
import { useApi } from "../../../utils/store/api";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Latest Media Section
|
* @description Latest Media Section
|
||||||
*/
|
*/
|
||||||
export const LatestMediaSection = ({ latestMediaLib }) => {
|
export const LatestMediaSection = ({ latestMediaLib }) => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
});
|
});
|
||||||
const fetchLatestMedia = async (library) => {
|
const fetchLatestMedia = async (library) => {
|
||||||
const media = await getUserLibraryApi(window.api).getLatestMedia({
|
const media = await getUserLibraryApi(api).getLatestMedia({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
parentId: library,
|
parentId: library,
|
||||||
limit: 16,
|
limit: 16,
|
||||||
@@ -36,7 +38,7 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
|||||||
enabled: !!user.data,
|
enabled: !!user.data,
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
});
|
});
|
||||||
if (data.isLoading) {
|
if (data.isPending) {
|
||||||
return <CardsSkeleton />;
|
return <CardsSkeleton />;
|
||||||
}
|
}
|
||||||
if (data.isSuccess && data.data.length >= 1) {
|
if (data.isSuccess && data.data.length >= 1) {
|
||||||
@@ -45,7 +47,7 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
|||||||
displayCards={8}
|
displayCards={8}
|
||||||
title={"Latest " + latestMediaLib[1]}
|
title={"Latest " + latestMediaLib[1]}
|
||||||
>
|
>
|
||||||
{data.data.map((item, index) => {
|
{data.data.map((item) => {
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
key={item.Id}
|
key={item.Id}
|
||||||
@@ -62,7 +64,7 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
|||||||
? `S${item.ParentIndexNumber}:E${item.IndexNumber} - ${item.Name}`
|
? `S${item.ParentIndexNumber}:E${item.IndexNumber} - ${item.Name}`
|
||||||
: item.Type == BaseItemKind.Series
|
: item.Type == BaseItemKind.Series
|
||||||
? `${item.ProductionYear} - ${
|
? `${item.ProductionYear} - ${
|
||||||
!!item.EndDate
|
item.EndDate
|
||||||
? new Date(
|
? new Date(
|
||||||
item.EndDate,
|
item.EndDate,
|
||||||
).toLocaleString(
|
).toLocaleString(
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import PropTypes from "prop-types";
|
|
||||||
|
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import TextField from "@mui/material/TextField";
|
import TextField from "@mui/material/TextField";
|
||||||
import MenuItem from "@mui/material/MenuItem";
|
import MenuItem from "@mui/material/MenuItem";
|
||||||
@@ -26,6 +24,7 @@ import "./hero.module.scss";
|
|||||||
import { Blurhash } from "react-blurhash";
|
import { Blurhash } from "react-blurhash";
|
||||||
import TextLink from "../../textLink";
|
import TextLink from "../../textLink";
|
||||||
|
|
||||||
|
import { useApi } from "../../../utils/store/api";
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Props
|
* @typedef {Object} Props
|
||||||
* @property {import("@jellyfin/sdk/lib/generated-client/models").BaseItemDto} item
|
* @property {import("@jellyfin/sdk/lib/generated-client/models").BaseItemDto} item
|
||||||
@@ -43,6 +42,7 @@ import TextLink from "../../textLink";
|
|||||||
* @property {bool} audioPlayButton
|
* @property {bool} audioPlayButton
|
||||||
* @property {bool} favourParentImg
|
* @property {bool} favourParentImg
|
||||||
* @property {"portrait"| "thumb"| 'square'} cardType
|
* @property {"portrait"| "thumb"| 'square'} cardType
|
||||||
|
* @property {bool} enableVideoInfoStrip
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,7 +67,10 @@ const Hero = ({
|
|||||||
favourParentImg = true,
|
favourParentImg = true,
|
||||||
isEpisode = false,
|
isEpisode = false,
|
||||||
cardType = "portrait",
|
cardType = "portrait",
|
||||||
|
enableVideoInfoStrip = false,
|
||||||
}) => {
|
}) => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
const filterMediaStreamVideo = (source) => {
|
const filterMediaStreamVideo = (source) => {
|
||||||
if (source.Type == MediaStreamType.Video) {
|
if (source.Type == MediaStreamType.Video) {
|
||||||
return true;
|
return true;
|
||||||
@@ -103,7 +106,64 @@ const Hero = ({
|
|||||||
setCurrentAudioIndex(audioTracks[0]?.Index);
|
setCurrentAudioIndex(audioTracks[0]?.Index);
|
||||||
setCurrentSubtitleIndex(subtitleTracks[0]?.Index);
|
setCurrentSubtitleIndex(subtitleTracks[0]?.Index);
|
||||||
}
|
}
|
||||||
}, [videoTracks, audioTracks, subtitleTracks]);
|
}, []);
|
||||||
|
|
||||||
|
const qualityLabel = () => {
|
||||||
|
if (
|
||||||
|
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||||
|
"2160p",
|
||||||
|
) ||
|
||||||
|
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("4k")
|
||||||
|
) {
|
||||||
|
return "4K";
|
||||||
|
} else if (
|
||||||
|
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||||
|
"1080p",
|
||||||
|
) ||
|
||||||
|
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("hd")
|
||||||
|
) {
|
||||||
|
return "HD";
|
||||||
|
} else {
|
||||||
|
return "SD";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const atmosLabel = () => {
|
||||||
|
if (
|
||||||
|
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||||
|
"atmos",
|
||||||
|
) &&
|
||||||
|
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||||
|
"truehd",
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return "TrueHD | Atmos";
|
||||||
|
} else if (
|
||||||
|
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||||
|
"atmos",
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return "Atmos";
|
||||||
|
} else if (
|
||||||
|
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||||
|
"truehd",
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return "TrueHD";
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const surroundSoundLabel = () => {
|
||||||
|
if (audioTracks[0]?.DisplayTitle.includes("7.1")) {
|
||||||
|
return "7.1";
|
||||||
|
} else if (audioTracks[0].DisplayTitle.includes("5.1")) {
|
||||||
|
return "5.1";
|
||||||
|
} else {
|
||||||
|
return "2.0";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -137,9 +197,9 @@ const Hero = ({
|
|||||||
<img
|
<img
|
||||||
className="hero-backdrop-image"
|
className="hero-backdrop-image"
|
||||||
src={
|
src={
|
||||||
!!item.ParentBackdropItemId
|
item.ParentBackdropItemId
|
||||||
? `${window.api.basePath}/Items/${item.ParentBackdropItemId}/Images/Backdrop`
|
? `${api.basePath}/Items/${item.ParentBackdropItemId}/Images/Backdrop`
|
||||||
: `${window.api.basePath}/Items/${item.Id}/Images/Backdrop`
|
: `${api.basePath}/Items/${item.Id}/Images/Backdrop`
|
||||||
}
|
}
|
||||||
style={{
|
style={{
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
@@ -170,9 +230,9 @@ const Hero = ({
|
|||||||
fontWeight: 300,
|
fontWeight: 300,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{!!item.ParentLogoImageTag ? (
|
{item.ParentLogoImageTag ? (
|
||||||
<img
|
<img
|
||||||
src={`${window.api.basePath}/Items/${item.SeriesId}/Images/Logo`}
|
src={`${api.basePath}/Items/${item.SeriesId}/Images/Logo`}
|
||||||
className="hero-name-logo"
|
className="hero-name-logo"
|
||||||
onLoad={(e) => {
|
onLoad={(e) => {
|
||||||
e.target.style.opacity = 1;
|
e.target.style.opacity = 1;
|
||||||
@@ -191,12 +251,12 @@ const Hero = ({
|
|||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<Typography variant="h2" fontWeight={300}>
|
<Typography variant="h2" fontWeight={300}>
|
||||||
{!!item.ImageTags.Logo ? (
|
{item.ImageTags.Logo ? (
|
||||||
<img
|
<img
|
||||||
src={
|
src={
|
||||||
!!item.SeriesId
|
item.SeriesId
|
||||||
? `${window.api.basePath}/Items/${item.SeriesId}/Images/Logo`
|
? `${api.basePath}/Items/${item.SeriesId}/Images/Logo`
|
||||||
: `${window.api.basePath}/Items/${item.Id}/Images/Logo`
|
: `${api.basePath}/Items/${item.Id}/Images/Logo`
|
||||||
}
|
}
|
||||||
className="hero-name-logo"
|
className="hero-name-logo"
|
||||||
onLoad={(e) => {
|
onLoad={(e) => {
|
||||||
@@ -223,22 +283,122 @@ const Hero = ({
|
|||||||
</TextLink>
|
</TextLink>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
{enableVideoInfoStrip && (
|
||||||
|
<Stack direction="row" gap={1} mb={2} mt={2}>
|
||||||
|
{!!qualityLabel() && (
|
||||||
|
<Chip
|
||||||
|
variant="filled"
|
||||||
|
label={
|
||||||
|
<Typography
|
||||||
|
variant="caption"
|
||||||
|
fontWeight={600}
|
||||||
|
// fontFamily="JetBrains Mono Variable"
|
||||||
|
>
|
||||||
|
{qualityLabel()}
|
||||||
|
</Typography>
|
||||||
|
}
|
||||||
|
sx={{
|
||||||
|
borderRadius:
|
||||||
|
"8px !important",
|
||||||
|
"& .MuiChip-label": {
|
||||||
|
fontSize: "2.2em",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!!surroundSoundLabel() && (
|
||||||
|
<Chip
|
||||||
|
variant="filled"
|
||||||
|
label={
|
||||||
|
<Typography
|
||||||
|
variant="caption"
|
||||||
|
fontWeight={600}
|
||||||
|
fontFamily="JetBrains Mono Variable"
|
||||||
|
>
|
||||||
|
{surroundSoundLabel()}
|
||||||
|
</Typography>
|
||||||
|
}
|
||||||
|
sx={{
|
||||||
|
borderRadius:
|
||||||
|
"8px !important",
|
||||||
|
"& .MuiChip-label": {
|
||||||
|
fontSize: "2.2em",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!!videoTracks[0].VideoRangeType && (
|
||||||
|
<Chip
|
||||||
|
variant="filled"
|
||||||
|
label={
|
||||||
|
<Typography
|
||||||
|
variant="caption"
|
||||||
|
fontWeight={600}
|
||||||
|
fontFamily="JetBrains Mono Variable"
|
||||||
|
>
|
||||||
|
{
|
||||||
|
videoTracks[0]
|
||||||
|
.VideoRangeType
|
||||||
|
}
|
||||||
|
</Typography>
|
||||||
|
}
|
||||||
|
sx={{
|
||||||
|
borderRadius:
|
||||||
|
"8px !important",
|
||||||
|
"& .MuiChip-label": {
|
||||||
|
fontSize: "2.2em",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!!atmosLabel() && (
|
||||||
|
<Chip
|
||||||
|
variant="filled"
|
||||||
|
label={
|
||||||
|
<Typography
|
||||||
|
variant="caption"
|
||||||
|
fontWeight={600}
|
||||||
|
fontFamily="JetBrains Mono Variable"
|
||||||
|
>
|
||||||
|
{atmosLabel()}
|
||||||
|
</Typography>
|
||||||
|
}
|
||||||
|
sx={{
|
||||||
|
borderRadius:
|
||||||
|
"8px !important",
|
||||||
|
"& .MuiChip-label": {
|
||||||
|
fontSize: "2.2em",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!!subtitleTracks.length > 0 && (
|
||||||
|
<Chip
|
||||||
|
variant="filled"
|
||||||
|
label={
|
||||||
|
<Typography
|
||||||
|
variant="caption"
|
||||||
|
fontWeight={600}
|
||||||
|
fontFamily="JetBrains Mono Variable"
|
||||||
|
>
|
||||||
|
CC
|
||||||
|
</Typography>
|
||||||
|
}
|
||||||
|
sx={{
|
||||||
|
borderRadius:
|
||||||
|
"8px !important",
|
||||||
|
"& .MuiChip-label": {
|
||||||
|
fontSize: "2.2em",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
)}
|
||||||
{!disableInfoStrip && (
|
{!disableInfoStrip && (
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
gap={1}
|
gap={2}
|
||||||
divider={
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
width: "4px",
|
|
||||||
height: "4px",
|
|
||||||
background: "white",
|
|
||||||
alignSelf: "center",
|
|
||||||
aspectRatio: 1,
|
|
||||||
borderRadius: "10px",
|
|
||||||
}}
|
|
||||||
></div>
|
|
||||||
}
|
|
||||||
className="hero-carousel-info"
|
className="hero-carousel-info"
|
||||||
mt={1}
|
mt={1}
|
||||||
justifyItems="flex-start"
|
justifyItems="flex-start"
|
||||||
@@ -248,7 +408,7 @@ const Hero = ({
|
|||||||
style={{ opacity: "0.8" }}
|
style={{ opacity: "0.8" }}
|
||||||
variant="subtitle1"
|
variant="subtitle1"
|
||||||
>
|
>
|
||||||
{!!item.ProductionYear
|
{item.ProductionYear
|
||||||
? item.ProductionYear
|
? item.ProductionYear
|
||||||
: "Unknown"}
|
: "Unknown"}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -266,7 +426,7 @@ const Hero = ({
|
|||||||
}}
|
}}
|
||||||
className="hero-carousel-info-rating"
|
className="hero-carousel-info-rating"
|
||||||
>
|
>
|
||||||
{!!item.CommunityRating ? (
|
{item.CommunityRating ? (
|
||||||
<>
|
<>
|
||||||
<MdiStar
|
<MdiStar
|
||||||
sx={{
|
sx={{
|
||||||
@@ -370,6 +530,10 @@ const Hero = ({
|
|||||||
}}
|
}}
|
||||||
itemUserData={item.UserData}
|
itemUserData={item.UserData}
|
||||||
audio={audioPlayButton}
|
audio={audioPlayButton}
|
||||||
|
playlistItemId={
|
||||||
|
item.Type == BaseItemKind.Playlist &&
|
||||||
|
item.Id
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!disableLikeButton && (
|
{!disableLikeButton && (
|
||||||
@@ -426,7 +590,7 @@ const Hero = ({
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{videoTracks.map((track, index) => {
|
{videoTracks.map((track) => {
|
||||||
return (
|
return (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
key={track.Index}
|
key={track.Index}
|
||||||
@@ -465,7 +629,7 @@ const Hero = ({
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{audioTracks.map((track, index) => {
|
{audioTracks.map((track) => {
|
||||||
return (
|
return (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
key={track.Index}
|
key={track.Index}
|
||||||
@@ -493,18 +657,19 @@ const Hero = ({
|
|||||||
size="small"
|
size="small"
|
||||||
value={currentSubtitleIndex}
|
value={currentSubtitleIndex}
|
||||||
select
|
select
|
||||||
onChange={(e) =>
|
onChange={(e) => {
|
||||||
|
console.log(e.target.value);
|
||||||
setCurrentSubtitleIndex(
|
setCurrentSubtitleIndex(
|
||||||
e.target.value,
|
e.target.value,
|
||||||
)
|
);
|
||||||
}
|
}}
|
||||||
SelectProps={{
|
SelectProps={{
|
||||||
MenuProps: {
|
MenuProps: {
|
||||||
disableScrollLock: true,
|
disableScrollLock: true,
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{subtitleTracks.map((track, index) => {
|
{subtitleTracks.map((track) => {
|
||||||
return (
|
return (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
key={track.Index}
|
key={track.Index}
|
||||||
@@ -557,7 +722,7 @@ const Hero = ({
|
|||||||
{writers.map((writer, index) => (
|
{writers.map((writer, index) => (
|
||||||
<>
|
<>
|
||||||
<TextLink
|
<TextLink
|
||||||
key={index}
|
key={writer.Id}
|
||||||
variant={"subtitle1"}
|
variant={"subtitle1"}
|
||||||
location={`/person/${writer.Id}`}
|
location={`/person/${writer.Id}`}
|
||||||
>
|
>
|
||||||
@@ -599,7 +764,7 @@ const Hero = ({
|
|||||||
{directors.map((director, index) => (
|
{directors.map((director, index) => (
|
||||||
<>
|
<>
|
||||||
<TextLink
|
<TextLink
|
||||||
key={index}
|
key={director.Id}
|
||||||
variant={"subtitle1"}
|
variant={"subtitle1"}
|
||||||
location={`/person/${director.Id}`}
|
location={`/person/${director.Id}`}
|
||||||
>
|
>
|
||||||
@@ -641,7 +806,7 @@ const Hero = ({
|
|||||||
{artists.map((artist, index) => (
|
{artists.map((artist, index) => (
|
||||||
<>
|
<>
|
||||||
<TextLink
|
<TextLink
|
||||||
key={index}
|
key={artist.Id}
|
||||||
variant={"subtitle1"}
|
variant={"subtitle1"}
|
||||||
location={`/artist/${artist.Id}`}
|
location={`/artist/${artist.Id}`}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
import React from "react";
|
||||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { Card } from "../../../card/card";
|
import { Card } from "../../../card/card";
|
||||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
import { useApi } from "../../../../utils/store/api";
|
||||||
|
import { CardScroller } from "../../../cardScroller/cardScroller";
|
||||||
|
|
||||||
const GenreView = ({ libraryId, genreId, genreName, userId }) => {
|
const GenreView = ({ libraryId, genreId, genreName, userId }) => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
const items = useQuery({
|
const items = useQuery({
|
||||||
queryKey: ["library", "genreItem", genreId],
|
queryKey: ["library", "genreItem", genreId],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItems({
|
const result = await getItemsApi(api).getItems({
|
||||||
genreIds: [genreId],
|
genreIds: [genreId],
|
||||||
parentId: libraryId,
|
parentId: libraryId,
|
||||||
userId: userId,
|
userId: userId,
|
||||||
@@ -21,26 +24,15 @@ const GenreView = ({ libraryId, genreId, genreName, userId }) => {
|
|||||||
if (items.isSuccess && items.data.Items.length > 0) {
|
if (items.isSuccess && items.data.Items.length > 0) {
|
||||||
return (
|
return (
|
||||||
<div className="library-genre">
|
<div className="library-genre">
|
||||||
<div className="library-genre-header">
|
<CardScroller
|
||||||
<div className="library-genre-header-decoration"></div>
|
title={genreName}
|
||||||
<Typography
|
displayCards={8}
|
||||||
noWrap
|
disableDecoration
|
||||||
variant="h5"
|
|
||||||
color="textPrimary"
|
|
||||||
className=""
|
|
||||||
>
|
>
|
||||||
{genreName}
|
{items.data.Items.map((item) => {
|
||||||
</Typography>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="library-grid"
|
|
||||||
style={{
|
|
||||||
paddingTop: "0.5em",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{items.data.Items.map((item, index) => {
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
seriesId={item.SeriesId}
|
seriesId={item.SeriesId}
|
||||||
cardTitle={
|
cardTitle={
|
||||||
@@ -107,7 +99,7 @@ const GenreView = ({ libraryId, genreId, genreName, userId }) => {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</CardScroller>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,40 +1,23 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { delUser } from "../../utils/storage/user";
|
|
||||||
|
|
||||||
import { useQuery } 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";
|
||||||
|
|
||||||
import { useNavigate, NavLink, useLocation } from "react-router-dom";
|
import { NavLink, useLocation } from "react-router-dom";
|
||||||
|
|
||||||
import { theme } from "../../theme";
|
|
||||||
|
|
||||||
import { styled } from "@mui/material/styles";
|
import { styled } from "@mui/material/styles";
|
||||||
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 ListItem from "@mui/material/ListItem";
|
|
||||||
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
||||||
import ListItemButton from "@mui/material/ListItemButton";
|
|
||||||
import IconButton from "@mui/material/IconButton";
|
|
||||||
import Divider from "@mui/material/Divider";
|
|
||||||
import MuiDrawer from "@mui/material/Drawer";
|
import MuiDrawer from "@mui/material/Drawer";
|
||||||
import ListItemText from "@mui/material/ListItemText";
|
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
|
|
||||||
import { MdiClose } from "../icons/mdiClose";
|
import { getTypeIcon } from "../../components/utils/iconsCollection.jsx";
|
||||||
import { MdiLogoutVariant } from "../icons/mdiLogoutVariant";
|
|
||||||
|
|
||||||
import { MediaCollectionTypeIconCollection } from "../../components/utils/iconsCollection.jsx";
|
|
||||||
|
|
||||||
import { MdiHomeVariantOutline } from "../icons/mdiHomeVariantOutline";
|
|
||||||
|
|
||||||
import { EventEmitter as event } from "../../eventEmitter.js";
|
|
||||||
|
|
||||||
import "./sidemenu.module.scss";
|
import "./sidemenu.module.scss";
|
||||||
import { useDrawerStore } from "../../utils/store/drawer";
|
import { useApi } from "../../utils/store/api";
|
||||||
import { MdiHomeVariant } from "../icons/mdiHomeVariant";
|
|
||||||
|
import Icon from "../../assets/icon.png";
|
||||||
|
|
||||||
const DrawerHeader = styled("div")(({ theme }) => ({
|
const DrawerHeader = styled("div")(({ theme }) => ({
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@@ -54,16 +37,16 @@ const MiniDrawer = styled(MuiDrawer, {
|
|||||||
overflowX: "hidden",
|
overflowX: "hidden",
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const SideMenu = ({}) => {
|
export const SideMenu = () => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
const [display, setDisplay] = useState(false);
|
const [display, setDisplay] = useState(false);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
enabled: display,
|
enabled: display,
|
||||||
@@ -72,7 +55,7 @@ export const SideMenu = ({}) => {
|
|||||||
let libraries = useQuery({
|
let libraries = useQuery({
|
||||||
queryKey: ["libraries"],
|
queryKey: ["libraries"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let libs = await getUserViewsApi(window.api).getUserViews({
|
let libs = await getUserViewsApi(api).getUserViews({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
});
|
});
|
||||||
return libs.data;
|
return libs.data;
|
||||||
@@ -81,20 +64,13 @@ export const SideMenu = ({}) => {
|
|||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleLogout = async () => {
|
|
||||||
console.log("Logging out user...");
|
|
||||||
await window.api.logout();
|
|
||||||
delUser();
|
|
||||||
sessionStorage.removeItem("accessToken");
|
|
||||||
event.emit("create-jellyfin-api", window.api.basePath);
|
|
||||||
navigate("/login");
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
location.pathname.includes("login") ||
|
location.pathname.includes("login") ||
|
||||||
location.pathname.includes("setup") ||
|
location.pathname.includes("setup") ||
|
||||||
|
location.pathname.includes("server") ||
|
||||||
location.pathname.includes("player") ||
|
location.pathname.includes("player") ||
|
||||||
|
location.pathname.includes("error") ||
|
||||||
location.pathname === "/"
|
location.pathname === "/"
|
||||||
) {
|
) {
|
||||||
setDisplay(false);
|
setDisplay(false);
|
||||||
@@ -103,11 +79,6 @@ export const SideMenu = ({}) => {
|
|||||||
}
|
}
|
||||||
}, [location]);
|
}, [location]);
|
||||||
|
|
||||||
const [open, setDrawerOpen] = useDrawerStore((state) => [
|
|
||||||
state.open,
|
|
||||||
state.setOpen,
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (!display) {
|
if (!display) {
|
||||||
return <></>;
|
return <></>;
|
||||||
}
|
}
|
||||||
@@ -138,9 +109,11 @@ export const SideMenu = ({}) => {
|
|||||||
sx={{
|
sx={{
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
}}
|
}}
|
||||||
></DrawerHeader>
|
>
|
||||||
|
<img src={Icon} className="sidemenu-icon" />
|
||||||
|
</DrawerHeader>
|
||||||
<div className="sidemenu-item-container">
|
<div className="sidemenu-item-container">
|
||||||
{libraries.isLoading ? (
|
{libraries.isPending ? (
|
||||||
<></>
|
<></>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
@@ -149,7 +122,7 @@ export const SideMenu = ({}) => {
|
|||||||
className="sidemenu-item small"
|
className="sidemenu-item small"
|
||||||
>
|
>
|
||||||
<div className="sidemenu-item-icon">
|
<div className="sidemenu-item-icon">
|
||||||
<MdiHomeVariantOutline />
|
{getTypeIcon("Home")}
|
||||||
</div>
|
</div>
|
||||||
<Typography
|
<Typography
|
||||||
className="sidemenu-item-text"
|
className="sidemenu-item-text"
|
||||||
@@ -165,27 +138,23 @@ export const SideMenu = ({}) => {
|
|||||||
Home
|
Home
|
||||||
</Typography>
|
</Typography>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
{libraries.data.Items.map(
|
{libraries.data.Items.map((lib) => {
|
||||||
(lib, index) => {
|
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
title={lib.Name}
|
title={lib.Name}
|
||||||
placement="right"
|
placement="right"
|
||||||
arrow
|
arrow
|
||||||
followCursor
|
followCursor
|
||||||
key={index}
|
key={lib.Id}
|
||||||
>
|
>
|
||||||
<NavLink
|
<NavLink
|
||||||
to={`/library/${lib.Id}`}
|
to={`/library/${lib.Id}`}
|
||||||
className="sidemenu-item"
|
className="sidemenu-item"
|
||||||
>
|
>
|
||||||
<div className="sidemenu-item-icon">
|
<div className="sidemenu-item-icon">
|
||||||
{
|
{getTypeIcon(
|
||||||
MediaCollectionTypeIconCollection[
|
lib.CollectionType,
|
||||||
lib
|
)}
|
||||||
.CollectionType
|
|
||||||
]
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
<Typography
|
<Typography
|
||||||
className="sidemenu-item-text"
|
className="sidemenu-item-text"
|
||||||
@@ -205,185 +174,11 @@ export const SideMenu = ({}) => {
|
|||||||
</NavLink>
|
</NavLink>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
},
|
})}
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</MiniDrawer>
|
</MiniDrawer>
|
||||||
|
|
||||||
<MuiDrawer
|
|
||||||
open={open}
|
|
||||||
variant="persistent"
|
|
||||||
onClose={() => setDrawerOpen(false)}
|
|
||||||
elevation={0}
|
|
||||||
PaperProps={{
|
|
||||||
sx: {
|
|
||||||
background: "rgb(0 0 0 / 0.5)",
|
|
||||||
backdropFilter: "blur(10px)",
|
|
||||||
boxShadow: "0 0 15px rgb(0 0 0 / 0.2)",
|
|
||||||
width: 260,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
className="sidemenu-open"
|
|
||||||
>
|
|
||||||
<DrawerHeader
|
|
||||||
className="Mui-DrawerHeader"
|
|
||||||
sx={{
|
|
||||||
justifyContent: "flex-start",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<IconButton onClick={() => setDrawerOpen(false)}>
|
|
||||||
<MdiClose />
|
|
||||||
</IconButton>
|
|
||||||
</DrawerHeader>
|
|
||||||
<Divider />
|
|
||||||
{libraries.isLoading ? (
|
|
||||||
<>
|
|
||||||
<Skeleton
|
|
||||||
height="100%"
|
|
||||||
variant="rounded"
|
|
||||||
width="calc(100% - 10px )"
|
|
||||||
sx={{ margin: "5px" }}
|
|
||||||
></Skeleton>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<List sx={{ border: "none" }}>
|
|
||||||
{libraries.data.Items.map(
|
|
||||||
(library, index) => {
|
|
||||||
return (
|
|
||||||
<Tooltip
|
|
||||||
title={library.Name}
|
|
||||||
placement="right"
|
|
||||||
arrow
|
|
||||||
followCursor
|
|
||||||
key={index}
|
|
||||||
>
|
|
||||||
<ListItem
|
|
||||||
className="sidemenu-item-container"
|
|
||||||
disablePadding
|
|
||||||
>
|
|
||||||
<ListItemButton
|
|
||||||
component={
|
|
||||||
NavLink
|
|
||||||
}
|
|
||||||
to={
|
|
||||||
"/library/" +
|
|
||||||
library.Id
|
|
||||||
}
|
|
||||||
className="sidemenu-item"
|
|
||||||
sx={{
|
|
||||||
minHeight: 48,
|
|
||||||
justifyContent:
|
|
||||||
"center",
|
|
||||||
px: 2.5,
|
|
||||||
flexDirection:
|
|
||||||
"row",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ListItemIcon
|
|
||||||
sx={{
|
|
||||||
minWidth: 0,
|
|
||||||
justifyContent:
|
|
||||||
"center",
|
|
||||||
mr: 2,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
MediaCollectionTypeIconCollection[
|
|
||||||
library
|
|
||||||
.CollectionType
|
|
||||||
]
|
|
||||||
}
|
|
||||||
</ListItemIcon>
|
|
||||||
<ListItemText>
|
|
||||||
{
|
|
||||||
library.Name
|
|
||||||
}
|
|
||||||
</ListItemText>
|
|
||||||
</ListItemButton>
|
|
||||||
</ListItem>
|
|
||||||
</Tooltip>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)}
|
|
||||||
</List>
|
|
||||||
<List sx={{ marginTop: "auto" }}>
|
|
||||||
<Divider />
|
|
||||||
<Tooltip
|
|
||||||
title="Home"
|
|
||||||
placement="right"
|
|
||||||
followCursor
|
|
||||||
arrow
|
|
||||||
>
|
|
||||||
<ListItem
|
|
||||||
className="sidemenu-item-container"
|
|
||||||
disablePadding
|
|
||||||
>
|
|
||||||
<ListItemButton
|
|
||||||
component={NavLink}
|
|
||||||
to="/home"
|
|
||||||
className="sidemenu-item"
|
|
||||||
sx={{
|
|
||||||
minHeight: 48,
|
|
||||||
justifyContent:
|
|
||||||
"center",
|
|
||||||
px: 2.5,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ListItemIcon
|
|
||||||
sx={{
|
|
||||||
minWidth: 0,
|
|
||||||
justifyContent:
|
|
||||||
"center",
|
|
||||||
mr: 2,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<MdiHomeVariantOutline />
|
|
||||||
</ListItemIcon>
|
|
||||||
<ListItemText>
|
|
||||||
Home
|
|
||||||
</ListItemText>
|
|
||||||
</ListItemButton>
|
|
||||||
</ListItem>
|
|
||||||
</Tooltip>
|
|
||||||
<Tooltip
|
|
||||||
title="Logout"
|
|
||||||
placement="right"
|
|
||||||
followCursor
|
|
||||||
arrow
|
|
||||||
>
|
|
||||||
<ListItem disablePadding>
|
|
||||||
<ListItemButton
|
|
||||||
sx={{
|
|
||||||
minHeight: 48,
|
|
||||||
justifyContent:
|
|
||||||
"center",
|
|
||||||
px: 2.5,
|
|
||||||
}}
|
|
||||||
onClick={handleLogout}
|
|
||||||
>
|
|
||||||
<ListItemIcon
|
|
||||||
sx={{
|
|
||||||
minWidth: 0,
|
|
||||||
justifyContent:
|
|
||||||
"center",
|
|
||||||
mr: 2,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<MdiLogoutVariant></MdiLogoutVariant>
|
|
||||||
</ListItemIcon>
|
|
||||||
<ListItemText>
|
|
||||||
Logout
|
|
||||||
</ListItemText>
|
|
||||||
</ListItemButton>
|
|
||||||
</ListItem>
|
|
||||||
</Tooltip>
|
|
||||||
</List>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</MuiDrawer>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
.sidemenu {
|
.sidemenu {
|
||||||
|
&-icon {
|
||||||
|
width: 60%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
&-item {
|
&-item {
|
||||||
&-container {
|
&-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -22,6 +27,10 @@
|
|||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: white;
|
color: white;
|
||||||
|
.material-symbols-rounded {
|
||||||
|
font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 25,
|
||||||
|
"opsz" 40;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
@@ -31,17 +40,19 @@
|
|||||||
transform: scaleX(1);
|
transform: scaleX(1);
|
||||||
}
|
}
|
||||||
.sidemenu-item-text {
|
.sidemenu-item-text {
|
||||||
max-height: 1.6em;
|
|
||||||
// transform: scaleY(1);
|
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
.material-symbols-rounded {
|
||||||
|
font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 25,
|
||||||
|
"opsz" 40;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-text {
|
&-text {
|
||||||
// transform: scaleY(0);
|
|
||||||
transform-origin: top;
|
|
||||||
transition: max-height 0.5s;
|
transition: max-height 0.5s;
|
||||||
max-height: 0;
|
transition-delay: 0.05s;
|
||||||
|
|
||||||
|
font-size: 0.7em !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-icon {
|
&-icon {
|
||||||
@@ -62,6 +73,7 @@
|
|||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
transition: opacity $transition-time-fast,
|
transition: opacity $transition-time-fast,
|
||||||
transform $transition-time-fast;
|
transform $transition-time-fast;
|
||||||
|
transition-delay: 0.1s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
import React from "react";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import "./musicTrack.module.scss";
|
import "./musicTrack.module.scss";
|
||||||
import { getRuntimeMusic } from "../../utils/date/time";
|
import { getRuntimeMusic } from "../../utils/date/time";
|
||||||
@@ -6,6 +7,8 @@ import LikeButton from "../buttons/likeButton";
|
|||||||
import TextLink from "../textLink";
|
import TextLink from "../textLink";
|
||||||
import PlayButton from "../buttons/playButton";
|
import PlayButton from "../buttons/playButton";
|
||||||
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
||||||
|
import { MdiMusic } from "../icons/mdiMusic";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Props
|
* @typedef {Object} Props
|
||||||
@@ -32,13 +35,22 @@ const MusicTrack = ({
|
|||||||
trackIndex,
|
trackIndex,
|
||||||
className = "",
|
className = "",
|
||||||
}) => {
|
}) => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
const [currentTrackItem] = useAudioPlayback((state) => [state.item]);
|
const [currentTrackItem] = useAudioPlayback((state) => [state.item]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`music-track ${className}`}>
|
<div className={`music-track ${className}`}>
|
||||||
<div className="music-track-image">
|
<div className="music-track-image">
|
||||||
|
<div className="music-track-icon">
|
||||||
|
<MdiMusic
|
||||||
|
sx={{
|
||||||
|
fontSize: "2em !important",
|
||||||
|
fill: "url(#clr-gradient-default) !important",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<img
|
<img
|
||||||
src={window.api.getItemImageUrl(
|
src={api.getItemImageUrl(
|
||||||
Object.keys(item.ImageTags).length == 0
|
Object.keys(item.ImageTags).length == 0
|
||||||
? item.AlbumId
|
? item.AlbumId
|
||||||
: item.Id,
|
: item.Id,
|
||||||
@@ -93,13 +105,14 @@ const MusicTrack = ({
|
|||||||
{item.ArtistItems.map((artist, index) => (
|
{item.ArtistItems.map((artist, index) => (
|
||||||
<>
|
<>
|
||||||
<TextLink
|
<TextLink
|
||||||
text={artist.Name}
|
|
||||||
variant={"subtitle2"}
|
variant={"subtitle2"}
|
||||||
location={`/artist/${artist.Id}`}
|
location={`/artist/${artist.Id}`}
|
||||||
otherProps={{
|
otherProps={{
|
||||||
fontWeight: 400,
|
fontWeight: 400,
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
{artist.Name}
|
||||||
|
</TextLink>
|
||||||
{index != item.ArtistItems.length - 1 && (
|
{index != item.ArtistItems.length - 1 && (
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
@@ -112,14 +125,6 @@ const MusicTrack = ({
|
|||||||
</>
|
</>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
{/* <Typography
|
|
||||||
variant="subtitle2"
|
|
||||||
style={{
|
|
||||||
opacity: 0.5,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{item.Name}
|
|
||||||
</Typography> */}
|
|
||||||
</div>
|
</div>
|
||||||
<Typography variant="subtitl1">
|
<Typography variant="subtitl1">
|
||||||
{getRuntimeMusic(item.RunTimeTicks)}
|
{getRuntimeMusic(item.RunTimeTicks)}
|
||||||
|
|||||||
@@ -7,12 +7,25 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-items: center;
|
justify-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
&-icon {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: rgb(255 255 255 / 0.09);
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
&-image {
|
&-image {
|
||||||
margin: 0.4em;
|
margin: 0.4em;
|
||||||
border-radius: $border-radius-default;
|
border-radius: $border-radius-default;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
width: 4em;
|
||||||
&-overlay {
|
&-overlay {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -27,7 +40,7 @@
|
|||||||
transition: opacity $transition-time-fast;
|
transition: opacity $transition-time-fast;
|
||||||
}
|
}
|
||||||
box-shadow: 0 0 10px rgb(0 0 0 / 0.2);
|
box-shadow: 0 0 10px rgb(0 0 0 / 0.2);
|
||||||
transition: opacity $transition-time-fast;
|
transition: opacity $transition-time-default;
|
||||||
}
|
}
|
||||||
&-info {
|
&-info {
|
||||||
justify-self: start;
|
justify-self: start;
|
||||||
|
|||||||
@@ -19,6 +19,11 @@
|
|||||||
|
|
||||||
#waveform {
|
#waveform {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
transform: scaleY(0);
|
||||||
|
transition: transform $transition-time-default;
|
||||||
|
&[data-show="true"] {
|
||||||
|
transform: scaleY(1) !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&-controls {
|
&-controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useEffect, useRef, useState } from "react";
|
import React, { useEffect, useRef, useState } from "react";
|
||||||
|
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
|
|
||||||
@@ -34,36 +34,10 @@ import { MdiVolumeHigh } from "../../icons/mdiVolumeHigh";
|
|||||||
import { MdiVolumeOff } from "../../icons/mdiVolumeOff";
|
import { MdiVolumeOff } from "../../icons/mdiVolumeOff";
|
||||||
import { MdiPlaylistMusicOutline } from "../../icons/mdiPlaylistMusicOutline";
|
import { MdiPlaylistMusicOutline } from "../../icons/mdiPlaylistMusicOutline";
|
||||||
import MusicTrack from "../../musicTrack";
|
import MusicTrack from "../../musicTrack";
|
||||||
|
import { useApi } from "../../../utils/store/api";
|
||||||
|
|
||||||
const AudioPlayer = () => {
|
const AudioPlayer = () => {
|
||||||
const user = useQuery({
|
const [api] = useApi((state) => [state.api]);
|
||||||
queryKey: ["user"],
|
|
||||||
queryFn: async () => {
|
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
|
||||||
return usr.data;
|
|
||||||
},
|
|
||||||
networkMode: "always",
|
|
||||||
});
|
|
||||||
|
|
||||||
const waveSurferRef = useRef(null);
|
|
||||||
const waveSurferContainerRef = useRef(null);
|
|
||||||
|
|
||||||
const [playerReady, setPlayerReady] = useState(false);
|
|
||||||
const [playing, setPlaying] = useState(true);
|
|
||||||
const [volume, setVolume] = useState(0.8);
|
|
||||||
const [isMuted, setIsMuted] = useState(false);
|
|
||||||
|
|
||||||
const [loading, setLoading] = useState(true);
|
|
||||||
|
|
||||||
const [showWaveform, setShowWaveform] = useState(false);
|
|
||||||
|
|
||||||
const [currentTime, setCurrentTime] = useState(0);
|
|
||||||
|
|
||||||
const [queueButton, setQueueButton] = useState(null);
|
|
||||||
const handleOpenQueue = (event) => {
|
|
||||||
setQueueButton(queueButton ? null : event.currentTarget);
|
|
||||||
};
|
|
||||||
|
|
||||||
const [
|
const [
|
||||||
url,
|
url,
|
||||||
display,
|
display,
|
||||||
@@ -92,17 +66,47 @@ const AudioPlayer = () => {
|
|||||||
state.playlistItemId,
|
state.playlistItemId,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const user = useQuery({
|
||||||
|
queryKey: ["user"],
|
||||||
|
queryFn: async () => {
|
||||||
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
|
return usr.data;
|
||||||
|
},
|
||||||
|
networkMode: "always",
|
||||||
|
enabled: Boolean(display),
|
||||||
|
});
|
||||||
|
|
||||||
|
const waveSurferRef = useRef(null);
|
||||||
|
const waveSurferContainerRef = useRef(null);
|
||||||
|
|
||||||
|
const [playerReady, setPlayerReady] = useState(false);
|
||||||
|
const [playing, setPlaying] = useState(true);
|
||||||
|
const [volume, setVolume] = useState(0.8);
|
||||||
|
const [isMuted, setIsMuted] = useState(false);
|
||||||
|
|
||||||
|
const [loading, setLoading] = useState(true);
|
||||||
|
|
||||||
|
const [showWaveform, setShowWaveform] = useState(false);
|
||||||
|
|
||||||
|
const [currentTime, setCurrentTime] = useState(0);
|
||||||
|
|
||||||
|
const [queueButton, setQueueButton] = useState(null);
|
||||||
|
const handleOpenQueue = (event) => {
|
||||||
|
setQueueButton(queueButton ? null : event.currentTarget);
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (display) {
|
if (display) {
|
||||||
const waveSurfer = WaveSurfer.create({
|
const waveSurfer = WaveSurfer.create({
|
||||||
container: waveSurferContainerRef.current,
|
container: waveSurferContainerRef.current,
|
||||||
barHeight: 0.8,
|
|
||||||
dragToSeek: true,
|
dragToSeek: true,
|
||||||
height: 35,
|
height: 35,
|
||||||
cursorColor: "#fb2376",
|
cursorColor: "#fb2376",
|
||||||
progressColor: "#fb2376",
|
progressColor: "#fb2376",
|
||||||
waveColor: "#ffffff2f",
|
waveColor: "#ffffff2f",
|
||||||
normalize: true,
|
normalize: true,
|
||||||
|
barHeight: 0.6,
|
||||||
|
backend: "MediaElementWebAudio",
|
||||||
});
|
});
|
||||||
waveSurfer.load(url);
|
waveSurfer.load(url);
|
||||||
waveSurfer.on("load", () => {
|
waveSurfer.on("load", () => {
|
||||||
@@ -133,12 +137,12 @@ const AudioPlayer = () => {
|
|||||||
if (currentTrack != tracks.length - 1) {
|
if (currentTrack != tracks.length - 1) {
|
||||||
setCurrentTrack(currentTrack + 1);
|
setCurrentTrack(currentTrack + 1);
|
||||||
setAudioUrl(
|
setAudioUrl(
|
||||||
`${window.api.basePath}/Audio/${
|
`${api.basePath}/Audio/${
|
||||||
tracks[currentTrack + 1].Id
|
tracks[currentTrack + 1].Id
|
||||||
}/universal?deviceId=${
|
}/universal?deviceId=${
|
||||||
window.api.deviceInfo.id
|
api.deviceInfo.id
|
||||||
}&userId=${user.data.Id}&api_key=${
|
}&userId=${user.data.Id}&api_key=${
|
||||||
window.api.accessToken
|
api.accessToken
|
||||||
}`,
|
}`,
|
||||||
);
|
);
|
||||||
setAudioItem(tracks[currentTrack + 1]);
|
setAudioItem(tracks[currentTrack + 1]);
|
||||||
@@ -171,11 +175,11 @@ const AudioPlayer = () => {
|
|||||||
setPlaying(false);
|
setPlaying(false);
|
||||||
setCurrentTrack(currentTrack + 1);
|
setCurrentTrack(currentTrack + 1);
|
||||||
setAudioUrl(
|
setAudioUrl(
|
||||||
`${window.api.basePath}/Audio/${
|
`${api.basePath}/Audio/${
|
||||||
tracks[currentTrack + 1].Id
|
tracks[currentTrack + 1].Id
|
||||||
}/universal?deviceId=${window.api.deviceInfo.id}&userId=${
|
}/universal?deviceId=${api.deviceInfo.id}&userId=${
|
||||||
user.data.Id
|
user.data.Id
|
||||||
}&api_key=${window.api.accessToken}`,
|
}&api_key=${api.accessToken}`,
|
||||||
);
|
);
|
||||||
setAudioItem(tracks[currentTrack + 1]);
|
setAudioItem(tracks[currentTrack + 1]);
|
||||||
setShowWaveform(false);
|
setShowWaveform(false);
|
||||||
@@ -185,18 +189,18 @@ const AudioPlayer = () => {
|
|||||||
setPlaying(false);
|
setPlaying(false);
|
||||||
setCurrentTrack(currentTrack - 1);
|
setCurrentTrack(currentTrack - 1);
|
||||||
setAudioUrl(
|
setAudioUrl(
|
||||||
`${window.api.basePath}/Audio/${
|
`${api.basePath}/Audio/${
|
||||||
tracks[currentTrack - 1].Id
|
tracks[currentTrack - 1].Id
|
||||||
}/universal?deviceId=${window.api.deviceInfo.id}&userId=${
|
}/universal?deviceId=${api.deviceInfo.id}&userId=${
|
||||||
user.data.Id
|
user.data.Id
|
||||||
}&api_key=${window.api.accessToken}`,
|
}&api_key=${api.accessToken}`,
|
||||||
);
|
);
|
||||||
setAudioItem(tracks[currentTrack - 1]);
|
setAudioItem(tracks[currentTrack - 1]);
|
||||||
setShowWaveform(false);
|
setShowWaveform(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AnimatePresence>
|
<AnimatePresence mode="sync">
|
||||||
{display && (
|
{display && (
|
||||||
<motion.div
|
<motion.div
|
||||||
key={display}
|
key={display}
|
||||||
@@ -213,7 +217,7 @@ const AudioPlayer = () => {
|
|||||||
)} - 10px)`,
|
)} - 10px)`,
|
||||||
}}
|
}}
|
||||||
transition={{
|
transition={{
|
||||||
duration: 0.1,
|
duration: 0.2,
|
||||||
ease: "easeInOut",
|
ease: "easeInOut",
|
||||||
}}
|
}}
|
||||||
className="audio-player"
|
className="audio-player"
|
||||||
@@ -234,7 +238,7 @@ const AudioPlayer = () => {
|
|||||||
<div className="audio-player-image-container">
|
<div className="audio-player-image-container">
|
||||||
<img
|
<img
|
||||||
className="audio-player-image"
|
className="audio-player-image"
|
||||||
src={window.api.getItemImageUrl(
|
src={api.getItemImageUrl(
|
||||||
Object.keys(item.ImageTags)
|
Object.keys(item.ImageTags)
|
||||||
.length == 0
|
.length == 0
|
||||||
? item.AlbumId
|
? item.AlbumId
|
||||||
@@ -282,7 +286,9 @@ const AudioPlayer = () => {
|
|||||||
onClick={handlePrevious}
|
onClick={handlePrevious}
|
||||||
disabled={currentTrack == 0}
|
disabled={currentTrack == 0}
|
||||||
>
|
>
|
||||||
<MdiSkipPrevious />
|
<div className="material-symbols-rounded">
|
||||||
|
skip_previous
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
@@ -305,11 +311,16 @@ const AudioPlayer = () => {
|
|||||||
size="small"
|
size="small"
|
||||||
onClick={handlePlayPause}
|
onClick={handlePlayPause}
|
||||||
>
|
>
|
||||||
{playing ? (
|
<div
|
||||||
<MdiPause />
|
className="material-symbols-rounded"
|
||||||
) : (
|
style={{
|
||||||
<MdiPlay />
|
fontSize: "2em",
|
||||||
)}
|
}}
|
||||||
|
>
|
||||||
|
{playing
|
||||||
|
? "pause"
|
||||||
|
: "play_arrow"}
|
||||||
|
</div>
|
||||||
</Fab>
|
</Fab>
|
||||||
</div>
|
</div>
|
||||||
<IconButton
|
<IconButton
|
||||||
@@ -318,7 +329,9 @@ const AudioPlayer = () => {
|
|||||||
tracks.length - 1 == currentTrack
|
tracks.length - 1 == currentTrack
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<MdiSkipNext />
|
<div className="material-symbols-rounded">
|
||||||
|
skip_next
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -343,11 +356,8 @@ const AudioPlayer = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
<div
|
<div
|
||||||
id="waveform"
|
id="waveform"
|
||||||
style={{
|
|
||||||
opacity: showWaveform ? 1 : 0,
|
|
||||||
transition: "opacity 250ms",
|
|
||||||
}}
|
|
||||||
ref={waveSurferContainerRef}
|
ref={waveSurferContainerRef}
|
||||||
|
data-show={Boolean(showWaveform)}
|
||||||
></div>
|
></div>
|
||||||
<Typography
|
<Typography
|
||||||
variant="subtitle2"
|
variant="subtitle2"
|
||||||
@@ -397,18 +407,18 @@ const AudioPlayer = () => {
|
|||||||
</Paper>
|
</Paper>
|
||||||
</Popper>
|
</Popper>
|
||||||
<IconButton onClick={handleOpenQueue} disabled>
|
<IconButton onClick={handleOpenQueue} disabled>
|
||||||
<MdiPlaylistMusicOutline />
|
<div className="material-symbols-rounded">
|
||||||
|
queue_music
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
setIsMuted(!isMuted);
|
setIsMuted(!isMuted);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isMuted ? (
|
<div className="material-symbols-rounded">
|
||||||
<MdiVolumeOff />
|
{isMuted ? "volume_mute" : "volume_up"}
|
||||||
) : (
|
</div>
|
||||||
<MdiVolumeHigh />
|
|
||||||
)}
|
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Slider
|
<Slider
|
||||||
value={isMuted ? 0 : volume * 100}
|
value={isMuted ? 0 : volume * 100}
|
||||||
@@ -452,7 +462,9 @@ const AudioPlayer = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<IconButton onClick={resetPlayer}>
|
<IconButton onClick={resetPlayer}>
|
||||||
<MdiClose />
|
<div className="material-symbols-rounded">
|
||||||
|
close
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
import React from "react";
|
||||||
import { MdiMovieOutline } from "../icons/mdiMovieOutline";
|
import { MdiMovieOutline } from "../icons/mdiMovieOutline";
|
||||||
import { MdiMusicBoxMultipleOutline } from "../icons/mdiMusicBoxMultipleOutline";
|
import { MdiMusicBoxMultipleOutline } from "../icons/mdiMusicBoxMultipleOutline";
|
||||||
import { MdiPlaylistMusicOutline } from "../icons/mdiPlaylistMusicOutline";
|
import { MdiPlaylistMusicOutline } from "../icons/mdiPlaylistMusicOutline";
|
||||||
@@ -25,6 +25,7 @@ import { MdiMusic } from "../icons/mdiMusic";
|
|||||||
import { MdiAccountTie } from "../icons/mdiAccountTie";
|
import { MdiAccountTie } from "../icons/mdiAccountTie";
|
||||||
import { MdiAccount } from "../icons/mdiAccount";
|
import { MdiAccount } from "../icons/mdiAccount";
|
||||||
import { MdiFilmstripBoxMultiple } from "../icons/mdiFilmstripBoxMultiple";
|
import { MdiFilmstripBoxMultiple } from "../icons/mdiFilmstripBoxMultiple";
|
||||||
|
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
|
||||||
export const MediaCollectionTypeIconCollection = {
|
export const MediaCollectionTypeIconCollection = {
|
||||||
universal: <MdiMultimedia />,
|
universal: <MdiMultimedia />,
|
||||||
@@ -43,15 +44,6 @@ export const MediaCollectionTypeIconCollection = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const MediaCollectionTypeIconCollectionCard = {
|
export const MediaCollectionTypeIconCollectionCard = {
|
||||||
universal: <MdiMultimedia className="card-image-icon" />,
|
|
||||||
movies: <MdiMovieOutline className="card-image-icon" />,
|
|
||||||
music: <MdiMusicBoxMultipleOutline className="card-image-icon" />,
|
|
||||||
playlists: <MdiPlaylistMusicOutline className="card-image-icon" />,
|
|
||||||
tvshows: <MdiTelevision className="card-image-icon" />,
|
|
||||||
boxsets: <MdiFilmstripBoxMultiple className="card-image-icon" />,
|
|
||||||
musicvideos: <MdiFolderMusicOutline className="card-image-icon" />,
|
|
||||||
trailers: <MdiYoutube className="card-image-icon" />,
|
|
||||||
books: <MdiBookMultiple className="card-image-icon" />,
|
|
||||||
photos: <MdiImageMultiple className="card-image-icon" />,
|
photos: <MdiImageMultiple className="card-image-icon" />,
|
||||||
livetv: <MdiTelevisionClassic className="card-image-icon" />,
|
livetv: <MdiTelevisionClassic className="card-image-icon" />,
|
||||||
folder: <MdiFolderOutline className="card-image-icon" />,
|
folder: <MdiFolderOutline className="card-image-icon" />,
|
||||||
@@ -67,47 +59,111 @@ export const MediaTypeIconCollection = {
|
|||||||
AudioBook: <MdiBookMusic className="hero-carousel-background-icon" />,
|
AudioBook: <MdiBookMusic className="hero-carousel-background-icon" />,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const TypeIconCollectionCard = {
|
export const getTypeIcon = (icon) => {
|
||||||
Actor: <MdiAccountTie className="card-image-icon" />,
|
switch (icon) {
|
||||||
AggregateFolder: <MdiFolderMultiple className="card-image-icon" />,
|
case "Home":
|
||||||
Audio: <MdiMicrophone className="card-image-icon" />,
|
return <div className="material-symbols-rounded">home</div>;
|
||||||
AudioBook: <MdiBookMusic className="card-image-icon" />,
|
case BaseItemKind.Audio:
|
||||||
BasePluginFolder: <MdiFolderOutline className="card-image-icon" />,
|
return <div className="material-symbols-rounded">mic</div>;
|
||||||
Book: <MdiBook className="card-image-icon" />,
|
case BaseItemKind.AudioBook:
|
||||||
BoxSet: <MdiPlayBoxMultiple className="card-image-icon" />,
|
return (
|
||||||
Channel: <MdiTelevisionClassic className="card-image-icon" />,
|
<div className="material-symbols-rounded">
|
||||||
ChannelFolderItem: <MdiTelevisionClassic className="card-image-icon" />,
|
speech_to_text
|
||||||
CollectionFolder: <MdiFolderOutline className="card-image-icon" />,
|
</div>
|
||||||
Episode: <MdiTelevisionClassic className="card-image-icon" />,
|
);
|
||||||
Folder: <MdiFolderOutline className="card-image-icon" />,
|
case BaseItemKind.Book:
|
||||||
LiveTvChannel: <MdiTelevisionClassic className="card-image-icon" />,
|
return <div className="material-symbols-rounded">book</div>;
|
||||||
LiveTvProgram: <MdiTelevisionClassic className="card-image-icon" />,
|
case "boxsets":
|
||||||
ManualPlaylistsFolder: (
|
case BaseItemKind.BoxSet:
|
||||||
<MdiPlaylistMusicOutline className="card-image-icon" />
|
return (
|
||||||
),
|
<div className="material-symbols-rounded">
|
||||||
Movie: <MdiFilmstrip className="card-image-icon" />,
|
video_library
|
||||||
MusicAlbum: <MdiAlbum className="card-image-icon" />,
|
</div>
|
||||||
MusicArtist: <MdiAccountMusic className="card-image-icon" />,
|
);
|
||||||
MusicGenre: <MdiDramaMasks className="card-image-icon" />,
|
case "livetv":
|
||||||
MusicVideo: <MdiMusic className="card-image-icon" />,
|
case BaseItemKind.TvProgram:
|
||||||
Person: <MdiAccountTie className="card-image-icon" />,
|
case BaseItemKind.TvChannel:
|
||||||
Photo: <MdiImage className="card-image-icon" />,
|
case BaseItemKind.Program:
|
||||||
PhotoAlbum: <MdiImageMultiple className="card-image-icon" />,
|
case BaseItemKind.Recording:
|
||||||
Playlist: <MdiPlaylistMusicOutline className="card-image-icon" />,
|
case BaseItemKind.LiveTvChannel:
|
||||||
PlaylistsFolder: <MdiPlaylistMusicOutline className="card-image-icon" />,
|
case BaseItemKind.LiveTvProgram:
|
||||||
Program: <MdiTelevisionClassic className="card-image-icon" />,
|
case BaseItemKind.ChannelFolderItem:
|
||||||
Recording: <MdiTelevisionClassic className="card-image-icon" />,
|
case BaseItemKind.Channel:
|
||||||
Season: <MdiTelevisionClassic className="card-image-icon" />,
|
return (
|
||||||
Series: <MdiTelevisionClassic className="card-image-icon" />,
|
<div className="material-symbols-rounded">
|
||||||
Studio: <MdiMultimedia className="card-image-icon" />,
|
settings_input_antenna
|
||||||
Trailer: <MdiYoutube className="card-image-icon" />,
|
</div>
|
||||||
TvChannel: <MdiTelevisionClassic className="card-image-icon" />,
|
);
|
||||||
TvProgram: <MdiTelevisionClassic className="card-image-icon" />,
|
case "tvshows":
|
||||||
User: <MdiAccount className="card-image-icon" />,
|
case BaseItemKind.Season:
|
||||||
UserRootFolder: <MdiFolderOutline className="card-image-icon" />,
|
case BaseItemKind.Series:
|
||||||
UserView: <MdiMultimedia className="card-image-icon" />,
|
case BaseItemKind.Episode:
|
||||||
Video: <MdiFilmstrip className="card-image-icon" />,
|
return <div className="material-symbols-rounded">tv_gen</div>;
|
||||||
Year: <MdiMultimedia className="card-image-icon" />,
|
case "playlists":
|
||||||
Genre: <MdiDramaMasks className="card-image-icon" />,
|
case BaseItemKind.Playlist:
|
||||||
Library: <MdiMultimedia className="card-image-icon" />,
|
case BaseItemKind.PlaylistsFolder:
|
||||||
|
case BaseItemKind.ManualPlaylistsFolder:
|
||||||
|
return (
|
||||||
|
<div className="material-symbols-rounded">queue_music</div>
|
||||||
|
);
|
||||||
|
case "movies":
|
||||||
|
case BaseItemKind.Movie:
|
||||||
|
return <div className="material-symbols-rounded">movie</div>;
|
||||||
|
case BaseItemKind.MusicAlbum:
|
||||||
|
return <div className="material-symbols-rounded">album</div>;
|
||||||
|
case BaseItemKind.MusicArtist:
|
||||||
|
return <div className="material-symbols-rounded">artist</div>;
|
||||||
|
case BaseItemKind.Genre:
|
||||||
|
case BaseItemKind.MusicGenre:
|
||||||
|
return (
|
||||||
|
<div className="material-symbols-rounded">domino_mask</div>
|
||||||
|
);
|
||||||
|
case "musicvideos":
|
||||||
|
case BaseItemKind.MusicVideo:
|
||||||
|
return (
|
||||||
|
<div className="material-symbols-rounded">music_video</div>
|
||||||
|
);
|
||||||
|
case "User":
|
||||||
|
case BaseItemKind.Person:
|
||||||
|
return <div className="material-symbols-rounded">person</div>;
|
||||||
|
case BaseItemKind.Photo:
|
||||||
|
return <div className="material-symbols-rounded">image</div>;
|
||||||
|
case "photos":
|
||||||
|
case BaseItemKind.PhotoAlbum:
|
||||||
|
return (
|
||||||
|
<div className="material-symbols-rounded">
|
||||||
|
photo_library
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
case "universal":
|
||||||
|
case BaseItemKind.Studio:
|
||||||
|
return <div className="material-symbols-rounded">category</div>;
|
||||||
|
case "trailers":
|
||||||
|
case BaseItemKind.Trailer:
|
||||||
|
return (
|
||||||
|
<div className="material-symbols-rounded">
|
||||||
|
smart_display
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
case BaseItemKind.Video:
|
||||||
|
return <div className="material-symbols-rounded">theaters</div>;
|
||||||
|
case "music":
|
||||||
|
return (
|
||||||
|
<div className="material-symbols-rounded">
|
||||||
|
library_music
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
case "books":
|
||||||
|
return (
|
||||||
|
<div className="material-symbols-rounded">
|
||||||
|
library_books
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
case "folders":
|
||||||
|
return <div className="material-symbols-rounded">folder</div>;
|
||||||
|
default:
|
||||||
|
return (
|
||||||
|
<div className="material-symbols-rounded">description</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
@@ -5,17 +5,19 @@ import ReactDOM from "react-dom/client";
|
|||||||
|
|
||||||
import { BrowserRouter as Router } from "react-router-dom";
|
import { BrowserRouter as Router } from "react-router-dom";
|
||||||
|
|
||||||
import { invoke } from "@tauri-apps/api/tauri";
|
|
||||||
|
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
|
|
||||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||||
|
import { getDefaultServer, getServer } from "./utils/storage/servers";
|
||||||
|
import { getUser } from "./utils/storage/user";
|
||||||
|
import { createApi, useApi } from "./utils/store/api";
|
||||||
|
import { setInitialRoute } from "./utils/store/central";
|
||||||
|
|
||||||
const queryClient = new QueryClient({
|
const queryClient = new QueryClient({
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
queries: {
|
queries: {
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
cacheTime: 120000,
|
gcTime: 120000,
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
@@ -23,6 +25,35 @@ const queryClient = new QueryClient({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const init = async () => {
|
||||||
|
const defaultServerOnDisk = await getDefaultServer();
|
||||||
|
if (defaultServerOnDisk) {
|
||||||
|
const defaultServerInfo = await getServer(defaultServerOnDisk);
|
||||||
|
createApi(defaultServerInfo.address);
|
||||||
|
const userOnDisk = await getUser();
|
||||||
|
if (userOnDisk) {
|
||||||
|
try {
|
||||||
|
const auth = await useApi
|
||||||
|
.getState()
|
||||||
|
.api.authenticateUserByName(
|
||||||
|
userOnDisk.Name,
|
||||||
|
userOnDisk.Password,
|
||||||
|
);
|
||||||
|
createApi(defaultServerInfo.address, auth.data.AccessToken);
|
||||||
|
setInitialRoute("/home");
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
setInitialRoute("/error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setInitialRoute("/login/index");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setInitialRoute("/setup/server");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
init();
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById("root")).render(
|
ReactDOM.createRoot(document.getElementById("root")).render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
@@ -37,5 +68,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
// This will wait for the window to load, but you could
|
// This will wait for the window to load, but you could
|
||||||
// run this function on whatever trigger you want
|
// run this function on whatever trigger you want
|
||||||
console.info("Initial render complete");
|
console.info("Initial render complete");
|
||||||
invoke("close_splashscreen");
|
document
|
||||||
|
.querySelector(".app-loading")
|
||||||
|
.setAttribute("style", "display:none");
|
||||||
});
|
});
|
||||||
@@ -1,16 +1,31 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
.about {
|
.about {
|
||||||
&-sections {
|
display: grid;
|
||||||
&-container {
|
grid-template-columns: 1fr 1fr;
|
||||||
position: relative;
|
padding: 4em;
|
||||||
|
align-items: start;
|
||||||
|
&-section {
|
||||||
|
background: $clr-background-dark;
|
||||||
|
padding: 1em;
|
||||||
|
border-radius: 12px;
|
||||||
|
&.monospace * {
|
||||||
|
font-family: "JetBrains Mono Variable" !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-logo {
|
&-logo {
|
||||||
width: 75% !important;
|
|
||||||
max-width: 50vw;
|
max-width: 50vw;
|
||||||
height: 15em;
|
height: 5em;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
object-position: center;
|
object-position: center;
|
||||||
|
margin-bottom: 1em !important;
|
||||||
|
border-bottom: 1.4px solid rgb(255 255 255 / 0.05);
|
||||||
|
}
|
||||||
|
&-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0.5em 0;
|
||||||
|
gap: 1em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
import React, { useEffect } from "react";
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import Stack from "@mui/material/Stack";
|
import Stack from "@mui/material/Stack";
|
||||||
import Paper from "@mui/material/Paper";
|
import Paper from "@mui/material/Paper";
|
||||||
import TableContainer from "@mui/material/TableContainer";
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
import Table from "@mui/material/Table";
|
import Table from "@mui/material/Table";
|
||||||
import TableHead from "@mui/material/TableHead";
|
import TableHead from "@mui/material/TableHead";
|
||||||
import TableRow from "@mui/material/TableRow";
|
import TableRow from "@mui/material/TableRow";
|
||||||
@@ -13,149 +13,149 @@ import TableCell from "@mui/material/TableCell";
|
|||||||
import Link from "@mui/material/Link";
|
import Link from "@mui/material/Link";
|
||||||
|
|
||||||
import logo from "../../assets/logo.svg";
|
import logo from "../../assets/logo.svg";
|
||||||
import jellyfinLogo from "../../assets/jellyfinLogo.svg";
|
|
||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
|
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
|
||||||
|
|
||||||
import { version } from "../../../package.json";
|
|
||||||
|
|
||||||
import "./about.module.scss";
|
import "./about.module.scss";
|
||||||
|
import { axiosClient, useApi } from "../../utils/store/api";
|
||||||
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
|
import { useCentralStore } from "../../utils/store/central";
|
||||||
|
|
||||||
const About = () => {
|
const About = () => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
const systemInfo = useQuery({
|
const systemInfo = useQuery({
|
||||||
queryKey: ["about", "systemInfo"],
|
queryKey: ["about", "systemInfo"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getSystemApi(window.api).getSystemInfo();
|
const result = await getSystemApi(api).getSystemInfo();
|
||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
|
enabled: Boolean(api),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const [setBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||||
|
const [applicationVersion] = useCentralStore((state) => [
|
||||||
|
state.clientVersion,
|
||||||
|
]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setBackdrop("", "");
|
||||||
|
}, []);
|
||||||
|
if (systemInfo.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<div
|
||||||
component="main"
|
style={{
|
||||||
className="scrollY"
|
position: "fixed",
|
||||||
sx={{
|
top: "50%",
|
||||||
flexGrow: 1,
|
left: "50%",
|
||||||
pt: 11,
|
transform: "translate(-50%, -50%)",
|
||||||
px: 3,
|
|
||||||
pb: 3,
|
|
||||||
position: "relative",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<CircularProgress size={72} thickness={1.4} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<main className="scrollY about">
|
||||||
<Stack
|
<Stack
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
justifyContent="center"
|
justifyContent="center"
|
||||||
className="about-sections"
|
className="about-section monospace"
|
||||||
|
width="75%"
|
||||||
>
|
>
|
||||||
<Link
|
<a
|
||||||
href="https://github.com/prayag17/JellyPlayer"
|
href="https://github.com/prayag17/JellyPlayer"
|
||||||
className="about-logo"
|
className="about-logo"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
>
|
>
|
||||||
<img width="100%" height="100%" src={logo} />
|
<img width="100%" height="100%" src={logo} />
|
||||||
</Link>
|
</a>
|
||||||
<TableContainer
|
<div
|
||||||
component={Paper}
|
style={{
|
||||||
sx={{ width: "50%", borderRadius: "15px" }}
|
display: "flex",
|
||||||
>
|
flexDirection: "column",
|
||||||
<Table>
|
opacity: 0.9,
|
||||||
<TableBody>
|
|
||||||
<TableRow
|
|
||||||
sx={{
|
|
||||||
"&:last-child td, &:last-child th":
|
|
||||||
{
|
|
||||||
border: 0,
|
|
||||||
},
|
|
||||||
"&:hover": {
|
|
||||||
background:
|
|
||||||
"rgb(255 255 255 / 0.05)",
|
|
||||||
},
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<TableCell>
|
<div className="about-grid">
|
||||||
<Typography
|
<Typography variant="h6" fontWeight={300}>
|
||||||
variant="h4"
|
Server
|
||||||
fontWeight={100}
|
|
||||||
>
|
|
||||||
Version
|
|
||||||
</Typography>
|
</Typography>
|
||||||
</TableCell>
|
|
||||||
<TableCell>
|
|
||||||
<Typography
|
<Typography
|
||||||
variant="h4"
|
variant="h6"
|
||||||
sx={{ opacity: 0.7 }}
|
fontWeight={300}
|
||||||
>
|
|
||||||
{version}
|
|
||||||
</Typography>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow
|
|
||||||
sx={{
|
sx={{
|
||||||
"&:last-child td, &:last-child th":
|
opacity: 0.7,
|
||||||
{
|
|
||||||
border: 0,
|
|
||||||
},
|
|
||||||
"&:hover": {
|
|
||||||
background:
|
|
||||||
"rgb(255 255 255 / 0.05)",
|
|
||||||
},
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<TableCell>
|
{systemInfo.data.ServerName}
|
||||||
<Typography
|
|
||||||
variant="h4"
|
|
||||||
fontWeight={100}
|
|
||||||
>
|
|
||||||
Jellyfin Version
|
|
||||||
</Typography>
|
</Typography>
|
||||||
</TableCell>
|
</div>
|
||||||
<TableCell>
|
|
||||||
<Typography
|
<div className="about-grid">
|
||||||
variant="h4"
|
<Typography variant="h6" fontWeight={300}>
|
||||||
sx={{ opacity: 0.7 }}
|
Server Version
|
||||||
>
|
|
||||||
{systemInfo.isSuccess &&
|
|
||||||
systemInfo.data.Version}
|
|
||||||
</Typography>
|
</Typography>
|
||||||
</TableCell>
|
<Typography
|
||||||
</TableRow>
|
variant="h6"
|
||||||
<TableRow
|
fontWeight={300}
|
||||||
sx={{
|
sx={{
|
||||||
"&:last-child td, &:last-child th":
|
opacity: 0.7,
|
||||||
{
|
|
||||||
border: 0,
|
|
||||||
},
|
|
||||||
"&:hover": {
|
|
||||||
background:
|
|
||||||
"rgb(255 255 255 / 0.05)",
|
|
||||||
},
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<TableCell>
|
{systemInfo.data.Version}
|
||||||
<Typography
|
|
||||||
variant="h4"
|
|
||||||
fontWeight={100}
|
|
||||||
>
|
|
||||||
Server OS
|
|
||||||
</Typography>
|
</Typography>
|
||||||
</TableCell>
|
</div>
|
||||||
<TableCell>
|
|
||||||
<Typography
|
<div className="about-grid">
|
||||||
variant="h4"
|
<Typography variant="h6" fontWeight={300}>
|
||||||
sx={{ opacity: 0.7 }}
|
Operating System
|
||||||
>
|
|
||||||
{systemInfo.isSuccess &&
|
|
||||||
systemInfo.data
|
|
||||||
.OperatingSystemDisplayName}
|
|
||||||
</Typography>
|
</Typography>
|
||||||
</TableCell>
|
<Typography
|
||||||
</TableRow>
|
variant="h6"
|
||||||
</TableBody>
|
fontWeight={300}
|
||||||
</Table>
|
sx={{
|
||||||
</TableContainer>
|
opacity: 0.7,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{systemInfo.data.OperatingSystemDisplayName}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="about-grid">
|
||||||
|
<Typography variant="h6" fontWeight={300}>
|
||||||
|
Architecture
|
||||||
|
</Typography>
|
||||||
|
<Typography
|
||||||
|
variant="h6"
|
||||||
|
fontWeight={300}
|
||||||
|
sx={{
|
||||||
|
opacity: 0.7,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{systemInfo.data.SystemArchitecture}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="about-grid">
|
||||||
|
<Typography variant="h6" fontWeight={300}>
|
||||||
|
JellyPlayer Version
|
||||||
|
</Typography>
|
||||||
|
<Typography
|
||||||
|
variant="h6"
|
||||||
|
fontWeight={300}
|
||||||
|
sx={{
|
||||||
|
opacity: 0.7,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{applicationVersion}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</main>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
|
$border-radius: 20px;
|
||||||
|
|
||||||
.item-detail-album {
|
.item-detail-album {
|
||||||
&-track {
|
&-track {
|
||||||
display: grid;
|
display: grid;
|
||||||
@@ -9,22 +11,31 @@
|
|||||||
gap: 0.5em;
|
gap: 0.5em;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0.25em 0;
|
padding: 0.25em 0;
|
||||||
background: rgb(255 255 255 / 0);
|
background: hsl(256, 100%, 4%, 40%);
|
||||||
transition: background $transition-time-default;
|
transition: background $transition-time-default;
|
||||||
|
backdrop-filter: blur(5px);
|
||||||
|
|
||||||
&:first-child,
|
&:first-child {
|
||||||
&:last-child {
|
border-radius: $border-radius $border-radius 8px 8px;
|
||||||
border-bottom: none;
|
cursor: default !important;
|
||||||
}
|
}
|
||||||
border-bottom: 1px solid rgb(255 255 255 / 0.05);
|
|
||||||
|
&:last-child {
|
||||||
|
border-radius: 8px 8px $border-radius $border-radius;
|
||||||
|
}
|
||||||
|
border-radius: 8px;
|
||||||
|
|
||||||
&s {
|
&s {
|
||||||
border-radius: 10px !important;
|
background: transparent !important;
|
||||||
overflow: hidden !important;
|
box-shadow: none !important;
|
||||||
background: $clr-background-dark-opacity-0_8 !important;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: rgb(255 255 255 / 0.05);
|
background: hsl(256, 100%, 4%, 50%);
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.playing {
|
&.playing {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
@@ -33,6 +33,7 @@ import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
|||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
import LikeButton from "../../components/buttons/likeButton";
|
import LikeButton from "../../components/buttons/likeButton";
|
||||||
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
@@ -65,20 +66,22 @@ function a11yProps(index) {
|
|||||||
|
|
||||||
const MusicAlbumTitlePage = () => {
|
const MusicAlbumTitlePage = () => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
|
enabled: Boolean(api),
|
||||||
});
|
});
|
||||||
|
|
||||||
const item = useQuery({
|
const item = useQuery({
|
||||||
queryKey: ["item", id],
|
queryKey: ["item", id],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getUserLibraryApi(window.api).getItem({
|
const result = await getUserLibraryApi(api).getItem({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: id,
|
itemId: id,
|
||||||
fields: [ItemFields.Crew],
|
fields: [ItemFields.Crew],
|
||||||
@@ -93,7 +96,7 @@ const MusicAlbumTitlePage = () => {
|
|||||||
const similarItems = useQuery({
|
const similarItems = useQuery({
|
||||||
queryKey: ["item", id, "similarItem"],
|
queryKey: ["item", id, "similarItem"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let result = await getLibraryApi(window.api).getSimilarAlbums({
|
let result = await getLibraryApi(api).getSimilarAlbums({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: item.data.Id,
|
itemId: item.data.Id,
|
||||||
limit: 16,
|
limit: 16,
|
||||||
@@ -108,7 +111,7 @@ const MusicAlbumTitlePage = () => {
|
|||||||
const musicTracks = useQuery({
|
const musicTracks = useQuery({
|
||||||
queryKey: ["item", id, "musicTracks"],
|
queryKey: ["item", id, "musicTracks"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItems({
|
const result = await getItemsApi(api).getItems({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
parentId: item.data.Id,
|
parentId: item.data.Id,
|
||||||
sortOrder: SortOrder.Ascending,
|
sortOrder: SortOrder.Ascending,
|
||||||
@@ -139,7 +142,7 @@ const MusicAlbumTitlePage = () => {
|
|||||||
setAudioTracks(musicTracks.data.Items);
|
setAudioTracks(musicTracks.data.Items);
|
||||||
setCurrentAudioTrack(index);
|
setCurrentAudioTrack(index);
|
||||||
setAudioUrl(
|
setAudioUrl(
|
||||||
`${window.api.basePath}/Audio/${musicTracks.data.Items[index].Id}/universal?deviceId=${window.api.deviceInfo.id}&userId=${user.data.Id}&api_key=${window.api.accessToken}`,
|
`${api.basePath}/Audio/${musicTracks.data.Items[index].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${user.data.Id}&api_key=${api.accessToken}`,
|
||||||
);
|
);
|
||||||
setAudioItem(musicTracks.data.Items[index]);
|
setAudioItem(musicTracks.data.Items[index]);
|
||||||
setAudioDisplay(true);
|
setAudioDisplay(true);
|
||||||
@@ -152,14 +155,14 @@ const MusicAlbumTitlePage = () => {
|
|||||||
setAppBackdrop(
|
setAppBackdrop(
|
||||||
item.data.Type === BaseItemKind.MusicAlbum ||
|
item.data.Type === BaseItemKind.MusicAlbum ||
|
||||||
item.data.Type === BaseItemKind.Episode
|
item.data.Type === BaseItemKind.Episode
|
||||||
? `${window.api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
? `${api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
||||||
: `${window.api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
: `${api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||||
item.data.Id,
|
item.data.Id,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading || similarItems.isLoading) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@@ -195,7 +198,7 @@ const MusicAlbumTitlePage = () => {
|
|||||||
audioPlayButton
|
audioPlayButton
|
||||||
cardType="square"
|
cardType="square"
|
||||||
/>
|
/>
|
||||||
{musicTracks.isLoading ? (
|
{musicTracks.isPending ? (
|
||||||
<></>
|
<></>
|
||||||
) : (
|
) : (
|
||||||
musicTracks.data.TotalRecordCount > 0 && (
|
musicTracks.data.TotalRecordCount > 0 && (
|
||||||
@@ -211,9 +214,7 @@ const MusicAlbumTitlePage = () => {
|
|||||||
style={{
|
style={{
|
||||||
padding: "0.75em 0 ",
|
padding: "0.75em 0 ",
|
||||||
background:
|
background:
|
||||||
"rgb(255 255 255 / 0.1)",
|
"hsl(256, 100%, 4%, 60%)",
|
||||||
boxShadow:
|
|
||||||
"0 0 10px rgb(0 0 0 / 0.5)",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography
|
<Typography
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
@@ -10,7 +10,7 @@ import Tab from "@mui/material/Tab";
|
|||||||
|
|
||||||
import { AnimatePresence, motion } from "framer-motion";
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
|
|
||||||
import { useParams, useNavigate } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BaseItemKind,
|
BaseItemKind,
|
||||||
@@ -31,6 +31,7 @@ import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
|||||||
import { ArtistAlbum } from "../../components/layouts/artist/artistAlbum";
|
import { ArtistAlbum } from "../../components/layouts/artist/artistAlbum";
|
||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
import MusicTrack from "../../components/musicTrack";
|
import MusicTrack from "../../components/musicTrack";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
@@ -54,23 +55,14 @@ TabPanel.propTypes = {
|
|||||||
value: PropTypes.number.isRequired,
|
value: PropTypes.number.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
function a11yProps(index) {
|
|
||||||
return {
|
|
||||||
id: `full-width-tab-${index}`,
|
|
||||||
"aria-controls": `full-width-tabpanel-${index}`,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const ArtistTitlePage = () => {
|
const ArtistTitlePage = () => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
const navigate = useNavigate();
|
const [api] = useApi((state) => [state.api]);
|
||||||
const [primageImageLoaded, setPrimaryImageLoaded] = useState(false);
|
|
||||||
const [backdropImageLoaded, setBackdropImageLoaded] = useState(false);
|
|
||||||
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
@@ -79,7 +71,7 @@ const ArtistTitlePage = () => {
|
|||||||
const item = useQuery({
|
const item = useQuery({
|
||||||
queryKey: ["item", id],
|
queryKey: ["item", id],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getUserLibraryApi(window.api).getItem({
|
const result = await getUserLibraryApi(api).getItem({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: id,
|
itemId: id,
|
||||||
fields: [ItemFields.Crew],
|
fields: [ItemFields.Crew],
|
||||||
@@ -94,7 +86,7 @@ const ArtistTitlePage = () => {
|
|||||||
const artistDiscography = useQuery({
|
const artistDiscography = useQuery({
|
||||||
queryKey: ["item", id, "artist", "discography"],
|
queryKey: ["item", id, "artist", "discography"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItems({
|
const result = await getItemsApi(api).getItems({
|
||||||
albumArtistIds: [item.data.Id],
|
albumArtistIds: [item.data.Id],
|
||||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||||
sortOrder: [SortOrder.Descending],
|
sortOrder: [SortOrder.Descending],
|
||||||
@@ -112,7 +104,7 @@ const ArtistTitlePage = () => {
|
|||||||
const artistSongs = useQuery({
|
const artistSongs = useQuery({
|
||||||
queryKey: ["item", id, "artist", "songs"],
|
queryKey: ["item", id, "artist", "songs"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItems({
|
const result = await getItemsApi(api).getItems({
|
||||||
artistIds: [item.data.Id],
|
artistIds: [item.data.Id],
|
||||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||||
sortOrder: [SortOrder.Ascending],
|
sortOrder: [SortOrder.Ascending],
|
||||||
@@ -130,7 +122,7 @@ const ArtistTitlePage = () => {
|
|||||||
const artistAppearances = useQuery({
|
const artistAppearances = useQuery({
|
||||||
queryKey: ["item", id, "artist", "appearences"],
|
queryKey: ["item", id, "artist", "appearences"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItems({
|
const result = await getItemsApi(api).getItems({
|
||||||
contributingArtistIds: [item.data.Id],
|
contributingArtistIds: [item.data.Id],
|
||||||
excludeItemIds: [item.data.Id],
|
excludeItemIds: [item.data.Id],
|
||||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||||
@@ -167,9 +159,9 @@ const ArtistTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
artistDiscography.isLoading,
|
artistDiscography.isPending,
|
||||||
artistSongs.isLoading,
|
artistSongs.isPending,
|
||||||
artistAppearances.isLoading,
|
artistAppearances.isPending,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const [animationDirection, setAnimationDirection] = useState("forward");
|
const [animationDirection, setAnimationDirection] = useState("forward");
|
||||||
@@ -181,14 +173,14 @@ const ArtistTitlePage = () => {
|
|||||||
setAppBackdrop(
|
setAppBackdrop(
|
||||||
item.data.Type === BaseItemKind.MusicAlbum ||
|
item.data.Type === BaseItemKind.MusicAlbum ||
|
||||||
item.data.Type === BaseItemKind.Episode
|
item.data.Type === BaseItemKind.Episode
|
||||||
? `${window.api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
? `${api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
||||||
: `${window.api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
: `${api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||||
item.data.Id,
|
item.data.Id,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading) {
|
if (item.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@@ -312,7 +304,7 @@ const ArtistTitlePage = () => {
|
|||||||
>
|
>
|
||||||
{artistSongs.isSuccess &&
|
{artistSongs.isSuccess &&
|
||||||
artistSongs.data.Items.map(
|
artistSongs.data.Items.map(
|
||||||
(tabitem, aindex) => {
|
(tabitem) => {
|
||||||
return (
|
return (
|
||||||
<MusicTrack
|
<MusicTrack
|
||||||
item={tabitem}
|
item={tabitem}
|
||||||
@@ -358,7 +350,7 @@ const ArtistTitlePage = () => {
|
|||||||
>
|
>
|
||||||
{artistAppearances.isSuccess &&
|
{artistAppearances.isSuccess &&
|
||||||
artistAppearances.data.Items.map(
|
artistAppearances.data.Items.map(
|
||||||
(tabitem, aindex) => {
|
(tabitem) => {
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
key={
|
key={
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
@@ -24,6 +24,7 @@ import { CardScroller } from "../../components/cardScroller/cardScroller";
|
|||||||
import "./boxset.module.scss";
|
import "./boxset.module.scss";
|
||||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
@@ -47,30 +48,24 @@ TabPanel.propTypes = {
|
|||||||
value: PropTypes.number.isRequired,
|
value: PropTypes.number.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
function a11yProps(index) {
|
|
||||||
return {
|
|
||||||
id: `full-width-tab-${index}`,
|
|
||||||
"aria-controls": `full-width-tabpanel-${index}`,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const BoxSetTitlePage = () => {
|
const BoxSetTitlePage = () => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
const navigate = useNavigate();
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
|
enabled: Boolean(api),
|
||||||
});
|
});
|
||||||
|
|
||||||
const item = useQuery({
|
const item = useQuery({
|
||||||
queryKey: ["item", id],
|
queryKey: ["item", id],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getUserLibraryApi(window.api).getItem({
|
const result = await getUserLibraryApi(api).getItem({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: id,
|
itemId: id,
|
||||||
fields: [ItemFields.Crew],
|
fields: [ItemFields.Crew],
|
||||||
@@ -85,7 +80,7 @@ const BoxSetTitlePage = () => {
|
|||||||
const collectionItems = useQuery({
|
const collectionItems = useQuery({
|
||||||
queryKey: ["item", id, `collection`],
|
queryKey: ["item", id, `collection`],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItems({
|
const result = await getItemsApi(api).getItems({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
parentId: item.data.Id,
|
parentId: item.data.Id,
|
||||||
fields: [ItemFields.SeasonUserData, ItemFields.Overview],
|
fields: [ItemFields.SeasonUserData, ItemFields.Overview],
|
||||||
@@ -101,7 +96,7 @@ const BoxSetTitlePage = () => {
|
|||||||
const similarItems = useQuery({
|
const similarItems = useQuery({
|
||||||
queryKey: ["item", id, "similarItem"],
|
queryKey: ["item", id, "similarItem"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getLibraryApi(window.api).getSimilarItems({
|
const result = await getLibraryApi(api).getSimilarItems({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: item.data.Id,
|
itemId: item.data.Id,
|
||||||
limit: 16,
|
limit: 16,
|
||||||
@@ -122,8 +117,8 @@ const BoxSetTitlePage = () => {
|
|||||||
setAppBackdrop(
|
setAppBackdrop(
|
||||||
item.data.Type === BaseItemKind.MusicAlbum ||
|
item.data.Type === BaseItemKind.MusicAlbum ||
|
||||||
item.data.Type === BaseItemKind.Episode
|
item.data.Type === BaseItemKind.Episode
|
||||||
? `${window.api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
? `${api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
||||||
: `${window.api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
: `${api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||||
item.data.Id,
|
item.data.Id,
|
||||||
);
|
);
|
||||||
let direTp = item.data.People.filter(
|
let direTp = item.data.People.filter(
|
||||||
@@ -137,7 +132,7 @@ const BoxSetTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading || similarItems.isLoading) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
@@ -26,6 +26,7 @@ import "./episode.module.scss";
|
|||||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
import { ActorCard } from "../../components/card/actorCards";
|
import { ActorCard } from "../../components/card/actorCards";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
@@ -49,29 +50,24 @@ TabPanel.propTypes = {
|
|||||||
value: PropTypes.number.isRequired,
|
value: PropTypes.number.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
function a11yProps(index) {
|
|
||||||
return {
|
|
||||||
id: `full-width-tab-${index}`,
|
|
||||||
"aria-controls": `full-width-tabpanel-${index}`,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const EpisodeTitlePage = () => {
|
const EpisodeTitlePage = () => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
|
enabled: Boolean(api),
|
||||||
});
|
});
|
||||||
|
|
||||||
const item = useQuery({
|
const item = useQuery({
|
||||||
queryKey: ["item", id],
|
queryKey: ["item", id],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getUserLibraryApi(window.api).getItem({
|
const result = await getUserLibraryApi(api).getItem({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: id,
|
itemId: id,
|
||||||
fields: [ItemFields.Crew],
|
fields: [ItemFields.Crew],
|
||||||
@@ -127,7 +123,7 @@ const EpisodeTitlePage = () => {
|
|||||||
const upcomingEpisodes = useQuery({
|
const upcomingEpisodes = useQuery({
|
||||||
queryKey: ["item", id, "episode", "upcomingEpisodes"],
|
queryKey: ["item", id, "episode", "upcomingEpisodes"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItems({
|
const result = await getItemsApi(api).getItems({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
parentId: item.data.ParentId,
|
parentId: item.data.ParentId,
|
||||||
startIndex: item.data.IndexNumber,
|
startIndex: item.data.IndexNumber,
|
||||||
@@ -147,8 +143,8 @@ const EpisodeTitlePage = () => {
|
|||||||
setAppBackdrop(
|
setAppBackdrop(
|
||||||
item.data.Type === BaseItemKind.MusicAlbum ||
|
item.data.Type === BaseItemKind.MusicAlbum ||
|
||||||
item.data.Type === BaseItemKind.Episode
|
item.data.Type === BaseItemKind.Episode
|
||||||
? `${window.api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
? `${api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
||||||
: `${window.api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
: `${api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||||
item.data.Id,
|
item.data.Id,
|
||||||
);
|
);
|
||||||
let direTp = item.data.People.filter(
|
let direTp = item.data.People.filter(
|
||||||
@@ -162,7 +158,7 @@ const EpisodeTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading) {
|
if (item.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@@ -200,6 +196,7 @@ const EpisodeTitlePage = () => {
|
|||||||
favourParentImg={false}
|
favourParentImg={false}
|
||||||
isEpisode
|
isEpisode
|
||||||
cardType="thumb"
|
cardType="thumb"
|
||||||
|
enableVideoInfoStrip
|
||||||
/>
|
/>
|
||||||
{item.data.People.length > 0 && (
|
{item.data.People.length > 0 && (
|
||||||
<CardScroller
|
<CardScroller
|
||||||
@@ -207,7 +204,7 @@ const EpisodeTitlePage = () => {
|
|||||||
displayCards={8}
|
displayCards={8}
|
||||||
disableDecoration
|
disableDecoration
|
||||||
>
|
>
|
||||||
{item.data.People.map((person, index) => {
|
{item.data.People.map((person) => {
|
||||||
return (
|
return (
|
||||||
<ActorCard
|
<ActorCard
|
||||||
key={person.Id}
|
key={person.Id}
|
||||||
@@ -235,7 +232,7 @@ const EpisodeTitlePage = () => {
|
|||||||
disableDecoration
|
disableDecoration
|
||||||
>
|
>
|
||||||
{upcomingEpisodes.data.Items.map(
|
{upcomingEpisodes.data.Items.map(
|
||||||
(episode, index) => {
|
(episode) => {
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
key={episode.Id}
|
key={episode.Id}
|
||||||
|
|||||||
@@ -1,7 +1,345 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
import React, { useEffect } from "react";
|
||||||
|
|
||||||
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
|
|
||||||
|
import "./favorite.module.scss";
|
||||||
|
import Typography from "@mui/material/Typography";
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
|
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||||
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
|
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
||||||
|
import { Card } from "../../components/card/card";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
const FavoritePage = () => {
|
const FavoritePage = () => {
|
||||||
<></>;
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
const [setBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||||
|
|
||||||
|
const user = useQuery({
|
||||||
|
queryKey: ["user"],
|
||||||
|
queryFn: async () => {
|
||||||
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
|
return usr.data;
|
||||||
|
},
|
||||||
|
networkMode: "always",
|
||||||
|
enabled: Boolean(api),
|
||||||
|
});
|
||||||
|
|
||||||
|
const movies = useQuery({
|
||||||
|
queryKey: ["favorite", "movies"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getItemsApi(api).getItems({
|
||||||
|
userId: user.data.Id,
|
||||||
|
isFavorite: true,
|
||||||
|
includeItemTypes: [BaseItemKind.Movie],
|
||||||
|
recursive: true,
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const series = useQuery({
|
||||||
|
queryKey: ["favorite", "series"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getItemsApi(api).getItems({
|
||||||
|
userId: user.data.Id,
|
||||||
|
isFavorite: true,
|
||||||
|
includeItemTypes: [BaseItemKind.Series],
|
||||||
|
recursive: true,
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const musicAlbum = useQuery({
|
||||||
|
queryKey: ["favorite", "musicAlbum"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getItemsApi(api).getItems({
|
||||||
|
userId: user.data.Id,
|
||||||
|
isFavorite: true,
|
||||||
|
includeItemTypes: [BaseItemKind.MusicAlbum],
|
||||||
|
recursive: true,
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const audio = useQuery({
|
||||||
|
queryKey: ["favorite", "audio"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getItemsApi(api).getItems({
|
||||||
|
userId: user.data.Id,
|
||||||
|
isFavorite: true,
|
||||||
|
includeItemTypes: [BaseItemKind.Audio],
|
||||||
|
recursive: true,
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const book = useQuery({
|
||||||
|
queryKey: ["favorite", "book"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getItemsApi(api).getItems({
|
||||||
|
userId: user.data.Id,
|
||||||
|
isFavorite: true,
|
||||||
|
includeItemTypes: [BaseItemKind.Book],
|
||||||
|
recursive: true,
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const musicArtists = useQuery({
|
||||||
|
queryKey: ["favorite", "musicArtist"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getItemsApi(api).getItems({
|
||||||
|
userId: user.data.Id,
|
||||||
|
isFavorite: true,
|
||||||
|
includeItemTypes: [BaseItemKind.MusicArtist],
|
||||||
|
recursive: true,
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const person = useQuery({
|
||||||
|
queryKey: ["favorite", "person"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getItemsApi(api).getItems({
|
||||||
|
userId: user.data.Id,
|
||||||
|
isFavorite: true,
|
||||||
|
includeItemTypes: [BaseItemKind.Person],
|
||||||
|
recursive: true,
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// Removing app's backdrop
|
||||||
|
setBackdrop("", "");
|
||||||
|
}, []);
|
||||||
|
return (
|
||||||
|
<main
|
||||||
|
className="scrollY"
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
gap: "0.5em",
|
||||||
|
paddingBottom: "2em",
|
||||||
|
paddingTop: "4.2em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{movies.isSuccess && movies.data.Items.length > 0 && (
|
||||||
|
<CardScroller displayCards={8} title="Movies">
|
||||||
|
{movies.data.Items.map((item) => (
|
||||||
|
<Card
|
||||||
|
key={item.Id}
|
||||||
|
item={item}
|
||||||
|
cardTitle={item.Name}
|
||||||
|
imageType={"Primary"}
|
||||||
|
cardCaption={item.ProductionYear}
|
||||||
|
cardType="portrait"
|
||||||
|
queryKey={["favorite", "movies"]}
|
||||||
|
userId={user.data.Id}
|
||||||
|
imageBlurhash={
|
||||||
|
!!item.ImageBlurHashes?.Primary &&
|
||||||
|
item.ImageBlurHashes?.Primary[
|
||||||
|
Object.keys(
|
||||||
|
item.ImageBlurHashes.Primary,
|
||||||
|
)[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</CardScroller>
|
||||||
|
)}
|
||||||
|
{series.isSuccess && series.data.Items.length > 0 && (
|
||||||
|
<CardScroller
|
||||||
|
title="TV Shows"
|
||||||
|
displayCards={8}
|
||||||
|
disableDecoration
|
||||||
|
>
|
||||||
|
{series.data.Items.map((item) => (
|
||||||
|
<Card
|
||||||
|
key={item.Id}
|
||||||
|
item={item}
|
||||||
|
cardTitle={item.Name}
|
||||||
|
imageType={"Primary"}
|
||||||
|
cardCaption={`${item.ProductionYear} - ${
|
||||||
|
item.EndDate
|
||||||
|
? new Date(
|
||||||
|
item.EndDate,
|
||||||
|
).toLocaleString([], {
|
||||||
|
year: "numeric",
|
||||||
|
})
|
||||||
|
: "Present"
|
||||||
|
}`}
|
||||||
|
cardType="portrait"
|
||||||
|
queryKey={["favorite", "series"]}
|
||||||
|
userId={user.data.Id}
|
||||||
|
imageBlurhash={
|
||||||
|
!!item.ImageBlurHashes?.Primary &&
|
||||||
|
item.ImageBlurHashes?.Primary[
|
||||||
|
Object.keys(
|
||||||
|
item.ImageBlurHashes.Primary,
|
||||||
|
)[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</CardScroller>
|
||||||
|
)}
|
||||||
|
{audio.isSuccess && audio.data.Items.length > 0 && (
|
||||||
|
<CardScroller
|
||||||
|
title="Audio"
|
||||||
|
displayCards={8}
|
||||||
|
disableDecoration
|
||||||
|
>
|
||||||
|
{audio.data.Items.map((item) => (
|
||||||
|
<Card
|
||||||
|
key={item.Id}
|
||||||
|
item={item}
|
||||||
|
cardTitle={item.Name}
|
||||||
|
imageType={"Primary"}
|
||||||
|
cardCaption={item.ProductionYear}
|
||||||
|
cardType="square"
|
||||||
|
queryKey={["favorite", "audio"]}
|
||||||
|
userId={user.data.Id}
|
||||||
|
imageBlurhash={
|
||||||
|
!!item.ImageBlurHashes?.Primary &&
|
||||||
|
item.ImageBlurHashes?.Primary[
|
||||||
|
Object.keys(
|
||||||
|
item.ImageBlurHashes.Primary,
|
||||||
|
)[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</CardScroller>
|
||||||
|
)}
|
||||||
|
{musicAlbum.isSuccess && musicAlbum.data.Items.length > 0 && (
|
||||||
|
<CardScroller
|
||||||
|
title="Albums"
|
||||||
|
displayCards={8}
|
||||||
|
disableDecoration
|
||||||
|
>
|
||||||
|
{musicAlbum.data.Items.map((item) => (
|
||||||
|
<Card
|
||||||
|
key={item.Id}
|
||||||
|
item={item}
|
||||||
|
seriesId={item.SeriesId}
|
||||||
|
cardTitle={item.Name}
|
||||||
|
imageType={"Primary"}
|
||||||
|
cardCaption={item.AlbumArtist}
|
||||||
|
cardType={"square"}
|
||||||
|
queryKey={["favorite", "musicAlbum"]}
|
||||||
|
userId={user.data.Id}
|
||||||
|
imageBlurhash={
|
||||||
|
!!item.ImageBlurHashes?.Primary &&
|
||||||
|
item.ImageBlurHashes?.Primary[
|
||||||
|
Object.keys(
|
||||||
|
item.ImageBlurHashes.Primary,
|
||||||
|
)[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</CardScroller>
|
||||||
|
)}
|
||||||
|
{book.isSuccess && book.data.Items.length > 0 && (
|
||||||
|
<CardScroller
|
||||||
|
title="Books"
|
||||||
|
displayCards={8}
|
||||||
|
disableDecoration
|
||||||
|
>
|
||||||
|
{book.data.Items.map((item) => (
|
||||||
|
<Card
|
||||||
|
key={item.Id}
|
||||||
|
item={item}
|
||||||
|
cardTitle={item.Name}
|
||||||
|
imageType={"Primary"}
|
||||||
|
cardCaption={item.ProductionYear}
|
||||||
|
disableOverlay
|
||||||
|
cardType={"portrait"}
|
||||||
|
queryKey={["favorite", "book"]}
|
||||||
|
userId={user.data.Id}
|
||||||
|
imageBlurhash={
|
||||||
|
!!item.ImageBlurHashes?.Primary &&
|
||||||
|
item.ImageBlurHashes?.Primary[
|
||||||
|
Object.keys(
|
||||||
|
item.ImageBlurHashes.Primary,
|
||||||
|
)[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</CardScroller>
|
||||||
|
)}
|
||||||
|
{musicArtists.isSuccess &&
|
||||||
|
musicArtists.data.Items.length > 0 && (
|
||||||
|
<CardScroller
|
||||||
|
title="Artists"
|
||||||
|
displayCards={8}
|
||||||
|
disableDecoration
|
||||||
|
>
|
||||||
|
{musicArtists.data.Items.map((item) => (
|
||||||
|
<Card
|
||||||
|
key={item.Id}
|
||||||
|
item={item}
|
||||||
|
cardTitle={item.Name}
|
||||||
|
imageType={"Primary"}
|
||||||
|
disableOverlay
|
||||||
|
cardType={"square"}
|
||||||
|
queryKey={["favorite", "musicArtist"]}
|
||||||
|
userId={user.data.Id}
|
||||||
|
imageBlurhash={
|
||||||
|
!!item.ImageBlurHashes?.Primary &&
|
||||||
|
item.ImageBlurHashes?.Primary[
|
||||||
|
Object.keys(
|
||||||
|
item.ImageBlurHashes
|
||||||
|
.Primary,
|
||||||
|
)[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</CardScroller>
|
||||||
|
)}
|
||||||
|
{person.isSuccess && person.data.Items.length > 0 && (
|
||||||
|
<CardScroller
|
||||||
|
title="People"
|
||||||
|
displayCards={8}
|
||||||
|
disableDecoration
|
||||||
|
>
|
||||||
|
{person.data.Items.map((item) => (
|
||||||
|
<Card
|
||||||
|
key={item.Id}
|
||||||
|
item={item}
|
||||||
|
cardTitle={item.Name}
|
||||||
|
imageType={"Primary"}
|
||||||
|
disableOverlay
|
||||||
|
cardType={"square"}
|
||||||
|
queryKey={["favorite", "person"]}
|
||||||
|
userId={user.data.Id}
|
||||||
|
imageBlurhash={
|
||||||
|
!!item.ImageBlurHashes?.Primary &&
|
||||||
|
item.ImageBlurHashes?.Primary[
|
||||||
|
Object.keys(
|
||||||
|
item.ImageBlurHashes.Primary,
|
||||||
|
)[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</CardScroller>
|
||||||
|
)}
|
||||||
|
</main>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default FavoritePage;
|
export default FavoritePage;
|
||||||
@@ -68,14 +68,8 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
transition: opacity 0.5s;
|
transition: opacity 0.5s;
|
||||||
}
|
}
|
||||||
&-icon {
|
|
||||||
position: absolute;
|
&-icon-container {
|
||||||
font-size: 15em !important;
|
|
||||||
left: 70%;
|
|
||||||
top: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
fill: url(#clr-gradient-default) !important;
|
|
||||||
&-container {
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background: $clr-gradient-dark;
|
background: $clr-gradient-dark;
|
||||||
// background: url("/public/assetsStatic//meshbackground.png");
|
// background: url("/public/assetsStatic//meshbackground.png");
|
||||||
@@ -84,6 +78,12 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
.material-symbols-rounded {
|
||||||
|
position: absolute;
|
||||||
|
font-size: 15em !important;
|
||||||
|
left: 70%;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
import { useState } from "react";
|
import React, { useState } from "react";
|
||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
import { EventEmitter as event } from "../../eventEmitter";
|
|
||||||
import { getServer } from "../../utils/storage/servers";
|
|
||||||
import { getUser, delUser } from "../../utils/storage/user";
|
|
||||||
|
|
||||||
import "./home.module.scss";
|
import "./home.module.scss";
|
||||||
|
|
||||||
import Carousel from "../../components/carousel";
|
import Carousel from "../../components/carousel";
|
||||||
@@ -33,51 +29,26 @@ import CarouselSlide from "../../components/carouselSlide";
|
|||||||
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
|
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
|
||||||
import ErrorBoundary from "../../components/errorBoundary";
|
import ErrorBoundary from "../../components/errorBoundary";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
|
import CarouselSlideError from "../../components/errors/carousel";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
const Home = () => {
|
const Home = () => {
|
||||||
const authUser = useQuery({
|
const [api] = useApi((state) => [state.api]);
|
||||||
queryKey: ["home", "authenticateUser"],
|
|
||||||
queryFn: async () => {
|
|
||||||
const server = await getServer();
|
|
||||||
const user = await getUser();
|
|
||||||
event.emit("create-jellyfin-api", server.Ip);
|
|
||||||
const auth = await window.api.authenticateUserByName(
|
|
||||||
user.Name,
|
|
||||||
user.Password,
|
|
||||||
);
|
|
||||||
sessionStorage.setItem("accessToken", auth.data.AccessToken);
|
|
||||||
event.emit("set-api-accessToken", window.api.basePath);
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
enabled: false,
|
|
||||||
networkMode: "always",
|
|
||||||
});
|
|
||||||
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
|
enabled: Boolean(api),
|
||||||
});
|
});
|
||||||
|
|
||||||
const libraries = useQuery({
|
const libraries = useQuery({
|
||||||
queryKey: ["libraries"],
|
queryKey: ["libraries"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const libs = await getUserViewsApi(window.api).getUserViews({
|
const libs = await getUserViewsApi(api).getUserViews({
|
||||||
userId: user.data.Id,
|
|
||||||
});
|
|
||||||
return libs.data;
|
|
||||||
},
|
|
||||||
enabled: !!user.data,
|
|
||||||
networkMode: "always",
|
|
||||||
});
|
|
||||||
|
|
||||||
const latestMediaLibraries = useQuery({
|
|
||||||
queryKey: ["libraries"],
|
|
||||||
queryFn: async () => {
|
|
||||||
let libs = await getUserViewsApi(window.api).getUserViews({
|
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
});
|
});
|
||||||
return libs.data;
|
return libs.data;
|
||||||
@@ -89,8 +60,7 @@ const Home = () => {
|
|||||||
const latestMedia = useQuery({
|
const latestMedia = useQuery({
|
||||||
queryKey: ["home", "latestMedia"],
|
queryKey: ["home", "latestMedia"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const media = await getUserLibraryApi(window.api).getLatestMedia(
|
const media = await getUserLibraryApi(api).getLatestMedia({
|
||||||
{
|
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
fields: [
|
fields: [
|
||||||
ItemFields.Overview,
|
ItemFields.Overview,
|
||||||
@@ -103,8 +73,7 @@ const Home = () => {
|
|||||||
],
|
],
|
||||||
enableUserData: true,
|
enableUserData: true,
|
||||||
enableImages: true,
|
enableImages: true,
|
||||||
},
|
});
|
||||||
);
|
|
||||||
return media.data;
|
return media.data;
|
||||||
},
|
},
|
||||||
enabled: !!user.data,
|
enabled: !!user.data,
|
||||||
@@ -114,18 +83,13 @@ const Home = () => {
|
|||||||
const resumeItemsVideo = useQuery({
|
const resumeItemsVideo = useQuery({
|
||||||
queryKey: ["home", "resume", "video"],
|
queryKey: ["home", "resume", "video"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const resumeItems = await getItemsApi(window.api).getResumeItems(
|
const resumeItems = await getItemsApi(api).getResumeItems({
|
||||||
{
|
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
mediaTypes: ["Video"],
|
mediaTypes: ["Video"],
|
||||||
enableUserData: true,
|
enableUserData: true,
|
||||||
fields: [
|
fields: [ItemFields.MediaStreams, ItemFields.MediaSources],
|
||||||
ItemFields.MediaStreams,
|
});
|
||||||
ItemFields.MediaSources,
|
|
||||||
],
|
|
||||||
},
|
|
||||||
);
|
|
||||||
return resumeItems.data;
|
return resumeItems.data;
|
||||||
},
|
},
|
||||||
enabled: !!user.data,
|
enabled: !!user.data,
|
||||||
@@ -135,18 +99,13 @@ const Home = () => {
|
|||||||
const resumeItemsAudio = useQuery({
|
const resumeItemsAudio = useQuery({
|
||||||
queryKey: ["home", "resume", "audio"],
|
queryKey: ["home", "resume", "audio"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const resumeItems = await getItemsApi(window.api).getResumeItems(
|
const resumeItems = await getItemsApi(api).getResumeItems({
|
||||||
{
|
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
mediaTypes: ["Audio"],
|
mediaTypes: ["Audio"],
|
||||||
enableUserData: true,
|
enableUserData: true,
|
||||||
fields: [
|
fields: [ItemFields.MediaStreams, ItemFields.MediaSources],
|
||||||
ItemFields.MediaStreams,
|
});
|
||||||
ItemFields.MediaSources,
|
|
||||||
],
|
|
||||||
},
|
|
||||||
);
|
|
||||||
return resumeItems.data;
|
return resumeItems.data;
|
||||||
},
|
},
|
||||||
enabled: !!user.data,
|
enabled: !!user.data,
|
||||||
@@ -156,13 +115,15 @@ const Home = () => {
|
|||||||
const upNextItems = useQuery({
|
const upNextItems = useQuery({
|
||||||
queryKey: ["home", "upNext"],
|
queryKey: ["home", "upNext"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const upNext = await getTvShowsApi(window.api).getNextUp({
|
const upNext = await getTvShowsApi(api).getNextUp({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
fields: [
|
fields: [
|
||||||
ItemFields.PrimaryImageAspectRatio,
|
ItemFields.PrimaryImageAspectRatio,
|
||||||
ItemFields.MediaStreams,
|
ItemFields.MediaStreams,
|
||||||
ItemFields.MediaSources,
|
ItemFields.MediaSources,
|
||||||
ItemFields.ParentId,
|
ItemFields.ParentId,
|
||||||
|
"IndexNumber",
|
||||||
|
"ParentIndexNumber",
|
||||||
],
|
],
|
||||||
limit: 10,
|
limit: 10,
|
||||||
});
|
});
|
||||||
@@ -207,8 +168,7 @@ const Home = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<main
|
||||||
component="main"
|
|
||||||
className="scrollY home"
|
className="scrollY home"
|
||||||
style={{
|
style={{
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
@@ -216,38 +176,30 @@ const Home = () => {
|
|||||||
position: "relative",
|
position: "relative",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ErrorBoundary
|
<ErrorBoundary fallback={<CarouselSlideError />}>
|
||||||
fallback={
|
{latestMedia.isPending ? (
|
||||||
<div className="error">
|
|
||||||
<Typography>Error with Carousel</Typography>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{latestMedia.isLoading ? (
|
|
||||||
<CarouselSkeleton />
|
<CarouselSkeleton />
|
||||||
) : (
|
) : (
|
||||||
<Carousel
|
<Carousel
|
||||||
content={latestMedia.data?.map(
|
content={latestMedia.data?.map((item) => (
|
||||||
(item, index) => (
|
|
||||||
<CarouselSlide
|
<CarouselSlide
|
||||||
item={item}
|
item={item}
|
||||||
key={item.Id}
|
key={item.Id}
|
||||||
/>
|
/>
|
||||||
),
|
))}
|
||||||
)}
|
|
||||||
onChange={(now) => {
|
onChange={(now) => {
|
||||||
if (latestMedia.isSuccess) {
|
if (latestMedia.isSuccess) {
|
||||||
if (
|
if (
|
||||||
!!latestMedia.data[now]
|
latestMedia.data[now]
|
||||||
.ParentBackdropImageTags
|
.ParentBackdropImageTags
|
||||||
) {
|
) {
|
||||||
setAppBackdrop(
|
setAppBackdrop(
|
||||||
`${window.api.basePath}/Items/${latestMedia.data[now].ParentBackdropItemId}/Images/Backdrop`,
|
`${api.basePath}/Items/${latestMedia.data[now].ParentBackdropItemId}/Images/Backdrop`,
|
||||||
latestMedia.data[now].Id,
|
latestMedia.data[now].Id,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
setAppBackdrop(
|
setAppBackdrop(
|
||||||
`${window.api.basePath}/Items/${latestMedia.data[now].Id}/Images/Backdrop`,
|
`${api.basePath}/Items/${latestMedia.data[now].Id}/Images/Backdrop`,
|
||||||
latestMedia.data[now].Id,
|
latestMedia.data[now].Id,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -272,7 +224,7 @@ const Home = () => {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{libraries.isLoading ? (
|
{libraries.isPending ? (
|
||||||
<CardsSkeleton />
|
<CardsSkeleton />
|
||||||
) : (
|
) : (
|
||||||
<CardScroller
|
<CardScroller
|
||||||
@@ -281,7 +233,7 @@ const Home = () => {
|
|||||||
>
|
>
|
||||||
{libraries.status == "success" &&
|
{libraries.status == "success" &&
|
||||||
libraries.data.Items.map(
|
libraries.data.Items.map(
|
||||||
(item, index) => {
|
(item) => {
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
key={item.Id}
|
key={item.Id}
|
||||||
@@ -311,6 +263,9 @@ const Home = () => {
|
|||||||
)[0]
|
)[0]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
overrideIcon={
|
||||||
|
item.CollectionType
|
||||||
|
}
|
||||||
></Card>
|
></Card>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -327,7 +282,7 @@ const Home = () => {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{upNextItems.isLoading ? (
|
{upNextItems.isPending ? (
|
||||||
<CardsSkeleton />
|
<CardsSkeleton />
|
||||||
) : upNextItems.isSuccess &&
|
) : upNextItems.isSuccess &&
|
||||||
upNextItems.data.Items.length == 0 ? (
|
upNextItems.data.Items.length == 0 ? (
|
||||||
@@ -337,8 +292,7 @@ const Home = () => {
|
|||||||
displayCards={4}
|
displayCards={4}
|
||||||
title="Up Next"
|
title="Up Next"
|
||||||
>
|
>
|
||||||
{upNextItems.data.Items.map(
|
{upNextItems.data.Items.map((item) => {
|
||||||
(item, index) => {
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
key={item.Id}
|
key={item.Id}
|
||||||
@@ -364,13 +318,18 @@ const Home = () => {
|
|||||||
cardCaption={
|
cardCaption={
|
||||||
item.Type ==
|
item.Type ==
|
||||||
BaseItemKind.Episode
|
BaseItemKind.Episode
|
||||||
? `S${item.ParentIndexNumber}:E${item.IndexNumber} - ${item.Name}`
|
? item.ParentIndexNumber ==
|
||||||
|
0
|
||||||
|
? `${item.SeasonName} - ${item.Name}`
|
||||||
|
: item.IndexNumberEnd
|
||||||
|
? `${item.IndexNumber}-${item.IndexNumberEnd}. ${item.Name}`
|
||||||
|
: `${item.IndexNumber}. ${item.Name}`
|
||||||
: item.Type ==
|
: item.Type ==
|
||||||
BaseItemKind.Series
|
BaseItemKind.Series
|
||||||
? `${
|
? `${
|
||||||
item.ProductionYear
|
item.ProductionYear
|
||||||
} - ${
|
} - ${
|
||||||
!!item.EndDate
|
item.EndDate
|
||||||
? new Date(
|
? new Date(
|
||||||
item.EndDate,
|
item.EndDate,
|
||||||
).toLocaleString(
|
).toLocaleString(
|
||||||
@@ -388,15 +347,12 @@ const Home = () => {
|
|||||||
"home",
|
"home",
|
||||||
"upNext",
|
"upNext",
|
||||||
]}
|
]}
|
||||||
userId={
|
userId={user.data.Id}
|
||||||
user.data.Id
|
|
||||||
}
|
|
||||||
imageBlurhash={
|
imageBlurhash={
|
||||||
!!item
|
!!item
|
||||||
.ImageBlurHashes
|
.ImageBlurHashes
|
||||||
?.Primary &&
|
?.Primary &&
|
||||||
item
|
item.ImageBlurHashes
|
||||||
.ImageBlurHashes
|
|
||||||
?.Primary[
|
?.Primary[
|
||||||
Object.keys(
|
Object.keys(
|
||||||
item
|
item
|
||||||
@@ -407,8 +363,7 @@ const Home = () => {
|
|||||||
}
|
}
|
||||||
></Card>
|
></Card>
|
||||||
);
|
);
|
||||||
},
|
})}
|
||||||
)}
|
|
||||||
</CardScroller>
|
</CardScroller>
|
||||||
)}
|
)}
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
@@ -421,7 +376,7 @@ const Home = () => {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{resumeItemsVideo.isLoading ? (
|
{resumeItemsVideo.isPending ? (
|
||||||
<CardsSkeleton />
|
<CardsSkeleton />
|
||||||
) : resumeItemsVideo.isSuccess &&
|
) : resumeItemsVideo.isSuccess &&
|
||||||
resumeItemsVideo.data.Items.length == 0 ? (
|
resumeItemsVideo.data.Items.length == 0 ? (
|
||||||
@@ -432,7 +387,7 @@ const Home = () => {
|
|||||||
title="Continue Watching"
|
title="Continue Watching"
|
||||||
>
|
>
|
||||||
{resumeItemsVideo.data.Items.map(
|
{resumeItemsVideo.data.Items.map(
|
||||||
(item, index) => {
|
(item) => {
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
key={item.Id}
|
key={item.Id}
|
||||||
@@ -464,7 +419,7 @@ const Home = () => {
|
|||||||
? `${
|
? `${
|
||||||
item.ProductionYear
|
item.ProductionYear
|
||||||
} - ${
|
} - ${
|
||||||
!!item.EndDate
|
item.EndDate
|
||||||
? new Date(
|
? new Date(
|
||||||
item.EndDate,
|
item.EndDate,
|
||||||
).toLocaleString(
|
).toLocaleString(
|
||||||
@@ -516,7 +471,7 @@ const Home = () => {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{resumeItemsAudio.isLoading ? (
|
{resumeItemsAudio.isPending ? (
|
||||||
<CardsSkeleton />
|
<CardsSkeleton />
|
||||||
) : resumeItemsAudio.isSuccess &&
|
) : resumeItemsAudio.isSuccess &&
|
||||||
resumeItemsAudio.data.Items.length == 0 ? (
|
resumeItemsAudio.data.Items.length == 0 ? (
|
||||||
@@ -527,7 +482,7 @@ const Home = () => {
|
|||||||
title="Continue Listening"
|
title="Continue Listening"
|
||||||
>
|
>
|
||||||
{resumeItemsAudio.data.Items.map(
|
{resumeItemsAudio.data.Items.map(
|
||||||
(item, index) => {
|
(item) => {
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
key={item.Id}
|
key={item.Id}
|
||||||
@@ -589,7 +544,7 @@ const Home = () => {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{latestMediaLibs.map((lib, index) => {
|
{latestMediaLibs.map((lib) => {
|
||||||
return (
|
return (
|
||||||
<LatestMediaSection
|
<LatestMediaSection
|
||||||
key={lib[0]}
|
key={lib[0]}
|
||||||
@@ -599,7 +554,7 @@ const Home = () => {
|
|||||||
})}
|
})}
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</main>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
import CircularProgress from "@mui/material/CircularProgress";
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
|
|
||||||
import { useParams, useNavigate } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BaseItemKind,
|
BaseItemKind,
|
||||||
@@ -28,6 +28,7 @@ import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
|||||||
|
|
||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
import { ActorCard } from "../../components/card/actorCards";
|
import { ActorCard } from "../../components/card/actorCards";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
@@ -51,35 +52,28 @@ TabPanel.propTypes = {
|
|||||||
value: PropTypes.number.isRequired,
|
value: PropTypes.number.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
function a11yProps(index) {
|
|
||||||
return {
|
|
||||||
id: `full-width-tab-${index}`,
|
|
||||||
"aria-controls": `full-width-tabpanel-${index}`,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const ItemDetail = () => {
|
const ItemDetail = () => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
const navigate = useNavigate();
|
|
||||||
const [primageImageLoaded, setPrimaryImageLoaded] = useState(false);
|
const [api] = useApi((state) => [state.api]);
|
||||||
const [backdropImageLoaded, setBackdropImageLoaded] = useState(false);
|
|
||||||
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
|
enabled: Boolean(api),
|
||||||
});
|
});
|
||||||
|
|
||||||
const item = useQuery({
|
const item = useQuery({
|
||||||
queryKey: ["item", id],
|
queryKey: ["item", id],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getUserLibraryApi(window.api).getItem({
|
const result = await getUserLibraryApi(api).getItem({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: id,
|
itemId: id,
|
||||||
fields: [ItemFields.Crew],
|
fields: Object.values(ItemFields),
|
||||||
});
|
});
|
||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
@@ -93,28 +87,28 @@ const ItemDetail = () => {
|
|||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let result;
|
let result;
|
||||||
if (item.data.Type == "Movie") {
|
if (item.data.Type == "Movie") {
|
||||||
result = await getLibraryApi(window.api).getSimilarMovies({
|
result = await getLibraryApi(api).getSimilarMovies({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: item.data.Id,
|
itemId: item.data.Id,
|
||||||
limit: 16,
|
limit: 16,
|
||||||
});
|
});
|
||||||
} else if (item.data.Type == "Series") {
|
} else if (item.data.Type == "Series") {
|
||||||
result = await getLibraryApi(window.api).getSimilarShows({
|
result = await getLibraryApi(api).getSimilarShows({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: item.data.Id,
|
itemId: item.data.Id,
|
||||||
});
|
});
|
||||||
} else if (item.data.Type == "MusicAlbum") {
|
} else if (item.data.Type == "MusicAlbum") {
|
||||||
result = await getLibraryApi(window.api).getSimilarAlbums({
|
result = await getLibraryApi(api).getSimilarAlbums({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: item.data.Id,
|
itemId: item.data.Id,
|
||||||
});
|
});
|
||||||
} else if (item.data.Type == "MusicArtist") {
|
} else if (item.data.Type == "MusicArtist") {
|
||||||
result = await getLibraryApi(window.api).getSimilarArtists({
|
result = await getLibraryApi(api).getSimilarArtists({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: item.data.Id,
|
itemId: item.data.Id,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
result = await getLibraryApi(window.api).getSimilarItems({
|
result = await getLibraryApi(api).getSimilarItems({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: item.data.Id,
|
itemId: item.data.Id,
|
||||||
});
|
});
|
||||||
@@ -176,8 +170,8 @@ const ItemDetail = () => {
|
|||||||
setAppBackdrop(
|
setAppBackdrop(
|
||||||
item.data.Type === BaseItemKind.MusicAlbum ||
|
item.data.Type === BaseItemKind.MusicAlbum ||
|
||||||
item.data.Type === BaseItemKind.Episode
|
item.data.Type === BaseItemKind.Episode
|
||||||
? `${window.api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
? `${api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
||||||
: `${window.api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
: `${api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||||
item.data.Id,
|
item.data.Id,
|
||||||
);
|
);
|
||||||
let direTp = item.data.People.filter(
|
let direTp = item.data.People.filter(
|
||||||
@@ -191,7 +185,7 @@ const ItemDetail = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading || similarItems.isLoading) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@@ -226,6 +220,7 @@ const ItemDetail = () => {
|
|||||||
videoTracks={videoTracks}
|
videoTracks={videoTracks}
|
||||||
audioTracks={audioTracks}
|
audioTracks={audioTracks}
|
||||||
subtitleTracks={subtitleTracks}
|
subtitleTracks={subtitleTracks}
|
||||||
|
enableVideoInfoStrip
|
||||||
/>
|
/>
|
||||||
{item.data.People.length > 0 && (
|
{item.data.People.length > 0 && (
|
||||||
<CardScroller
|
<CardScroller
|
||||||
@@ -233,7 +228,7 @@ const ItemDetail = () => {
|
|||||||
displayCards={8}
|
displayCards={8}
|
||||||
disableDecoration
|
disableDecoration
|
||||||
>
|
>
|
||||||
{item.data.People.map((person, index) => {
|
{item.data.People.map((person) => {
|
||||||
return (
|
return (
|
||||||
<ActorCard
|
<ActorCard
|
||||||
key={person.Id}
|
key={person.Id}
|
||||||
@@ -259,7 +254,7 @@ const ItemDetail = () => {
|
|||||||
displayCards={8}
|
displayCards={8}
|
||||||
disableDecoration
|
disableDecoration
|
||||||
>
|
>
|
||||||
{similarItems.data.Items.map((similar, index) => {
|
{similarItems.data.Items.map((similar) => {
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
key={similar.Id}
|
key={similar.Id}
|
||||||
@@ -281,7 +276,7 @@ const ItemDetail = () => {
|
|||||||
? `${
|
? `${
|
||||||
similar.ProductionYear
|
similar.ProductionYear
|
||||||
} - ${
|
} - ${
|
||||||
!!similar.EndDate
|
similar.EndDate
|
||||||
? new Date(
|
? new Date(
|
||||||
similar.EndDate,
|
similar.EndDate,
|
||||||
).toLocaleString(
|
).toLocaleString(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useState, useMemo } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
import { useParams, useNavigate } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
@@ -19,18 +19,12 @@ import Accordion from "@mui/material/Accordion";
|
|||||||
import AccordionSummary from "@mui/material/AccordionSummary";
|
import AccordionSummary from "@mui/material/AccordionSummary";
|
||||||
import AccordionDetails from "@mui/material/AccordionDetails";
|
import AccordionDetails from "@mui/material/AccordionDetails";
|
||||||
import Button from "@mui/material/Button";
|
import Button from "@mui/material/Button";
|
||||||
import Table from "@mui/material/Table";
|
|
||||||
import TableBody from "@mui/material/TableBody";
|
|
||||||
import TableContainer from "@mui/material/TableContainer";
|
|
||||||
import TableRow from "@mui/material/TableRow";
|
|
||||||
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 Popper from "@mui/material/Popper";
|
import Popper from "@mui/material/Popper";
|
||||||
import Grow from "@mui/material/Grow";
|
import Grow from "@mui/material/Grow";
|
||||||
|
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
|
||||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||||
import { getArtistsApi } from "@jellyfin/sdk/lib/utils/api/artists-api";
|
import { getArtistsApi } from "@jellyfin/sdk/lib/utils/api/artists-api";
|
||||||
import { getGenresApi } from "@jellyfin/sdk/lib/utils/api/genres-api";
|
import { getGenresApi } from "@jellyfin/sdk/lib/utils/api/genres-api";
|
||||||
@@ -53,26 +47,24 @@ import {
|
|||||||
ItemFields,
|
ItemFields,
|
||||||
SortOrder,
|
SortOrder,
|
||||||
} from "@jellyfin/sdk/lib/generated-client";
|
} from "@jellyfin/sdk/lib/generated-client";
|
||||||
import { getRuntimeMusic } from "../../utils/date/time";
|
import MusicTrack from "../../components/musicTrack";
|
||||||
|
|
||||||
import "./library.module.scss";
|
|
||||||
import { MdiMusic } from "../../components/icons/mdiMusic";
|
|
||||||
import { MdiHeart } from "../../components/icons/mdiHeart";
|
|
||||||
import { MdiHeartOutline } from "../../components/icons/mdiHeartOutline";
|
|
||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
|
|
||||||
const LibraryView = () => {
|
import "./library.module.scss";
|
||||||
const navigate = useNavigate();
|
import { useApi } from "../../utils/store/api";
|
||||||
|
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||||
|
|
||||||
|
const LibraryView = () => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
const [page, setPage] = useState(1);
|
const [page, setPage] = useState(1);
|
||||||
const maxDisplayItems = 50;
|
const maxDisplayItems = 100;
|
||||||
|
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
@@ -94,19 +86,18 @@ const LibraryView = () => {
|
|||||||
setSortBy(e.target.value);
|
setSortBy(e.target.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchLib = async (libraryId) => {
|
|
||||||
const result = await getItemsApi(window.api).getItems({
|
|
||||||
userId: user.data.Id,
|
|
||||||
ids: [libraryId],
|
|
||||||
fields: [ItemFields.RecursiveItemCount],
|
|
||||||
});
|
|
||||||
return result.data;
|
|
||||||
};
|
|
||||||
const currentLib = useQuery({
|
const currentLib = useQuery({
|
||||||
queryKey: ["libraryView", "currentLib", id],
|
queryKey: ["libraryView", "currentLib", id],
|
||||||
queryFn: () => fetchLib(id),
|
queryFn: async () => {
|
||||||
|
const result = await getUserLibraryApi(api).getItem({
|
||||||
|
userId: user.data.Id,
|
||||||
|
itemId: [id],
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
enabled: !!user.data,
|
enabled: !!user.data,
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
|
gcTime: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [isPlayed, setIsPlayed] = useState(false);
|
const [isPlayed, setIsPlayed] = useState(false);
|
||||||
@@ -121,46 +112,12 @@ const LibraryView = () => {
|
|||||||
const [hasSpecialFeature, setHasSpecialFeature] = useState(false);
|
const [hasSpecialFeature, setHasSpecialFeature] = useState(false);
|
||||||
const [hasThemeSong, setHasThemeSong] = useState(false);
|
const [hasThemeSong, setHasThemeSong] = useState(false);
|
||||||
const [hasThemeVideo, setHasThemeVideo] = useState(false);
|
const [hasThemeVideo, setHasThemeVideo] = useState(false);
|
||||||
const availableFeatureFilters = [
|
|
||||||
{
|
|
||||||
title: "Subtitles",
|
|
||||||
value: false,
|
|
||||||
state: (val) => setHasSubtitles(val),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Trailer",
|
|
||||||
value: false,
|
|
||||||
state: (val) => setHasTrailer(val),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Special Feature",
|
|
||||||
value: false,
|
|
||||||
state: (val) => setHasSpecialFeature(val),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Theme Song",
|
|
||||||
value: false,
|
|
||||||
state: (val) => setHasThemeSong(val),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Theme Video",
|
|
||||||
vslue: false,
|
|
||||||
state: (val) => setHasThemeVideo(val),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const [isBluRay, setIsBluRay] = useState(false);
|
const [isBluRay, setIsBluRay] = useState(false);
|
||||||
const [isDVD, setIsDVD] = useState(false);
|
const [isDVD, setIsDVD] = useState(false);
|
||||||
const [isHD, setIsHD] = useState(false);
|
const [isHD, setIsHD] = useState(false);
|
||||||
const [is4K, setIs4K] = useState(false);
|
const [is4K, setIs4K] = useState(false);
|
||||||
const [is3D, setIs3D] = useState(false);
|
const [is3D, setIs3D] = useState(false);
|
||||||
const availableVideoTypeFilters = [
|
|
||||||
{ title: "Blu-Ray", value: false, state: (val) => setIsBluRay(val) },
|
|
||||||
{ title: "DVD", value: false, state: (val) => setIsDVD(val) },
|
|
||||||
{ title: "HD", value: false, state: (val) => setIsHD(val) },
|
|
||||||
{ title: "4K", value: false, state: (val) => setIs4K(val) },
|
|
||||||
{ title: "3D", value: false, state: (val) => setIs3D(val) },
|
|
||||||
];
|
|
||||||
|
|
||||||
const [currentViewType, setCurrentViewType] = useState("");
|
const [currentViewType, setCurrentViewType] = useState("");
|
||||||
|
|
||||||
@@ -169,16 +126,20 @@ const LibraryView = () => {
|
|||||||
*/
|
*/
|
||||||
const [viewType, setViewType] = useState([]);
|
const [viewType, setViewType] = useState([]);
|
||||||
|
|
||||||
useMemo(() => {
|
useEffect(() => {
|
||||||
|
if (currentLib.isError) {
|
||||||
|
console.error(currentLib.error);
|
||||||
|
}
|
||||||
if (currentLib.isSuccess) {
|
if (currentLib.isSuccess) {
|
||||||
if (currentLib.data.Items[0].CollectionType == "movies") {
|
setViewType(null);
|
||||||
|
if (currentLib.data.CollectionType == "movies") {
|
||||||
setCurrentViewType(BaseItemKind.Movie);
|
setCurrentViewType(BaseItemKind.Movie);
|
||||||
setViewType([
|
setViewType([
|
||||||
{ title: "Movies", value: BaseItemKind.Movie },
|
{ title: "Movies", value: BaseItemKind.Movie },
|
||||||
{ title: "Genres", value: BaseItemKind.Genre },
|
{ title: "Genres", value: BaseItemKind.Genre },
|
||||||
{ title: "Studios", value: BaseItemKind.Studio },
|
{ title: "Studios", value: BaseItemKind.Studio },
|
||||||
]);
|
]);
|
||||||
} else if (currentLib.data.Items[0].CollectionType == "music") {
|
} else if (currentLib.data.CollectionType == "music") {
|
||||||
setCurrentViewType(BaseItemKind.MusicAlbum);
|
setCurrentViewType(BaseItemKind.MusicAlbum);
|
||||||
setViewType([
|
setViewType([
|
||||||
{ title: "Albums", value: BaseItemKind.MusicAlbum },
|
{ title: "Albums", value: BaseItemKind.MusicAlbum },
|
||||||
@@ -186,18 +147,14 @@ const LibraryView = () => {
|
|||||||
{ title: "Artists", value: BaseItemKind.MusicArtist },
|
{ title: "Artists", value: BaseItemKind.MusicArtist },
|
||||||
{ title: "Genres", value: BaseItemKind.MusicGenre },
|
{ title: "Genres", value: BaseItemKind.MusicGenre },
|
||||||
]);
|
]);
|
||||||
} else if (
|
} else if (currentLib.data.CollectionType == "tvshows") {
|
||||||
currentLib.data.Items[0].CollectionType == "tvshows"
|
|
||||||
) {
|
|
||||||
setCurrentViewType(BaseItemKind.Series);
|
setCurrentViewType(BaseItemKind.Series);
|
||||||
setViewType([
|
setViewType([
|
||||||
{ title: "Series", value: BaseItemKind.Series },
|
{ title: "Series", value: BaseItemKind.Series },
|
||||||
{ title: "Genres", value: BaseItemKind.Genre },
|
{ title: "Genres", value: BaseItemKind.Genre },
|
||||||
{ title: "Networks", value: BaseItemKind.Studio },
|
{ title: "Networks", value: BaseItemKind.Studio },
|
||||||
]);
|
]);
|
||||||
} else if (
|
} else if (currentLib.data.CollectionType == "playlists") {
|
||||||
currentLib.data.Items[0].CollectionType == "playlists"
|
|
||||||
) {
|
|
||||||
setCurrentViewType(BaseItemKind.PlaylistsFolder);
|
setCurrentViewType(BaseItemKind.PlaylistsFolder);
|
||||||
setViewType([
|
setViewType([
|
||||||
{
|
{
|
||||||
@@ -210,8 +167,7 @@ const LibraryView = () => {
|
|||||||
setCurrentViewType("none");
|
setCurrentViewType("none");
|
||||||
setViewType([]);
|
setViewType([]);
|
||||||
}
|
}
|
||||||
|
if (currentLib.data.CollectionType == "movies") {
|
||||||
if (currentLib.data.Items[0].CollectionType == "movies") {
|
|
||||||
setSortBy("SortName");
|
setSortBy("SortName");
|
||||||
setSortByData([
|
setSortByData([
|
||||||
{ title: "Name", value: "SortName" },
|
{ title: "Name", value: "SortName" },
|
||||||
@@ -223,9 +179,7 @@ const LibraryView = () => {
|
|||||||
{ title: "Runtime", value: "Runtime" },
|
{ title: "Runtime", value: "Runtime" },
|
||||||
{ title: "Random", value: "Random" },
|
{ title: "Random", value: "Random" },
|
||||||
]);
|
]);
|
||||||
} else if (
|
} else if (currentLib.data.CollectionType == "tvshows") {
|
||||||
currentLib.data.Items[0].CollectionType == "tvshows"
|
|
||||||
) {
|
|
||||||
setSortBy("SortName");
|
setSortBy("SortName");
|
||||||
setSortByData([
|
setSortByData([
|
||||||
{ title: "Name", value: "SortName" },
|
{ title: "Name", value: "SortName" },
|
||||||
@@ -236,7 +190,7 @@ const LibraryView = () => {
|
|||||||
{ title: "Release Date", value: "PremiereDate" },
|
{ title: "Release Date", value: "PremiereDate" },
|
||||||
{ title: "Random", value: "Random" },
|
{ title: "Random", value: "Random" },
|
||||||
]);
|
]);
|
||||||
} else if (currentLib.data.Items[0].CollectionType == "music") {
|
} else if (currentLib.data.CollectionType == "music") {
|
||||||
setSortBy("Name");
|
setSortBy("Name");
|
||||||
setSortByData([
|
setSortByData([
|
||||||
{ title: "Name", value: "Name" },
|
{ title: "Name", value: "Name" },
|
||||||
@@ -269,81 +223,6 @@ const LibraryView = () => {
|
|||||||
|
|
||||||
const [videoTypes, setVideoTypes] = useState([]);
|
const [videoTypes, setVideoTypes] = useState([]);
|
||||||
|
|
||||||
const fetchLibItems = async (libraryId) => {
|
|
||||||
let result;
|
|
||||||
if (currentViewType == "MusicArtist") {
|
|
||||||
result = await getArtistsApi(window.api).getAlbumArtists({
|
|
||||||
userId: user.data.Id,
|
|
||||||
parentId: libraryId,
|
|
||||||
startIndex: maxDisplayItems * (page - 1),
|
|
||||||
limit: maxDisplayItems,
|
|
||||||
});
|
|
||||||
} else if (currentViewType == "Person") {
|
|
||||||
result = await getPersonsApi(window.api).getPersons({
|
|
||||||
userId: user.data.Id,
|
|
||||||
personTypes: ["Actor"],
|
|
||||||
startIndex: maxDisplayItems * (page - 1),
|
|
||||||
limit: maxDisplayItems,
|
|
||||||
});
|
|
||||||
} else if (currentViewType == "Genre") {
|
|
||||||
result = await getGenresApi(window.api).getGenres({
|
|
||||||
userId: user.data.Id,
|
|
||||||
parentId: libraryId,
|
|
||||||
startIndex: maxDisplayItems * (page - 1),
|
|
||||||
limit: maxDisplayItems,
|
|
||||||
});
|
|
||||||
} else if (currentViewType == "MusicGenre") {
|
|
||||||
result = await getMusicGenresApi(window.api).getMusicGenres({
|
|
||||||
userId: user.data.Id,
|
|
||||||
parentId: libraryId,
|
|
||||||
startIndex: maxDisplayItems * (page - 1),
|
|
||||||
limit: maxDisplayItems,
|
|
||||||
});
|
|
||||||
} else if (currentViewType == "Studio") {
|
|
||||||
result = await getStudiosApi(window.api).getStudios({
|
|
||||||
userId: user.data.Id,
|
|
||||||
parentId: libraryId,
|
|
||||||
startIndex: maxDisplayItems * (page - 1),
|
|
||||||
limit: maxDisplayItems,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
result = await getItemsApi(window.api).getItems({
|
|
||||||
userId: user.data.Id,
|
|
||||||
parentId: libraryId,
|
|
||||||
recursive:
|
|
||||||
currentLib.data.Items[0].CollectionType ===
|
|
||||||
"homevideos" ||
|
|
||||||
currentLib.data.Items[0].Type === "Folder" ||
|
|
||||||
currentLib.data.Items[0].Type === "CollectionFolder" ||
|
|
||||||
(currentLib.data.Items[0].Type != "boxsets" &&
|
|
||||||
!("CollectionType" in currentLib.data.Items[0]))
|
|
||||||
? undefined
|
|
||||||
: true,
|
|
||||||
includeItemTypes: [currentViewType],
|
|
||||||
sortOrder: [
|
|
||||||
sortAscending
|
|
||||||
? SortOrder.Ascending
|
|
||||||
: SortOrder.Descending,
|
|
||||||
],
|
|
||||||
sortBy: sortBy,
|
|
||||||
filters: filterArray,
|
|
||||||
hasSubtitles: hasSubtitles ? true : undefined,
|
|
||||||
hasTrailer: hasTrailer ? true : undefined,
|
|
||||||
hasSpecialFeature: hasSpecialFeature ? true : undefined,
|
|
||||||
hasThemeSong: hasThemeSong ? true : undefined,
|
|
||||||
hasThemeVideo: hasThemeVideo ? true : undefined,
|
|
||||||
videoTypes: videoTypes,
|
|
||||||
isHd: isHD ? true : undefined,
|
|
||||||
is4K: is4K ? true : undefined,
|
|
||||||
is3D: is3D ? true : undefined,
|
|
||||||
startIndex: maxDisplayItems * (page - 1),
|
|
||||||
limit: maxDisplayItems,
|
|
||||||
fields: ["UserData"],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return result.data;
|
|
||||||
};
|
|
||||||
|
|
||||||
const items = useQuery({
|
const items = useQuery({
|
||||||
queryKey: [
|
queryKey: [
|
||||||
"libraryView",
|
"libraryView",
|
||||||
@@ -371,9 +250,84 @@ const LibraryView = () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
queryFn: () => fetchLibItems(id),
|
queryFn: async () => {
|
||||||
enabled: Boolean(currentViewType),
|
let result;
|
||||||
|
if (currentViewType == "MusicArtist") {
|
||||||
|
result = await getArtistsApi(api).getAlbumArtists({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: id,
|
||||||
|
startIndex: maxDisplayItems * (page - 1),
|
||||||
|
limit: maxDisplayItems,
|
||||||
|
});
|
||||||
|
} else if (currentViewType == "Person") {
|
||||||
|
result = await getPersonsApi(api).getPersons({
|
||||||
|
userId: user.data.Id,
|
||||||
|
personTypes: ["Actor"],
|
||||||
|
startIndex: maxDisplayItems * (page - 1),
|
||||||
|
limit: maxDisplayItems,
|
||||||
|
});
|
||||||
|
} else if (currentViewType == "Genre") {
|
||||||
|
result = await getGenresApi(api).getGenres({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: id,
|
||||||
|
startIndex: maxDisplayItems * (page - 1),
|
||||||
|
limit: maxDisplayItems,
|
||||||
|
});
|
||||||
|
} else if (currentViewType == "MusicGenre") {
|
||||||
|
result = await getMusicGenresApi(api).getMusicGenres({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: id,
|
||||||
|
startIndex: maxDisplayItems * (page - 1),
|
||||||
|
limit: maxDisplayItems,
|
||||||
|
});
|
||||||
|
} else if (currentViewType == "Studio") {
|
||||||
|
result = await getStudiosApi(api).getStudios({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: id,
|
||||||
|
startIndex: maxDisplayItems * (page - 1),
|
||||||
|
limit: maxDisplayItems,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
result = await getItemsApi(api).getItems({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: currentLib.data.Id,
|
||||||
|
recursive:
|
||||||
|
currentLib.data.CollectionType == "boxsets"
|
||||||
|
? undefined
|
||||||
|
: true,
|
||||||
|
includeItemTypes: [currentViewType],
|
||||||
|
sortOrder: [
|
||||||
|
sortAscending
|
||||||
|
? SortOrder.Ascending
|
||||||
|
: SortOrder.Descending,
|
||||||
|
],
|
||||||
|
sortBy: sortBy,
|
||||||
|
filters: filterArray,
|
||||||
|
hasSubtitles: hasSubtitles ? true : undefined,
|
||||||
|
hasTrailer: hasTrailer ? true : undefined,
|
||||||
|
hasSpecialFeature: hasSpecialFeature
|
||||||
|
? true
|
||||||
|
: undefined,
|
||||||
|
hasThemeSong: hasThemeSong ? true : undefined,
|
||||||
|
hasThemeVideo: hasThemeVideo ? true : undefined,
|
||||||
|
videoTypes: videoTypes,
|
||||||
|
isHd: isHD || undefined,
|
||||||
|
is4K: is4K || undefined,
|
||||||
|
is3D: is3D || undefined,
|
||||||
|
startIndex: maxDisplayItems * (page - 1),
|
||||||
|
limit: maxDisplayItems,
|
||||||
|
enableUserData: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
// enabled: false,
|
||||||
|
enabled:
|
||||||
|
user.isSuccess &&
|
||||||
|
Boolean(currentViewType) &&
|
||||||
|
currentLib.isSuccess,
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
|
// gcTime: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
const disabledSortViews = [
|
const disabledSortViews = [
|
||||||
@@ -389,36 +343,31 @@ const LibraryView = () => {
|
|||||||
const [filterButtonAnchorEl, setFilterButtonAnchorEl] = useState(null);
|
const [filterButtonAnchorEl, setFilterButtonAnchorEl] = useState(null);
|
||||||
const [filterMenuOpen, setFilterMenuOpen] = useState(false);
|
const [filterMenuOpen, setFilterMenuOpen] = useState(false);
|
||||||
|
|
||||||
const openFiltersMenu = (event) => {
|
|
||||||
setFilterButtonAnchorEl(event.currentTarget);
|
|
||||||
};
|
|
||||||
const closeFiltersMenu = () => {
|
|
||||||
setFilterButtonAnchorEl(null);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleLiking = async (item) => {
|
|
||||||
let result;
|
|
||||||
if (item.UserData.isFavorite) {
|
|
||||||
result = await getUserLibraryApi(window.api).unmarkFavoriteItem({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.Id,
|
|
||||||
});
|
|
||||||
} else if (!item.UserData.isFavorite) {
|
|
||||||
result = await getUserLibraryApi(window.api).markFavoriteItem({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.Id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
items.refetch();
|
|
||||||
};
|
|
||||||
|
|
||||||
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||||
|
|
||||||
useState(() => {
|
useState(() => {
|
||||||
// Remove App backdrop in library page
|
// Remove App backdrop in library page
|
||||||
setAppBackdrop("", "");
|
setAppBackdrop("", "");
|
||||||
|
console.log(items.isSuccess);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
if (items.isError) {
|
||||||
|
console.error(items.error);
|
||||||
|
}
|
||||||
|
if (currentLib.isPending) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
position: "fixed",
|
||||||
|
top: "50%",
|
||||||
|
left: "50%",
|
||||||
|
transform: "translate(-50%, -50%)",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<CircularProgress size={72} thickness={1.4} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
} else if (currentLib.isSuccess) {
|
||||||
return (
|
return (
|
||||||
<main className="scrollY library">
|
<main className="scrollY library">
|
||||||
<div
|
<div
|
||||||
@@ -444,16 +393,18 @@ const LibraryView = () => {
|
|||||||
sx={{ mr: 2, flexShrink: 0 }}
|
sx={{ mr: 2, flexShrink: 0 }}
|
||||||
noWrap
|
noWrap
|
||||||
>
|
>
|
||||||
{currentLib.isLoading ? (
|
{currentLib.isPending ? (
|
||||||
<CircularProgress sx={{ p: 1 }} />
|
<CircularProgress sx={{ p: 1 }} />
|
||||||
) : (
|
) : (
|
||||||
currentLib.data.Items[0].Name
|
currentLib.data.Name
|
||||||
)}
|
)}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Chip
|
<Chip
|
||||||
label={
|
label={
|
||||||
items.isLoading ? (
|
!items.isSuccess ? (
|
||||||
<CircularProgress sx={{ p: 1.5 }} />
|
<CircularProgress
|
||||||
|
sx={{ p: 1.5 }}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
items.data.TotalRecordCount
|
items.data.TotalRecordCount
|
||||||
)
|
)
|
||||||
@@ -464,7 +415,9 @@ const LibraryView = () => {
|
|||||||
<div className="library-items">
|
<div className="library-items">
|
||||||
<div className="library-items-header">
|
<div className="library-items-header">
|
||||||
<div className="library-items-options">
|
<div className="library-items-options">
|
||||||
{disabledSortViews.includes(currentViewType) ? (
|
{disabledSortViews.includes(
|
||||||
|
currentViewType,
|
||||||
|
) ? (
|
||||||
<></>
|
<></>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
@@ -483,22 +436,20 @@ const LibraryView = () => {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
|
|
||||||
<TextField
|
<TextField
|
||||||
disabled={!Boolean(sortBy)}
|
disabled={!sortBy}
|
||||||
select
|
select
|
||||||
value={sortBy}
|
value={sortBy}
|
||||||
onChange={handleSortBy}
|
onChange={handleSortBy}
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
{sortByData.map(
|
{sortByData.map((option) => (
|
||||||
(option, index) => (
|
|
||||||
<MenuItem
|
<MenuItem
|
||||||
key={index}
|
key={option.value}
|
||||||
value={option.value}
|
value={option.value}
|
||||||
>
|
>
|
||||||
{option.title}
|
{option.title}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
),
|
))}
|
||||||
)}
|
|
||||||
</TextField>
|
</TextField>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
@@ -510,9 +461,7 @@ const LibraryView = () => {
|
|||||||
orientation="vertical"
|
orientation="vertical"
|
||||||
/>
|
/>
|
||||||
<TextField
|
<TextField
|
||||||
disabled={
|
disabled={!currentViewType}
|
||||||
!Boolean(currentViewType)
|
|
||||||
}
|
|
||||||
select
|
select
|
||||||
value={currentViewType}
|
value={currentViewType}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
@@ -522,9 +471,9 @@ const LibraryView = () => {
|
|||||||
}}
|
}}
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
{viewType.map((option, index) => (
|
{viewType.map((option) => (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
key={index}
|
key={option.value}
|
||||||
value={option.value}
|
value={option.value}
|
||||||
>
|
>
|
||||||
{option.title}
|
{option.title}
|
||||||
@@ -536,7 +485,7 @@ const LibraryView = () => {
|
|||||||
|
|
||||||
{currentLib.isSuccess &&
|
{currentLib.isSuccess &&
|
||||||
allowedFilterViews.includes(
|
allowedFilterViews.includes(
|
||||||
currentLib.data.Items[0].CollectionType,
|
currentLib.data.CollectionType,
|
||||||
) && (
|
) && (
|
||||||
<>
|
<>
|
||||||
<Divider
|
<Divider
|
||||||
@@ -917,7 +866,7 @@ const LibraryView = () => {
|
|||||||
/>
|
/>
|
||||||
</AccordionDetails>
|
</AccordionDetails>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
{currentLib.data.Items[0]
|
{currentLib.data
|
||||||
.CollectionType ==
|
.CollectionType ==
|
||||||
"movies" && (
|
"movies" && (
|
||||||
<Accordion className="library-filter-accordian">
|
<Accordion className="library-filter-accordian">
|
||||||
@@ -1139,7 +1088,7 @@ const LibraryView = () => {
|
|||||||
</Accordion>
|
</Accordion>
|
||||||
)}
|
)}
|
||||||
{!onlyStatusFilterViews.includes(
|
{!onlyStatusFilterViews.includes(
|
||||||
currentLib.data.Items[0]
|
currentLib.data
|
||||||
.CollectionType,
|
.CollectionType,
|
||||||
) && (
|
) && (
|
||||||
<Accordion className="library-filter-accordian">
|
<Accordion className="library-filter-accordian">
|
||||||
@@ -1318,7 +1267,7 @@ const LibraryView = () => {
|
|||||||
</Popper>
|
</Popper>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{items.isLoading ? (
|
{!items.isSuccess ? (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
@@ -1345,11 +1294,11 @@ const LibraryView = () => {
|
|||||||
) : items.data.TotalRecordCount == 0 ? (
|
) : items.data.TotalRecordCount == 0 ? (
|
||||||
<EmptyNotice />
|
<EmptyNotice />
|
||||||
) : currentViewType == BaseItemKind.Genre ? (
|
) : currentViewType == BaseItemKind.Genre ? (
|
||||||
items.data.Items.map((item, index) => {
|
items.data.Items.map((item) => {
|
||||||
return (
|
return (
|
||||||
<GenreView
|
<GenreView
|
||||||
key={item.Id}
|
key={item.Id}
|
||||||
libraryId={currentLib.data.Items[0].Id}
|
libraryId={currentLib.data.Id}
|
||||||
genreId={item.Id}
|
genreId={item.Id}
|
||||||
genreName={item.Name}
|
genreName={item.Name}
|
||||||
userId={user.data.Id}
|
userId={user.data.Id}
|
||||||
@@ -1358,7 +1307,7 @@ const LibraryView = () => {
|
|||||||
})
|
})
|
||||||
) : currentViewType != BaseItemKind.Audio ? (
|
) : currentViewType != BaseItemKind.Audio ? (
|
||||||
<div className="library-grid">
|
<div className="library-grid">
|
||||||
{items.data.Items.map((item, index) => {
|
{items.data.Items.map((item) => {
|
||||||
return (
|
return (
|
||||||
<motion.div
|
<motion.div
|
||||||
style={{
|
style={{
|
||||||
@@ -1400,7 +1349,7 @@ const LibraryView = () => {
|
|||||||
? `${
|
? `${
|
||||||
item.ProductionYear
|
item.ProductionYear
|
||||||
} - ${
|
} - ${
|
||||||
!!item.EndDate
|
item.EndDate
|
||||||
? new Date(
|
? new Date(
|
||||||
item.EndDate,
|
item.EndDate,
|
||||||
).toLocaleString(
|
).toLocaleString(
|
||||||
@@ -1464,7 +1413,8 @@ const LibraryView = () => {
|
|||||||
hasThemeVideo:
|
hasThemeVideo:
|
||||||
hasThemeVideo,
|
hasThemeVideo,
|
||||||
},
|
},
|
||||||
qualityFilters: {
|
qualityFilters:
|
||||||
|
{
|
||||||
isBluRay:
|
isBluRay:
|
||||||
isBluRay,
|
isBluRay,
|
||||||
isDVD: isDVD,
|
isDVD: isDVD,
|
||||||
@@ -1476,7 +1426,8 @@ const LibraryView = () => {
|
|||||||
]}
|
]}
|
||||||
userId={user.data.Id}
|
userId={user.data.Id}
|
||||||
imageBlurhash={
|
imageBlurhash={
|
||||||
!!item.ImageBlurHashes
|
!!item
|
||||||
|
.ImageBlurHashes
|
||||||
?.Primary &&
|
?.Primary &&
|
||||||
item.ImageBlurHashes
|
item.ImageBlurHashes
|
||||||
?.Primary[
|
?.Primary[
|
||||||
@@ -1493,127 +1444,54 @@ const LibraryView = () => {
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<TableContainer>
|
<div
|
||||||
<Table>
|
style={{
|
||||||
<TableBody>
|
display: "flex",
|
||||||
{items.data.Items.map((item, index) => {
|
flexDirection: "column",
|
||||||
return (
|
}}
|
||||||
<TableRow
|
>
|
||||||
component={motion.div}
|
{items.data.Items.map((item) => (
|
||||||
|
<MusicTrack
|
||||||
|
item={item}
|
||||||
key={item.Id}
|
key={item.Id}
|
||||||
sx={{
|
queryKey={[
|
||||||
"& td,& th": {
|
"libraryView",
|
||||||
borderBottom:
|
"currentLibItems",
|
||||||
"1px solid rgb(255 255 255 / 0.1)",
|
id,
|
||||||
},
|
`page: ${page}`,
|
||||||
"&:last-child td, &:last-child th":
|
|
||||||
{ border: 0 },
|
|
||||||
"&:hover": {
|
|
||||||
background:
|
|
||||||
"rgb(255 255 255 / 0.05)",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
initial={{
|
|
||||||
transform:
|
|
||||||
"scale(0.8)",
|
|
||||||
opacity: 0,
|
|
||||||
}}
|
|
||||||
animate={{
|
|
||||||
transform:
|
|
||||||
"scale(1)",
|
|
||||||
opacity: 1,
|
|
||||||
}}
|
|
||||||
transition={{
|
|
||||||
duration: 0.25,
|
|
||||||
ease: "easeInOut",
|
|
||||||
delay: 0.02 * index,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<TableCell width="4.5em">
|
|
||||||
<Box className="library-list-image-container">
|
|
||||||
{!!item
|
|
||||||
.ImageTags
|
|
||||||
.Primary && (
|
|
||||||
<img
|
|
||||||
className="library-list-image"
|
|
||||||
src={`${window.api.basePath}/Items/${item.Id}/Images/Primary?quality=80&tag=${item.ImageTags.Primary}`}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<Box className="library-list-icon-container">
|
|
||||||
<MdiMusic className="library-list-icon" />
|
|
||||||
</Box>
|
|
||||||
</Box>
|
|
||||||
</TableCell>
|
|
||||||
<TableCell>
|
|
||||||
<Typography variant="h6">
|
|
||||||
{item.Name}
|
|
||||||
</Typography>
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
divider={
|
|
||||||
<Typography
|
|
||||||
variant="subtitle1"
|
|
||||||
sx={{
|
|
||||||
opacity: 0.7,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
,
|
|
||||||
</Typography>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{item.Artists.map(
|
|
||||||
(
|
|
||||||
artist,
|
|
||||||
aindex,
|
|
||||||
) => {
|
|
||||||
return (
|
|
||||||
<Typography
|
|
||||||
variant="subtitle1"
|
|
||||||
sx={{
|
|
||||||
opacity: 0.7,
|
|
||||||
}}
|
|
||||||
key={
|
|
||||||
aindex
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{
|
{
|
||||||
artist
|
currentViewType:
|
||||||
}
|
currentViewType,
|
||||||
</Typography>
|
sortAscending:
|
||||||
);
|
sortAscending,
|
||||||
|
sortBy: sortBy,
|
||||||
|
playbackFilters:
|
||||||
|
filterArray,
|
||||||
|
extraFilters: {
|
||||||
|
hasSubtitles:
|
||||||
|
hasSubtitles,
|
||||||
|
hasTrailer:
|
||||||
|
hasTrailer,
|
||||||
|
hasSpecialFeature:
|
||||||
|
hasSpecialFeature,
|
||||||
|
hasThemeSong:
|
||||||
|
hasThemeSong,
|
||||||
|
hasThemeVideo:
|
||||||
|
hasThemeVideo,
|
||||||
},
|
},
|
||||||
)}
|
qualityFilters: {
|
||||||
</Stack>
|
isBluRay: isBluRay,
|
||||||
</TableCell>
|
isDVD: isDVD,
|
||||||
<TableCell>
|
isHD: isHD,
|
||||||
<Typography variant="subtitle1">
|
is4K: is4K,
|
||||||
{getRuntimeMusic(
|
is3D: is3D,
|
||||||
item.RunTimeTicks,
|
},
|
||||||
)}
|
},
|
||||||
</Typography>
|
]}
|
||||||
</TableCell>
|
userId={user.data.Id}
|
||||||
<TableCell width="1em">
|
/>
|
||||||
<IconButton
|
))}
|
||||||
onClick={() => {
|
</div>
|
||||||
handleLiking(
|
|
||||||
item,
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{item.UserData
|
|
||||||
.IsFavorite ? (
|
|
||||||
<MdiHeart />
|
|
||||||
) : (
|
|
||||||
<MdiHeartOutline />
|
|
||||||
)}
|
|
||||||
</IconButton>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</TableBody>
|
|
||||||
</Table>
|
|
||||||
</TableContainer>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{items.isSuccess &&
|
{items.isSuccess &&
|
||||||
@@ -1655,6 +1533,9 @@ const LibraryView = () => {
|
|||||||
{items.isError && <ErrorNotice />}
|
{items.isError && <ErrorNotice />}
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
|
} else if (currentLib.isError) {
|
||||||
|
return <h6>{currentLib.error}</h6>;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default LibraryView;
|
export default LibraryView;
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
import { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||||
import { useNavigate, useParams, Link } from "react-router-dom";
|
import { useNavigate, useParams } from "react-router-dom";
|
||||||
import { EventEmitter as event } from "../../eventEmitter.js";
|
import { EventEmitter as event } from "../../eventEmitter.js";
|
||||||
|
|
||||||
import { saveUser } from "../../utils/storage/user.js";
|
import { saveUser } from "../../utils/storage/user.js";
|
||||||
@@ -34,13 +34,17 @@ import { AppBarBackOnly } from "../../components/appBar/backOnly.jsx";
|
|||||||
|
|
||||||
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 { getQuickConnectApi } from "@jellyfin/sdk/lib/utils/api/quick-connect-api";
|
||||||
|
|
||||||
import "./login.module.scss";
|
import "./login.module.scss";
|
||||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice.jsx";
|
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice.jsx";
|
||||||
|
import { useApi } from "../../utils/store/api.js";
|
||||||
|
|
||||||
export const LoginWithImage = () => {
|
export const LoginWithImage = () => {
|
||||||
const { userName, userId } = useParams();
|
const { userName, userId } = useParams();
|
||||||
|
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
const [password, setPassword] = useState({
|
const [password, setPassword] = useState({
|
||||||
showpass: false,
|
showpass: false,
|
||||||
});
|
});
|
||||||
@@ -67,7 +71,7 @@ export const LoginWithImage = () => {
|
|||||||
|
|
||||||
const authUser = async () => {
|
const authUser = async () => {
|
||||||
try {
|
try {
|
||||||
const auth = await window.api.authenticateUserByName(
|
const auth = await api.authenticateUserByName(
|
||||||
userName,
|
userName,
|
||||||
password.password,
|
password.password,
|
||||||
);
|
);
|
||||||
@@ -86,7 +90,7 @@ export const LoginWithImage = () => {
|
|||||||
if (rememberMe == true) {
|
if (rememberMe == true) {
|
||||||
saveUser(userName, password.password);
|
saveUser(userName, password.password);
|
||||||
}
|
}
|
||||||
event.emit("set-api-accessToken", window.api.basePath);
|
event.emit("set-api-accessToken", api.basePath);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
navigate(`/home`);
|
navigate(`/home`);
|
||||||
};
|
};
|
||||||
@@ -216,9 +220,12 @@ export const LoginWithImage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const UserLogin = () => {
|
export const UserLogin = () => {
|
||||||
const [userList, setUsers] = useState([]);
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
|
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
const handleChangeServer = () => {
|
const handleChangeServer = () => {
|
||||||
navigate("/servers/list");
|
navigate("/servers/list");
|
||||||
};
|
};
|
||||||
@@ -228,13 +235,31 @@ export const UserLogin = () => {
|
|||||||
const users = useQuery({
|
const users = useQuery({
|
||||||
queryKey: ["login", "users"],
|
queryKey: ["login", "users"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const users = await getUserApi(window.api).getPublicUsers();
|
const users = await getUserApi(api).getPublicUsers();
|
||||||
return users.data;
|
return users.data;
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
gcTime: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (users.isLoading) {
|
const handleInitiateQuickConnect = useMutation({
|
||||||
|
mutationKey: ["quick-connect"],
|
||||||
|
mutationFn: async () => {
|
||||||
|
console.log(api);
|
||||||
|
const result = await getQuickConnectApi(api).initiate();
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
onSuccess: (data) => {
|
||||||
|
console.info(data);
|
||||||
|
},
|
||||||
|
onError: (error) => {
|
||||||
|
console.error(error);
|
||||||
|
enqueueSnackbar("Unable to use Quick Connect", {
|
||||||
|
variant: "error",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (users.isPending) {
|
||||||
return <LinearProgress />;
|
return <LinearProgress />;
|
||||||
}
|
}
|
||||||
if (users.isSuccess) {
|
if (users.isSuccess) {
|
||||||
@@ -309,6 +334,14 @@ export const UserLogin = () => {
|
|||||||
>
|
>
|
||||||
Change Server
|
Change Server
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
className="userEventButton"
|
||||||
|
onClick={handleInitiateQuickConnect.mutate}
|
||||||
|
// disabled
|
||||||
|
>
|
||||||
|
Quick Connect
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
className="userEventButton"
|
className="userEventButton"
|
||||||
@@ -329,6 +362,7 @@ export const UserLogin = () => {
|
|||||||
export const UserLoginManual = () => {
|
export const UserLoginManual = () => {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [rememberMe, setRememberMe] = useState(true);
|
const [rememberMe, setRememberMe] = useState(true);
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { enqueueSnackbar } = useSnackbar();
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
@@ -341,12 +375,9 @@ export const UserLoginManual = () => {
|
|||||||
const server = useQuery({
|
const server = useQuery({
|
||||||
queryKey: ["login, manual", "serverInfo"],
|
queryKey: ["login, manual", "serverInfo"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getBrandingApi(
|
const result = await getBrandingApi(api).getBrandingOptions();
|
||||||
window.api,
|
|
||||||
).getBrandingOptions();
|
|
||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
enabled: !!window.api,
|
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -370,7 +401,7 @@ export const UserLoginManual = () => {
|
|||||||
|
|
||||||
const authUser = async () => {
|
const authUser = async () => {
|
||||||
try {
|
try {
|
||||||
const auth = await window.api.authenticateUserByName(
|
const auth = await api.authenticateUserByName(
|
||||||
userName,
|
userName,
|
||||||
password.password,
|
password.password,
|
||||||
);
|
);
|
||||||
@@ -391,7 +422,7 @@ export const UserLoginManual = () => {
|
|||||||
if (rememberMe == true) {
|
if (rememberMe == true) {
|
||||||
saveUser(userName, password.password);
|
saveUser(userName, password.password);
|
||||||
}
|
}
|
||||||
event.emit("set-api-accessToken", window.api.basePath);
|
event.emit("set-api-accessToken", api.basePath);
|
||||||
// setAccessToken(user.data.AccessToken)
|
// setAccessToken(user.data.AccessToken)
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
navigate(`/home`);
|
navigate(`/home`);
|
||||||
@@ -403,7 +434,7 @@ export const UserLoginManual = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{server.isLoading && <LinearProgress />}
|
{server.isPending && <LinearProgress />}
|
||||||
<AppBarBackOnly />
|
<AppBarBackOnly />
|
||||||
<Container
|
<Container
|
||||||
maxWidth="xs"
|
maxWidth="xs"
|
||||||
@@ -421,7 +452,7 @@ export const UserLoginManual = () => {
|
|||||||
justifyContent="center"
|
justifyContent="center"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
sx={{
|
sx={{
|
||||||
opacity: server.isLoading ? 0 : 1,
|
opacity: server.isPending ? 0 : 1,
|
||||||
transition: "opacity 200ms",
|
transition: "opacity 200ms",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
}}
|
}}
|
||||||
@@ -510,10 +541,20 @@ export const UserLoginManual = () => {
|
|||||||
loading={loading}
|
loading={loading}
|
||||||
loadingPosition="end"
|
loadingPosition="end"
|
||||||
size="large"
|
size="large"
|
||||||
sx={{ width: "100%" }}
|
sx={{ width: "100%", mb: 1 }}
|
||||||
>
|
>
|
||||||
Login
|
Login
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
|
<Button
|
||||||
|
color="secondary"
|
||||||
|
variant="contained"
|
||||||
|
className="userEventButton"
|
||||||
|
size="large"
|
||||||
|
sx={{ width: "100%" }}
|
||||||
|
onClick={() => navigate("/servers/list")}
|
||||||
|
>
|
||||||
|
Change Server
|
||||||
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid sx={{ width: "100%" }}>
|
<Grid sx={{ width: "100%" }}>
|
||||||
<Typography variant="subtitle2">
|
<Typography variant="subtitle2">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
@@ -29,6 +29,7 @@ import { Card } from "../../components/card/card";
|
|||||||
import "./person.module.scss";
|
import "./person.module.scss";
|
||||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
@@ -62,20 +63,22 @@ function a11yProps(index) {
|
|||||||
|
|
||||||
const PersonTitlePage = () => {
|
const PersonTitlePage = () => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
|
enabled: Boolean(api),
|
||||||
});
|
});
|
||||||
|
|
||||||
const item = useQuery({
|
const item = useQuery({
|
||||||
queryKey: ["item", id],
|
queryKey: ["item", id],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getUserLibraryApi(window.api).getItem({
|
const result = await getUserLibraryApi(api).getItem({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: id,
|
itemId: id,
|
||||||
fields: [ItemFields.Crew],
|
fields: [ItemFields.Crew],
|
||||||
@@ -90,7 +93,7 @@ const PersonTitlePage = () => {
|
|||||||
const personMovies = useQuery({
|
const personMovies = useQuery({
|
||||||
queryKey: ["item", id, "personMovies"],
|
queryKey: ["item", id, "personMovies"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItems({
|
const result = await getItemsApi(api).getItems({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
personIds: [id],
|
personIds: [id],
|
||||||
includeItemTypes: [BaseItemKind.Movie],
|
includeItemTypes: [BaseItemKind.Movie],
|
||||||
@@ -107,7 +110,7 @@ const PersonTitlePage = () => {
|
|||||||
const personShows = useQuery({
|
const personShows = useQuery({
|
||||||
queryKey: ["item", id, "personShows"],
|
queryKey: ["item", id, "personShows"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItems({
|
const result = await getItemsApi(api).getItems({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
personIds: [id],
|
personIds: [id],
|
||||||
includeItemTypes: [BaseItemKind.Series],
|
includeItemTypes: [BaseItemKind.Series],
|
||||||
@@ -125,7 +128,7 @@ const PersonTitlePage = () => {
|
|||||||
const personBooks = useQuery({
|
const personBooks = useQuery({
|
||||||
queryKey: ["item", id, "personBooks"],
|
queryKey: ["item", id, "personBooks"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItems({
|
const result = await getItemsApi(api).getItems({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
personIds: [id],
|
personIds: [id],
|
||||||
includeItemTypes: [BaseItemKind.Book],
|
includeItemTypes: [BaseItemKind.Book],
|
||||||
@@ -142,7 +145,7 @@ const PersonTitlePage = () => {
|
|||||||
const personPhotos = useQuery({
|
const personPhotos = useQuery({
|
||||||
queryKey: ["item", id, "personPhotos"],
|
queryKey: ["item", id, "personPhotos"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItems({
|
const result = await getItemsApi(api).getItems({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
personIds: [id],
|
personIds: [id],
|
||||||
includeItemTypes: [BaseItemKind.Photo],
|
includeItemTypes: [BaseItemKind.Photo],
|
||||||
@@ -158,7 +161,7 @@ const PersonTitlePage = () => {
|
|||||||
const personEpisodes = useQuery({
|
const personEpisodes = useQuery({
|
||||||
queryKey: ["item", id, "personEpisodes"],
|
queryKey: ["item", id, "personEpisodes"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItems({
|
const result = await getItemsApi(api).getItems({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
personIds: [id],
|
personIds: [id],
|
||||||
includeItemTypes: [BaseItemKind.Episode],
|
includeItemTypes: [BaseItemKind.Episode],
|
||||||
@@ -225,11 +228,11 @@ const PersonTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
personMovies.isLoading,
|
personMovies.isPending,
|
||||||
personShows.isLoading,
|
personShows.isPending,
|
||||||
personBooks.isLoading,
|
personBooks.isPending,
|
||||||
personPhotos.isLoading,
|
personPhotos.isPending,
|
||||||
personEpisodes.isLoading,
|
personEpisodes.isPending,
|
||||||
]);
|
]);
|
||||||
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||||
|
|
||||||
@@ -240,14 +243,14 @@ const PersonTitlePage = () => {
|
|||||||
setAppBackdrop(
|
setAppBackdrop(
|
||||||
item.data.Type === BaseItemKind.MusicAlbum ||
|
item.data.Type === BaseItemKind.MusicAlbum ||
|
||||||
item.data.Type === BaseItemKind.Episode
|
item.data.Type === BaseItemKind.Episode
|
||||||
? `${window.api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
? `${api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
||||||
: `${window.api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
: `${api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||||
item.data.Id,
|
item.data.Id,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading) {
|
if (item.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@@ -279,7 +282,6 @@ const PersonTitlePage = () => {
|
|||||||
queryKey={["item", id]}
|
queryKey={["item", id]}
|
||||||
disableInfoStrip
|
disableInfoStrip
|
||||||
disablePlayButton
|
disablePlayButton
|
||||||
disableLikeButton
|
|
||||||
disableMarkAsPlayedButton
|
disableMarkAsPlayedButton
|
||||||
/>
|
/>
|
||||||
<div className="item-detail-person-container">
|
<div className="item-detail-person-container">
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
import React from "react";
|
||||||
import { appWindow } from "@tauri-apps/api/window";
|
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 Box from "@mui/material/Box";
|
||||||
import Stack from "@mui/material/Stack";
|
import Stack from "@mui/material/Stack";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
@@ -11,10 +10,8 @@ import Slider from "@mui/material/Slider";
|
|||||||
import CircularProgress from "@mui/material/CircularProgress";
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
import Menu from "@mui/material/Menu";
|
import Menu from "@mui/material/Menu";
|
||||||
import MenuItem from "@mui/material/MenuItem";
|
import MenuItem from "@mui/material/MenuItem";
|
||||||
import TextField from "@mui/material/TextField";
|
|
||||||
import ListItem from "@mui/material/ListItem";
|
|
||||||
import ListItemText from "@mui/material/ListItemText";
|
|
||||||
import Backdrop from "@mui/material/Backdrop";
|
import Backdrop from "@mui/material/Backdrop";
|
||||||
|
import LinearProgress from "@mui/material/LinearProgress";
|
||||||
|
|
||||||
import ReactPlayer from "react-player";
|
import ReactPlayer from "react-player";
|
||||||
|
|
||||||
@@ -22,11 +19,13 @@ import { usePlaybackStore } from "../../utils/store/playback";
|
|||||||
import { MdiArrowLeft } from "../../components/icons/mdiArrowLeft";
|
import { MdiArrowLeft } from "../../components/icons/mdiArrowLeft";
|
||||||
import { MdiPlay } from "../../components/icons/mdiPlay";
|
import { MdiPlay } from "../../components/icons/mdiPlay";
|
||||||
|
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useRef, useState, useCallback, useEffect } from "react";
|
import { useRef, useState, useCallback, useEffect } from "react";
|
||||||
import { secToTicks, ticksToSec } from "../../utils/date/time";
|
import { secToTicks, ticksToSec } from "../../utils/date/time";
|
||||||
|
|
||||||
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||||
|
import { getMediaInfoApi } from "@jellyfin/sdk/lib/utils/api/media-info-api";
|
||||||
|
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||||
|
|
||||||
import "./videoPlayer.module.scss";
|
import "./videoPlayer.module.scss";
|
||||||
import { MdiPause } from "../../components/icons/mdiPause";
|
import { MdiPause } from "../../components/icons/mdiPause";
|
||||||
@@ -41,11 +40,19 @@ import { MdiPlaySpeed } from "../../components/icons/mdiPlaySpeed";
|
|||||||
|
|
||||||
import { endsAt } from "../../utils/date/time";
|
import { endsAt } from "../../utils/date/time";
|
||||||
|
|
||||||
import useKeyPress from "../../utils/hooks/useKeyPress";
|
|
||||||
import { MdiCog } from "../../components/icons/mdiCog";
|
import { MdiCog } from "../../components/icons/mdiCog";
|
||||||
|
import { MdiSkipNext } from "../../components/icons/mdiSkipNext";
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
|
import { motion, AnimatePresence } from "framer-motion";
|
||||||
|
import { ItemFields, LocationType } from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
import { MdiSkipPrevious } from "../../components/icons/mdiSkipPrevious";
|
||||||
|
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
export const VideoPlayer = () => {
|
export const VideoPlayer = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
const [settingsMenuEl, setSettingsMenuEl] = useState(null);
|
const [settingsMenuEl, setSettingsMenuEl] = useState(null);
|
||||||
const settingsMenuState = Boolean(settingsMenuEl);
|
const settingsMenuState = Boolean(settingsMenuEl);
|
||||||
@@ -61,21 +68,76 @@ export const VideoPlayer = () => {
|
|||||||
itemDuration,
|
itemDuration,
|
||||||
itemId,
|
itemId,
|
||||||
itemName,
|
itemName,
|
||||||
subtitleTracksStore,
|
audioStreamIndex,
|
||||||
selectedSubtitleTrack,
|
subtitleStreamIndex,
|
||||||
|
userId,
|
||||||
|
seriesId,
|
||||||
|
setUrl,
|
||||||
|
setPosition,
|
||||||
|
setDurationStore,
|
||||||
|
setItemId,
|
||||||
|
setItemName,
|
||||||
|
setAudioStreamIndex,
|
||||||
|
setVideoStreamIndex,
|
||||||
|
setSubtitleStreamIndex,
|
||||||
|
setMediaSourceId,
|
||||||
|
setUserId,
|
||||||
|
setSeriesId,
|
||||||
|
item,
|
||||||
] = usePlaybackStore((state) => [
|
] = usePlaybackStore((state) => [
|
||||||
state.url,
|
state.url,
|
||||||
state.startPosition,
|
state.startPosition,
|
||||||
state.duration,
|
state.duration,
|
||||||
state.itemId,
|
state.itemId,
|
||||||
state.itemName,
|
state.itemName,
|
||||||
state.subtitleTracks,
|
state.audioStreamIndex,
|
||||||
state.selectedSubtitleTrack,
|
state.subtitleStreamIndex,
|
||||||
|
state.userId,
|
||||||
|
state.seriesId,
|
||||||
|
state.setUrl,
|
||||||
|
state.setPosition,
|
||||||
|
state.setDuration,
|
||||||
|
state.setItemId,
|
||||||
|
state.setItemName,
|
||||||
|
state.setAudioStreamIndex,
|
||||||
|
state.setVideoStreamIndex,
|
||||||
|
state.setSubtitleStreamIndex,
|
||||||
|
state.setMediaSourceId,
|
||||||
|
state.setUserId,
|
||||||
|
state.setSeriesId,
|
||||||
|
state.item,
|
||||||
]);
|
]);
|
||||||
const [currentSubtrack, setCurrentSubtrack] = useState(
|
|
||||||
selectedSubtitleTrack,
|
const mediaInfo = useQuery({
|
||||||
|
queryKey: ["videoPlayer", itemId, "mediaInfo"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getMediaInfoApi(api).getPlaybackInfo({
|
||||||
|
itemId: itemId,
|
||||||
|
userId: userId,
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const episodes = useQuery({
|
||||||
|
queryKey: ["videoPlayer", itemId, "episodes"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getTvShowsApi(api).getEpisodes({
|
||||||
|
userId: userId,
|
||||||
|
seriesId: seriesId,
|
||||||
|
fields: [ItemFields.MediaSources],
|
||||||
|
excludeLocationTypes: [LocationType.Virtual],
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const currentEpisodeIndex = episodes.data?.Items?.findIndex(
|
||||||
|
(item) => item.Id == itemId,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const [currentSubtrack] = useState(subtitleStreamIndex);
|
||||||
|
|
||||||
const [showControls, setShowControls] = useState(false);
|
const [showControls, setShowControls] = useState(false);
|
||||||
|
|
||||||
const playerRef = useRef();
|
const playerRef = useRef();
|
||||||
@@ -87,39 +149,35 @@ export const VideoPlayer = () => {
|
|||||||
const [isPIP, setIsPIP] = useState(false);
|
const [isPIP, setIsPIP] = useState(false);
|
||||||
const [volume, setVolume] = useState(0.8);
|
const [volume, setVolume] = useState(0.8);
|
||||||
|
|
||||||
const [showVolume, setShowVolume] = useState(false);
|
|
||||||
|
|
||||||
const [duration, setDuration] = useState(0);
|
|
||||||
const [progress, setProgress] = useState(0);
|
const [progress, setProgress] = useState(0);
|
||||||
const [currentTime, setCurrentTime] = useState(startPosition);
|
const [currentTime, setCurrentTime] = useState(startPosition);
|
||||||
|
|
||||||
const onReady = useCallback(() => {
|
const onReady = useCallback(async () => {
|
||||||
if (!isReady) {
|
if (!isReady) {
|
||||||
const timeToStart = ticksToSec(startPosition);
|
const timeToStart = ticksToSec(startPosition);
|
||||||
playerRef.current.seekTo(timeToStart, "seconds");
|
await getPlaystateApi(api).reportPlaybackStart({
|
||||||
setDuration(playerRef.current.getDuration());
|
playbackStartInfo: {
|
||||||
setIsReady(true);
|
PlayMethod: mediaInfo.data?.MediaSources[0]
|
||||||
const player = playerRef.current.getInternalPlayer();
|
.SupportsDirectPlay
|
||||||
console.log(player.config);
|
? "DirectPlay"
|
||||||
}
|
: mediaInfo.data?.MediaSources[0]
|
||||||
}, [isReady]);
|
.SupportsDirectStream
|
||||||
|
? "DirectStream"
|
||||||
const onProgress = async (e) => {
|
: "Transcode",
|
||||||
if (!isSeeking) {
|
AudioStreamIndex: audioStreamIndex,
|
||||||
setProgress(e.played);
|
SubtitleStreamIndex: subtitleStreamIndex,
|
||||||
setCurrentTime(secToTicks(e.playedSeconds));
|
userId: userId,
|
||||||
}
|
CanSeek: true,
|
||||||
await getPlaystateApi(window.api).reportPlaybackProgress({
|
|
||||||
playbackProgressInfo: {
|
|
||||||
ItemId: itemId,
|
ItemId: itemId,
|
||||||
IsMuted: isMuted,
|
MediaSourceId: mediaInfo.data?.MediaSources[0].Id,
|
||||||
PositionTicks: secToTicks(e.playedSeconds),
|
PlaySessionId: mediaInfo.data?.PlaySessionId,
|
||||||
PlaybackStartTimeTicks: startPosition,
|
|
||||||
VolumeLevel: volume * 100,
|
|
||||||
IsPaused: !isPlaying,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
console.log(startPosition);
|
||||||
|
playerRef.current.seekTo(timeToStart, "seconds");
|
||||||
|
setIsReady(true);
|
||||||
|
}
|
||||||
|
}, [isReady]);
|
||||||
|
|
||||||
const handleDisplayCurrentTime = () => {
|
const handleDisplayCurrentTime = () => {
|
||||||
let time = ticksToSec(progress * itemDuration);
|
let time = ticksToSec(progress * itemDuration);
|
||||||
@@ -157,15 +215,225 @@ export const VideoPlayer = () => {
|
|||||||
})}`;
|
})}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handlePlayNextEpisode = () => {
|
||||||
|
// Reset Player time state
|
||||||
|
setProgress(0);
|
||||||
|
setCurrentTime(0);
|
||||||
|
setIsPlaying(true);
|
||||||
|
|
||||||
|
setUserId(userId);
|
||||||
|
|
||||||
|
// Set all required stream index
|
||||||
|
setAudioStreamIndex(0);
|
||||||
|
setVideoStreamIndex(0);
|
||||||
|
setSubtitleStreamIndex(0);
|
||||||
|
|
||||||
|
setMediaSourceId(episodes.data.Items[currentEpisodeIndex + 1].Id);
|
||||||
|
|
||||||
|
setUrl(
|
||||||
|
`${api.basePath}/Videos/${
|
||||||
|
episodes.data.Items[currentEpisodeIndex + 1].Id
|
||||||
|
}/stream.
|
||||||
|
${episodes.data.Items[currentEpisodeIndex + 1].MediaSources[0].Container}
|
||||||
|
?Static=true&mediaSourceId=${
|
||||||
|
episodes.data.Items[currentEpisodeIndex + 1].Id
|
||||||
|
}&deviceId=${api.deviceInfo.id}&api_key=${
|
||||||
|
api.accessToken
|
||||||
|
}&Tag=${
|
||||||
|
episodes.data.Items[currentEpisodeIndex + 1].MediaSources[0]
|
||||||
|
.ETag
|
||||||
|
}&videoStreamIndex=${0}&audioStreamIndex=${0}`,
|
||||||
|
);
|
||||||
|
setPosition(
|
||||||
|
episodes.data.Items[currentEpisodeIndex + 1].UserData
|
||||||
|
?.PlaybackPositionTicks,
|
||||||
|
);
|
||||||
|
|
||||||
|
setSeriesId(episodes.data.Items[currentEpisodeIndex + 1].SeriesId);
|
||||||
|
if (
|
||||||
|
episodes.data.Items[currentEpisodeIndex + 1].ImageBlurHashes.Logo
|
||||||
|
) {
|
||||||
|
setItemName(
|
||||||
|
<div className="video-osd-name">
|
||||||
|
<img
|
||||||
|
src={`${api.basePath}/Items/${
|
||||||
|
episodes.data.Items[currentEpisodeIndex + 1]
|
||||||
|
.SeriesId
|
||||||
|
}/Images/Logo`}
|
||||||
|
className="video-osd-name-logo"
|
||||||
|
onLoad={(e) => {
|
||||||
|
e.target.style.opacity = 1;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
S
|
||||||
|
{
|
||||||
|
episodes.data.Items[currentEpisodeIndex + 1]
|
||||||
|
.ParentIndexNumber
|
||||||
|
}
|
||||||
|
:E
|
||||||
|
{
|
||||||
|
episodes.data.Items[currentEpisodeIndex + 1]
|
||||||
|
.IndexNumber
|
||||||
|
}{" "}
|
||||||
|
{
|
||||||
|
episodes.data.Items[currentEpisodeIndex + 1]
|
||||||
|
.Name
|
||||||
|
}
|
||||||
|
</Typography>
|
||||||
|
</div>,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
setItemName(
|
||||||
|
<div className="video-osd-name">
|
||||||
|
<Typography variant="h6">
|
||||||
|
{
|
||||||
|
episodes.data.Items[currentEpisodeIndex + 1]
|
||||||
|
.SeriesName
|
||||||
|
}
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
S
|
||||||
|
{
|
||||||
|
episodes.data.Items[currentEpisodeIndex + 1]
|
||||||
|
.ParentIndexNumber
|
||||||
|
}
|
||||||
|
:E
|
||||||
|
{
|
||||||
|
episodes.data.Items[currentEpisodeIndex + 1]
|
||||||
|
.IndexNumber
|
||||||
|
}{" "}
|
||||||
|
{
|
||||||
|
episodes.data.Items[currentEpisodeIndex + 1]
|
||||||
|
.Name
|
||||||
|
}
|
||||||
|
</Typography>
|
||||||
|
</div>,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
setItemId(episodes.data.Items[currentEpisodeIndex + 1].Id);
|
||||||
|
setDurationStore(
|
||||||
|
episodes.data.Items[currentEpisodeIndex + 1].RunTimeTicks,
|
||||||
|
);
|
||||||
|
|
||||||
|
// navigate("player");
|
||||||
|
};
|
||||||
|
const handlePlayPrevEpisode = () => {
|
||||||
|
// Reset video player state
|
||||||
|
setProgress(0);
|
||||||
|
setCurrentTime(0);
|
||||||
|
setIsPlaying(true);
|
||||||
|
|
||||||
|
setUserId(userId);
|
||||||
|
|
||||||
|
// Set all required stream index
|
||||||
|
setAudioStreamIndex(0);
|
||||||
|
setVideoStreamIndex(0);
|
||||||
|
setSubtitleStreamIndex(0);
|
||||||
|
|
||||||
|
setMediaSourceId(episodes.data.Items[currentEpisodeIndex - 1].Id);
|
||||||
|
|
||||||
|
setUrl(
|
||||||
|
`${api.basePath}/Videos/${
|
||||||
|
episodes.data.Items[currentEpisodeIndex - 1].Id
|
||||||
|
}/stream.
|
||||||
|
${episodes.data.Items[currentEpisodeIndex - 1].MediaSources[0].Container}
|
||||||
|
?Static=true&mediaSourceId=${
|
||||||
|
episodes.data.Items[currentEpisodeIndex - 1].Id
|
||||||
|
}&deviceId=${api.deviceInfo.id}&api_key=${
|
||||||
|
api.accessToken
|
||||||
|
}&Tag=${
|
||||||
|
episodes.data.Items[currentEpisodeIndex - 1].MediaSources[0]
|
||||||
|
.ETag
|
||||||
|
}&videoStreamIndex=${0}&audioStreamIndex=${0}`,
|
||||||
|
);
|
||||||
|
setPosition(
|
||||||
|
episodes.data.Items[currentEpisodeIndex - 1].UserData
|
||||||
|
?.PlaybackPositionTicks,
|
||||||
|
);
|
||||||
|
|
||||||
|
setSeriesId(episodes.data.Items[currentEpisodeIndex - 1].SeriesId);
|
||||||
|
if (
|
||||||
|
episodes.data.Items[currentEpisodeIndex - 1].ImageBlurHashes.Logo
|
||||||
|
) {
|
||||||
|
setItemName(
|
||||||
|
<div className="video-osd-name">
|
||||||
|
<img
|
||||||
|
src={`${api.basePath}/Items/${
|
||||||
|
episodes.data.Items[currentEpisodeIndex - 1]
|
||||||
|
.SeriesId
|
||||||
|
}/Images/Logo`}
|
||||||
|
className="video-osd-name-logo"
|
||||||
|
onLoad={(e) => {
|
||||||
|
e.target.style.opacity = 1;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
S
|
||||||
|
{
|
||||||
|
episodes.data.Items[currentEpisodeIndex - 1]
|
||||||
|
.ParentIndexNumber
|
||||||
|
}
|
||||||
|
:E
|
||||||
|
{
|
||||||
|
episodes.data.Items[currentEpisodeIndex - 1]
|
||||||
|
.IndexNumber
|
||||||
|
}{" "}
|
||||||
|
{
|
||||||
|
episodes.data.Items[currentEpisodeIndex - 1]
|
||||||
|
.Name
|
||||||
|
}
|
||||||
|
</Typography>
|
||||||
|
</div>,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
setItemName(
|
||||||
|
<div className="video-osd-name">
|
||||||
|
<Typography variant="h6">
|
||||||
|
{
|
||||||
|
episodes.data.Items[currentEpisodeIndex - 1]
|
||||||
|
.SeriesName
|
||||||
|
}
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
S
|
||||||
|
{
|
||||||
|
episodes.data.Items[currentEpisodeIndex - 1]
|
||||||
|
.ParentIndexNumber
|
||||||
|
}
|
||||||
|
:E
|
||||||
|
{
|
||||||
|
episodes.data.Items[currentEpisodeIndex - 1]
|
||||||
|
.IndexNumber
|
||||||
|
}{" "}
|
||||||
|
{
|
||||||
|
episodes.data.Items[currentEpisodeIndex - 1]
|
||||||
|
.Name
|
||||||
|
}
|
||||||
|
</Typography>
|
||||||
|
</div>,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
setItemId(episodes.data.Items[currentEpisodeIndex - 1].Id);
|
||||||
|
setDurationStore(
|
||||||
|
episodes.data.Items[currentEpisodeIndex - 1].RunTimeTicks,
|
||||||
|
);
|
||||||
|
|
||||||
|
// navigate("player");
|
||||||
|
};
|
||||||
|
|
||||||
const [appFullscreen, setAppFullScreen] = useState(false);
|
const [appFullscreen, setAppFullScreen] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let timeout = null;
|
|
||||||
if (showControls) {
|
if (showControls) {
|
||||||
window.clearTimeout(timeout);
|
let timeout = setTimeout(() => {
|
||||||
timeout = setTimeout(() => {
|
|
||||||
setShowControls(false);
|
setShowControls(false);
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
return () => {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}, [showControls]);
|
}, [showControls]);
|
||||||
|
|
||||||
@@ -181,43 +449,185 @@ export const VideoPlayer = () => {
|
|||||||
playerRef.current.getCurrentTime() - 15,
|
playerRef.current.getCurrentTime() - 15,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
case " ":
|
||||||
|
setIsPlaying((state) => !state);
|
||||||
|
break;
|
||||||
|
case "ArrowUp":
|
||||||
|
setVolume((state) => (state <= 0.9 ? state + 0.1 : state));
|
||||||
|
break;
|
||||||
|
case "ArrowDown":
|
||||||
|
setVolume((state) => (state >= 0.1 ? state - 0.1 : state));
|
||||||
|
break;
|
||||||
|
case "F":
|
||||||
|
case "f":
|
||||||
|
setAppFullScreen((state) => !state);
|
||||||
|
break;
|
||||||
|
case "P":
|
||||||
case "p":
|
case "p":
|
||||||
setIsPlaying(!isPlaying);
|
setIsPIP((state) => !state);
|
||||||
|
break;
|
||||||
|
case "M":
|
||||||
|
case "m":
|
||||||
|
setIsMuted((state) => !state);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
console.log(event.key);
|
console.log(event.key);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const [subs, setSubs] = useState([]);
|
useEffect(() => {
|
||||||
|
appWindow.setFullscreen(appFullscreen);
|
||||||
|
}, [appFullscreen]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setSubs(
|
// attach the event listener
|
||||||
subtitleTracksStore.map((sub, index) => {
|
document.addEventListener("keydown", handleKeyPress);
|
||||||
return {
|
|
||||||
kind: "subtitles",
|
// remove the event listener
|
||||||
src: `${window.api.basePath}/Videos/${itemId}/${itemId}/Subtitles/${sub.Index}/Stream.vtt?api_key=${window.api.accessToken}`,
|
return () => {
|
||||||
srcLang: sub?.Language,
|
document.removeEventListener("keydown", handleKeyPress);
|
||||||
default: false,
|
};
|
||||||
mode:
|
}, [handleKeyPress]);
|
||||||
sub.Index == currentSubtrack
|
|
||||||
? "showing"
|
const [showVolume, setShowVolume] = useState(false);
|
||||||
: "hidden",
|
|
||||||
|
// Show/Hide volume Indicator
|
||||||
|
useEffect(() => {
|
||||||
|
setShowVolume(true);
|
||||||
|
const timeout = setTimeout(() => {
|
||||||
|
setShowVolume(false);
|
||||||
|
}, 5000);
|
||||||
|
return () => {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
};
|
||||||
|
}, [volume]);
|
||||||
|
|
||||||
|
const handleExit = async () => {
|
||||||
|
// Remove app from fullscreen
|
||||||
|
await appWindow.setFullscreen(false);
|
||||||
|
// Send playback end report
|
||||||
|
await getPlaystateApi(api).reportPlaybackStopped({
|
||||||
|
playbackStopInfo: {
|
||||||
|
Failed: false,
|
||||||
|
Item: item,
|
||||||
|
ItemId: itemId,
|
||||||
|
MediaSourceId: mediaInfo.data?.MediaSources[0].Id,
|
||||||
|
PlaySessionId: mediaInfo.data?.PlaySessionId,
|
||||||
|
PositionTicks: currentTime,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
navigate(-1);
|
||||||
|
|
||||||
|
// Reset playback store
|
||||||
|
setUrl("");
|
||||||
|
setPosition(0);
|
||||||
|
setDurationStore(0);
|
||||||
|
setItemId("");
|
||||||
|
setItemName("");
|
||||||
|
setAudioStreamIndex(0);
|
||||||
|
setVideoStreamIndex(0);
|
||||||
|
setSubtitleStreamIndex(0);
|
||||||
|
setMediaSourceId("");
|
||||||
|
setUserId("");
|
||||||
|
setSeriesId("");
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleOnEnd = () => {
|
||||||
|
console.log("Playback ended");
|
||||||
|
if (seriesId) {
|
||||||
|
if (episodes.isSuccess && episodes.data.TotalRecordCount > 0) {
|
||||||
|
handlePlayNextEpisode();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
handleExit();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const onProgress = async (e) => {
|
||||||
|
if (!isSeeking) {
|
||||||
|
setProgress(e.played);
|
||||||
|
setCurrentTime(secToTicks(e.playedSeconds));
|
||||||
|
}
|
||||||
|
await getPlaystateApi(api).reportPlaybackProgress({
|
||||||
|
playbackProgressInfo: {
|
||||||
|
PlayMethod: mediaInfo.data?.MediaSources[0]
|
||||||
|
.SupportsDirectPlay
|
||||||
|
? "DirectPlay"
|
||||||
|
: mediaInfo.data?.MediaSources[0].SupportsDirectStream
|
||||||
|
? "DirectStream"
|
||||||
|
: "Transcode",
|
||||||
|
ItemId: itemId,
|
||||||
|
IsMuted: isMuted,
|
||||||
|
PositionTicks: secToTicks(e.playedSeconds),
|
||||||
|
PlaybackStartTimeTicks: startPosition,
|
||||||
|
VolumeLevel: volume * 100,
|
||||||
|
IsPaused: !isPlaying,
|
||||||
|
AudioStreamIndex: audioStreamIndex,
|
||||||
|
Brightness: 100,
|
||||||
|
CanSeek: true,
|
||||||
|
MediaSourceId: mediaInfo.data?.MediaSources[0].Id,
|
||||||
|
SubtitleStreamIndex: subtitleStreamIndex,
|
||||||
|
PlaySessionId: mediaInfo.data?.PlaySessionId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (Math.round(e.playedSeconds) == ticksToSec(itemDuration)) {
|
||||||
|
handleOnEnd();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}),
|
|
||||||
);
|
|
||||||
}, [subtitleTracksStore]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<div
|
||||||
className="video-player-container"
|
className="video-player-container"
|
||||||
sx={{ background: "black" }}
|
style={{ background: "black" }}
|
||||||
onMouseMove={() => {
|
onMouseMove={() => {
|
||||||
setShowControls(true);
|
setShowControls(true);
|
||||||
}}
|
}}
|
||||||
|
key={itemId}
|
||||||
>
|
>
|
||||||
<Box
|
<AnimatePresence>
|
||||||
sx={{
|
{showVolume && (
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0 }}
|
||||||
|
animate={{ opacity: 1 }}
|
||||||
|
exit={{ opacity: 0 }}
|
||||||
|
style={{
|
||||||
|
position: "absolute",
|
||||||
|
top: "4em",
|
||||||
|
right: "4em",
|
||||||
|
background: "rgb(0 0 0/ 0.5)",
|
||||||
|
backdropFilter: "blur(10px)",
|
||||||
|
width: "10em",
|
||||||
|
height: "10em",
|
||||||
|
padding: "1em",
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
flexDirection: "column",
|
||||||
|
borderRadius: "10px",
|
||||||
|
border: "2px solid rgb(255 255 255 / 0.2)",
|
||||||
|
gap: "2em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="material-symbols-rounded"
|
||||||
|
style={{ fontSize: "2.8em" }}
|
||||||
|
>
|
||||||
|
{isMuted ? "volume_mute" : "volume_up"}
|
||||||
|
</div>
|
||||||
|
<LinearProgress
|
||||||
|
variant="determinate"
|
||||||
|
value={volume * 100}
|
||||||
|
style={{
|
||||||
|
width: "8em",
|
||||||
|
margin: "0 1em",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</motion.div>
|
||||||
|
)}
|
||||||
|
</AnimatePresence>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
inset: 0,
|
inset: 0,
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@@ -228,40 +638,38 @@ export const VideoPlayer = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CircularProgress />
|
<CircularProgress />
|
||||||
</Box>
|
</div>
|
||||||
<Backdrop
|
<Backdrop
|
||||||
className="video-osd"
|
className={
|
||||||
|
showControls
|
||||||
|
? "video-osd video-osd-visible"
|
||||||
|
: "video-osd"
|
||||||
|
}
|
||||||
sx={{
|
sx={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
zIndex: 100000,
|
zIndex: 1000,
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
background: "transparent",
|
background: "transparent",
|
||||||
}}
|
}}
|
||||||
open={showControls}
|
open={showControls}
|
||||||
>
|
>
|
||||||
<AppBar
|
<div
|
||||||
position="static"
|
style={{
|
||||||
elevation={0}
|
|
||||||
sx={{
|
|
||||||
background:
|
background:
|
||||||
"linear-gradient(to bottom, rgb(0 0 0 / 0.75), transparent)",
|
"linear-gradient(to bottom, rgb(0 0 0 / 0.75), transparent)",
|
||||||
|
width: "100vw",
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
padding: "0.85em 1.2em",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Toolbar>
|
<IconButton onClick={handleExit}>
|
||||||
<IconButton
|
|
||||||
onClick={async () => {
|
|
||||||
await appWindow.setFullscreen(false);
|
|
||||||
navigate(-1);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<MdiArrowLeft />
|
<MdiArrowLeft />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Typography ml={2} variant="h6">
|
|
||||||
{itemName}
|
{itemName}
|
||||||
</Typography>
|
</div>
|
||||||
</Toolbar>
|
|
||||||
</AppBar>
|
|
||||||
<Stack
|
<Stack
|
||||||
direction="column"
|
direction="column"
|
||||||
padding={2}
|
padding={2}
|
||||||
@@ -282,7 +690,7 @@ export const VideoPlayer = () => {
|
|||||||
{handleDisplayCurrentTime()}
|
{handleDisplayCurrentTime()}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Slider
|
<Slider
|
||||||
value={currentTime}
|
value={currentTime ? currentTime : 0}
|
||||||
step={0.01}
|
step={0.01}
|
||||||
max={itemDuration}
|
max={itemDuration}
|
||||||
onChange={(e, newVal) => {
|
onChange={(e, newVal) => {
|
||||||
@@ -300,6 +708,7 @@ export const VideoPlayer = () => {
|
|||||||
valueLabelFormat={(value) =>
|
valueLabelFormat={(value) =>
|
||||||
handleDisplayTime(value)
|
handleDisplayTime(value)
|
||||||
}
|
}
|
||||||
|
// size="medium"
|
||||||
sx={{
|
sx={{
|
||||||
"& .MuiSlider-valueLabel": {
|
"& .MuiSlider-valueLabel": {
|
||||||
lineHeight: 1.2,
|
lineHeight: 1.2,
|
||||||
@@ -339,6 +748,19 @@ export const VideoPlayer = () => {
|
|||||||
justifyContent="center"
|
justifyContent="center"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
>
|
>
|
||||||
|
<IconButton
|
||||||
|
onClick={handlePlayPrevEpisode}
|
||||||
|
disabled={
|
||||||
|
seriesId
|
||||||
|
? episodes.isPending ||
|
||||||
|
currentEpisodeIndex == 0
|
||||||
|
: true
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div className="material-symbols-rounded">
|
||||||
|
skip_previous
|
||||||
|
</div>
|
||||||
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
playerRef.current.seekTo(
|
playerRef.current.seekTo(
|
||||||
@@ -347,12 +769,20 @@ export const VideoPlayer = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<MdiRewind />
|
<div className="material-symbols-rounded">
|
||||||
|
fast_rewind
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() => setIsPlaying(!isPlaying)}
|
onClick={() =>
|
||||||
|
setIsPlaying((state) => !state)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{isPlaying ? <MdiPause /> : <MdiPlay />}
|
<div className="material-symbols-rounded">
|
||||||
|
{isPlaying
|
||||||
|
? "pause"
|
||||||
|
: "play_arrow"}
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
@@ -362,7 +792,25 @@ export const VideoPlayer = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<MdiFastForward />
|
<div className="material-symbols-rounded">
|
||||||
|
fast_forward
|
||||||
|
</div>
|
||||||
|
</IconButton>
|
||||||
|
<IconButton
|
||||||
|
onClick={handlePlayNextEpisode}
|
||||||
|
disabled={
|
||||||
|
seriesId
|
||||||
|
? episodes.isPending ||
|
||||||
|
episodes.data
|
||||||
|
?.TotalRecordCount ==
|
||||||
|
currentEpisodeIndex +
|
||||||
|
1
|
||||||
|
: true
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div className="material-symbols-rounded">
|
||||||
|
skip_next
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Typography variant="subtitle1">
|
<Typography variant="subtitle1">
|
||||||
{endsAt(itemDuration - currentTime)}
|
{endsAt(itemDuration - currentTime)}
|
||||||
@@ -387,7 +835,7 @@ export const VideoPlayer = () => {
|
|||||||
role: "listbox",
|
role: "listbox",
|
||||||
}}
|
}}
|
||||||
anchorOrigin={{
|
anchorOrigin={{
|
||||||
vertical: "bottom",
|
vertical: "top",
|
||||||
horizontal: "center",
|
horizontal: "center",
|
||||||
}}
|
}}
|
||||||
transformOrigin={{
|
transformOrigin={{
|
||||||
@@ -432,20 +880,24 @@ export const VideoPlayer = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<MdiPlaySpeed />
|
<div className="material-symbols-rounded">
|
||||||
|
pace
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Box>
|
</Box>
|
||||||
<IconButton
|
<IconButton
|
||||||
sx={{
|
sx={{
|
||||||
ml: 0.1,
|
ml: 0.1,
|
||||||
}}
|
}}
|
||||||
onClick={() => setIsMuted(!isMuted)}
|
onClick={() =>
|
||||||
|
setIsMuted((state) => !state)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{isMuted ? (
|
<div className="material-symbols-rounded">
|
||||||
<MdiVolumeOff />
|
{isMuted
|
||||||
) : (
|
? "volume_mute"
|
||||||
<MdiVolumeHigh />
|
: "volume_up"}
|
||||||
)}
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Slider
|
<Slider
|
||||||
value={isMuted ? 0 : volume * 100}
|
value={isMuted ? 0 : volume * 100}
|
||||||
@@ -458,10 +910,11 @@ export const VideoPlayer = () => {
|
|||||||
valueLabelFormat={(value) =>
|
valueLabelFormat={(value) =>
|
||||||
Math.floor(value)
|
Math.floor(value)
|
||||||
}
|
}
|
||||||
|
size="small"
|
||||||
sx={{
|
sx={{
|
||||||
mr: 1,
|
mr: 1,
|
||||||
ml: 1,
|
ml: 1,
|
||||||
width: "10em",
|
width: "8em",
|
||||||
"& .MuiSlider-valueLabel": {
|
"& .MuiSlider-valueLabel": {
|
||||||
lineHeight: 1.2,
|
lineHeight: 1.2,
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
@@ -513,7 +966,9 @@ export const VideoPlayer = () => {
|
|||||||
}
|
}
|
||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
<MdiCog />
|
<div className="material-symbols-rounded">
|
||||||
|
settings
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Box>
|
</Box>
|
||||||
<IconButton
|
<IconButton
|
||||||
@@ -521,23 +976,22 @@ export const VideoPlayer = () => {
|
|||||||
setIsPIP(!isPIP);
|
setIsPIP(!isPIP);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<MdiPictureInPictureBottomRight />
|
<div className="material-symbols-rounded">
|
||||||
|
picture_in_picture_alt
|
||||||
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
let fstate =
|
let fstate =
|
||||||
await appWindow.isFullscreen();
|
await appWindow.isFullscreen();
|
||||||
setAppFullScreen(!fstate);
|
setAppFullScreen(!fstate);
|
||||||
await appWindow.setFullscreen(
|
|
||||||
!fstate,
|
|
||||||
);
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{appFullscreen ? (
|
<div className="material-symbols-rounded">
|
||||||
<MdiFullscreenExit />
|
{appFullscreen
|
||||||
) : (
|
? "fullscreen_exit"
|
||||||
<MdiFullscreen />
|
: "fullscreen"}
|
||||||
)}
|
</div>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -564,19 +1018,16 @@ export const VideoPlayer = () => {
|
|||||||
tracks: [
|
tracks: [
|
||||||
{
|
{
|
||||||
kind: "subtitles",
|
kind: "subtitles",
|
||||||
src: `${window.api.basePath}/Videos/${itemId}/${itemId}/Subtitles/${currentSubtrack}/Stream.vtt?api_key=${window.api.accessToken}`,
|
src: `${api.basePath}/Videos/${itemId}/${itemId}/Subtitles/${currentSubtrack}/Stream.vtt?api_key=${api.accessToken}`,
|
||||||
srcLang: "",
|
srcLang: "",
|
||||||
default: true,
|
default: true,
|
||||||
mode:
|
mode: "showing",
|
||||||
currentSubtrack == -1
|
|
||||||
? "hidden"
|
|
||||||
: "showing",
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
playbackRate={availableSpeeds[speed]}
|
playbackRate={availableSpeeds[speed]}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -5,9 +5,23 @@
|
|||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity 0.1s linear;
|
transition: opacity 0.1s linear;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
cursor: none;
|
||||||
|
&-name {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-left: 1.2em;
|
||||||
|
&-logo {
|
||||||
|
width: 16em;
|
||||||
|
max-height: 6em;
|
||||||
|
object-fit: contain;
|
||||||
|
object-position: left top;
|
||||||
|
filter: drop-shadow(0 0 10px black);
|
||||||
}
|
}
|
||||||
&-osd-visible &-osd {
|
gap: 0.5em;
|
||||||
opacity: 1;
|
}
|
||||||
|
}
|
||||||
|
&-osd-visible {
|
||||||
|
cursor: default;
|
||||||
}
|
}
|
||||||
&-player-container {
|
&-player-container {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useState, useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
@@ -7,20 +7,13 @@ import CircularProgress from "@mui/material/CircularProgress";
|
|||||||
|
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
import {
|
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
|
||||||
BaseItemKind,
|
|
||||||
ItemFields,
|
|
||||||
SortOrder,
|
|
||||||
} from "@jellyfin/sdk/lib/generated-client";
|
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||||
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||||
import { getPlaylistsApi } from "@jellyfin/sdk/lib/utils/api/playlists-api";
|
import { getPlaylistsApi } from "@jellyfin/sdk/lib/utils/api/playlists-api";
|
||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { MdiClockOutline } from "../../components/icons/mdiClockOutline";
|
|
||||||
|
|
||||||
import { getRuntimeMusic, getRuntimeFull, endsAt } from "../../utils/date/time";
|
|
||||||
|
|
||||||
import Hero from "../../components/layouts/item/hero";
|
import Hero from "../../components/layouts/item/hero";
|
||||||
import { Card } from "../../components/card/card";
|
import { Card } from "../../components/card/card";
|
||||||
@@ -29,10 +22,8 @@ import { CardScroller } from "../../components/cardScroller/cardScroller";
|
|||||||
import "./playlist.module.scss";
|
import "./playlist.module.scss";
|
||||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
import LikeButton from "../../components/buttons/likeButton";
|
|
||||||
import { MdiPlayOutline } from "../../components/icons/mdiPlayOutline";
|
|
||||||
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
|
||||||
import MusicTrack from "../../components/musicTrack";
|
import MusicTrack from "../../components/musicTrack";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
@@ -65,20 +56,22 @@ function a11yProps(index) {
|
|||||||
|
|
||||||
const PlaylistTitlePage = () => {
|
const PlaylistTitlePage = () => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
|
enabled: Boolean(api),
|
||||||
});
|
});
|
||||||
|
|
||||||
const item = useQuery({
|
const item = useQuery({
|
||||||
queryKey: ["item", id],
|
queryKey: ["item", id],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getUserLibraryApi(window.api).getItem({
|
const result = await getUserLibraryApi(api).getItem({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: id,
|
itemId: id,
|
||||||
fields: [ItemFields.Crew],
|
fields: [ItemFields.Crew],
|
||||||
@@ -93,7 +86,7 @@ const PlaylistTitlePage = () => {
|
|||||||
const similarItems = useQuery({
|
const similarItems = useQuery({
|
||||||
queryKey: ["item", id, "similarItem"],
|
queryKey: ["item", id, "similarItem"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let result = await getLibraryApi(window.api).getSimilarAlbums({
|
let result = await getLibraryApi(api).getSimilarAlbums({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: item.data.Id,
|
itemId: item.data.Id,
|
||||||
limit: 16,
|
limit: 16,
|
||||||
@@ -108,9 +101,7 @@ const PlaylistTitlePage = () => {
|
|||||||
const musicTracks = useQuery({
|
const musicTracks = useQuery({
|
||||||
queryKey: ["item", id, "musicTracks"],
|
queryKey: ["item", id, "musicTracks"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getPlaylistsApi(
|
const result = await getPlaylistsApi(api).getPlaylistItems({
|
||||||
window.api,
|
|
||||||
).getPlaylistItems({
|
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
playlistId: item.data.Id,
|
playlistId: item.data.Id,
|
||||||
});
|
});
|
||||||
@@ -127,14 +118,14 @@ const PlaylistTitlePage = () => {
|
|||||||
setAppBackdrop(
|
setAppBackdrop(
|
||||||
item.data.Type === BaseItemKind.MusicAlbum ||
|
item.data.Type === BaseItemKind.MusicAlbum ||
|
||||||
item.data.Type === BaseItemKind.Episode
|
item.data.Type === BaseItemKind.Episode
|
||||||
? `${window.api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
? `${api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
||||||
: `${window.api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
: `${api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||||
item.data.Id,
|
item.data.Id,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading || similarItems.isLoading) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@@ -169,7 +160,7 @@ const PlaylistTitlePage = () => {
|
|||||||
audioPlayButton
|
audioPlayButton
|
||||||
cardType="square"
|
cardType="square"
|
||||||
/>
|
/>
|
||||||
{musicTracks.isLoading ? (
|
{musicTracks.isPending ? (
|
||||||
<></>
|
<></>
|
||||||
) : (
|
) : (
|
||||||
musicTracks.data.TotalRecordCount > 0 &&
|
musicTracks.data.TotalRecordCount > 0 &&
|
||||||
@@ -216,7 +207,7 @@ const PlaylistTitlePage = () => {
|
|||||||
? `${
|
? `${
|
||||||
similar.ProductionYear
|
similar.ProductionYear
|
||||||
} - ${
|
} - ${
|
||||||
!!similar.EndDate
|
similar.EndDate
|
||||||
? new Date(
|
? new Date(
|
||||||
similar.EndDate,
|
similar.EndDate,
|
||||||
).toLocaleString(
|
).toLocaleString(
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
|
|
||||||
import TextField from "@mui/material/TextField";
|
import TextField from "@mui/material/TextField";
|
||||||
import CircularProgress from "@mui/material/CircularProgress";
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
@@ -22,18 +22,22 @@ import { getPersonsApi } from "@jellyfin/sdk/lib/utils/api/persons-api";
|
|||||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||||
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
||||||
import { Card } from "../../components/card/card";
|
import { Card } from "../../components/card/card";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
|
|
||||||
const SearchPage = () => {
|
const SearchPage = () => {
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
const [searchTerm, setSearchTerm] = useState("");
|
const [searchTerm, setSearchTerm] = useState("");
|
||||||
const searchParam = useDebounce(searchTerm, 500);
|
const searchParam = useDebounce(searchTerm, 500);
|
||||||
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
|
enabled: Boolean(api),
|
||||||
});
|
});
|
||||||
|
|
||||||
const itemLimit = 12;
|
const itemLimit = 12;
|
||||||
@@ -41,7 +45,7 @@ const SearchPage = () => {
|
|||||||
const movies = useQuery({
|
const movies = useQuery({
|
||||||
queryKey: ["search", "items", "Movie", searchParam],
|
queryKey: ["search", "items", "Movie", searchParam],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItemsByUserId({
|
const result = await getItemsApi(api).getItemsByUserId({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
searchTerm,
|
searchTerm,
|
||||||
includeItemTypes: [BaseItemKind.Movie],
|
includeItemTypes: [BaseItemKind.Movie],
|
||||||
@@ -56,7 +60,7 @@ const SearchPage = () => {
|
|||||||
const series = useQuery({
|
const series = useQuery({
|
||||||
queryKey: ["search", "items", "Series", searchParam],
|
queryKey: ["search", "items", "Series", searchParam],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItemsByUserId({
|
const result = await getItemsApi(api).getItemsByUserId({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
searchTerm,
|
searchTerm,
|
||||||
includeItemTypes: [BaseItemKind.Series],
|
includeItemTypes: [BaseItemKind.Series],
|
||||||
@@ -71,7 +75,7 @@ const SearchPage = () => {
|
|||||||
const musicAlbum = useQuery({
|
const musicAlbum = useQuery({
|
||||||
queryKey: ["search", "items", "MusicAlbum", searchParam],
|
queryKey: ["search", "items", "MusicAlbum", searchParam],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItemsByUserId({
|
const result = await getItemsApi(api).getItemsByUserId({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
searchTerm,
|
searchTerm,
|
||||||
includeItemTypes: [BaseItemKind.MusicAlbum],
|
includeItemTypes: [BaseItemKind.MusicAlbum],
|
||||||
@@ -86,7 +90,7 @@ const SearchPage = () => {
|
|||||||
const audio = useQuery({
|
const audio = useQuery({
|
||||||
queryKey: ["search", "items", "Audio", searchParam],
|
queryKey: ["search", "items", "Audio", searchParam],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItemsByUserId({
|
const result = await getItemsApi(api).getItemsByUserId({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
searchTerm,
|
searchTerm,
|
||||||
includeItemTypes: [BaseItemKind.Audio],
|
includeItemTypes: [BaseItemKind.Audio],
|
||||||
@@ -101,7 +105,7 @@ const SearchPage = () => {
|
|||||||
const book = useQuery({
|
const book = useQuery({
|
||||||
queryKey: ["search", "items", "Book", searchParam],
|
queryKey: ["search", "items", "Book", searchParam],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItemsByUserId({
|
const result = await getItemsApi(api).getItemsByUserId({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
searchTerm,
|
searchTerm,
|
||||||
includeItemTypes: [BaseItemKind.Book],
|
includeItemTypes: [BaseItemKind.Book],
|
||||||
@@ -116,7 +120,7 @@ const SearchPage = () => {
|
|||||||
const musicArtists = useQuery({
|
const musicArtists = useQuery({
|
||||||
queryKey: ["search", "items", "MusicArtists", searchParam],
|
queryKey: ["search", "items", "MusicArtists", searchParam],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getItemsApi(window.api).getItemsByUserId({
|
const result = await getItemsApi(api).getItemsByUserId({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
searchTerm,
|
searchTerm,
|
||||||
includeItemTypes: [BaseItemKind.MusicArtist],
|
includeItemTypes: [BaseItemKind.MusicArtist],
|
||||||
@@ -131,7 +135,7 @@ const SearchPage = () => {
|
|||||||
const person = useQuery({
|
const person = useQuery({
|
||||||
queryKey: ["search", "items", "Person", searchParam],
|
queryKey: ["search", "items", "Person", searchParam],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getPersonsApi(window.api).getPersons({
|
const result = await getPersonsApi(api).getPersons({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
searchTerm,
|
searchTerm,
|
||||||
limit: itemLimit,
|
limit: itemLimit,
|
||||||
@@ -194,13 +198,13 @@ const SearchPage = () => {
|
|||||||
Boolean(
|
Boolean(
|
||||||
searchTerm,
|
searchTerm,
|
||||||
) &&
|
) &&
|
||||||
(movies.isLoading ||
|
(movies.isPending ||
|
||||||
series.isLoading ||
|
series.isPending ||
|
||||||
audio.isLoading ||
|
audio.isPending ||
|
||||||
musicAlbum.isLoading ||
|
musicAlbum.isPending ||
|
||||||
musicArtists.isLoading ||
|
musicArtists.isPending ||
|
||||||
person.isLoading ||
|
person.isPending ||
|
||||||
book.isLoading)
|
book.isPending)
|
||||||
? 1
|
? 1
|
||||||
: 0,
|
: 0,
|
||||||
}}
|
}}
|
||||||
@@ -226,8 +230,9 @@ const SearchPage = () => {
|
|||||||
displayCards={8}
|
displayCards={8}
|
||||||
disableDecoration
|
disableDecoration
|
||||||
>
|
>
|
||||||
{movies.data.Items.map((item, index) => (
|
{movies.data.Items.map((item) => (
|
||||||
<Card
|
<Card
|
||||||
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
cardTitle={item.Name}
|
cardTitle={item.Name}
|
||||||
imageType={"Primary"}
|
imageType={"Primary"}
|
||||||
@@ -261,6 +266,7 @@ const SearchPage = () => {
|
|||||||
>
|
>
|
||||||
{series.data.Items.map((item, index) => (
|
{series.data.Items.map((item, index) => (
|
||||||
<Card
|
<Card
|
||||||
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
cardTitle={item.Name}
|
cardTitle={item.Name}
|
||||||
imageType={"Primary"}
|
imageType={"Primary"}
|
||||||
@@ -304,6 +310,7 @@ const SearchPage = () => {
|
|||||||
>
|
>
|
||||||
{audio.data.Items.map((item, index) => (
|
{audio.data.Items.map((item, index) => (
|
||||||
<Card
|
<Card
|
||||||
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
cardTitle={item.Name}
|
cardTitle={item.Name}
|
||||||
imageType={"Primary"}
|
imageType={"Primary"}
|
||||||
@@ -338,6 +345,7 @@ const SearchPage = () => {
|
|||||||
>
|
>
|
||||||
{musicAlbum.data.Items.map((item, index) => (
|
{musicAlbum.data.Items.map((item, index) => (
|
||||||
<Card
|
<Card
|
||||||
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
seriesId={item.SeriesId}
|
seriesId={item.SeriesId}
|
||||||
cardTitle={item.Name}
|
cardTitle={item.Name}
|
||||||
@@ -373,6 +381,7 @@ const SearchPage = () => {
|
|||||||
>
|
>
|
||||||
{book.data.Items.map((item, index) => (
|
{book.data.Items.map((item, index) => (
|
||||||
<Card
|
<Card
|
||||||
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
cardTitle={item.Name}
|
cardTitle={item.Name}
|
||||||
imageType={"Primary"}
|
imageType={"Primary"}
|
||||||
@@ -406,9 +415,9 @@ const SearchPage = () => {
|
|||||||
displayCards={8}
|
displayCards={8}
|
||||||
disableDecoration
|
disableDecoration
|
||||||
>
|
>
|
||||||
{musicArtists.data.Items.map(
|
{musicArtists.data.Items.map((item) => (
|
||||||
(item, index) => (
|
|
||||||
<Card
|
<Card
|
||||||
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
cardTitle={item.Name}
|
cardTitle={item.Name}
|
||||||
imageType={"Primary"}
|
imageType={"Primary"}
|
||||||
@@ -424,18 +433,15 @@ const SearchPage = () => {
|
|||||||
imageBlurhash={
|
imageBlurhash={
|
||||||
!!item.ImageBlurHashes
|
!!item.ImageBlurHashes
|
||||||
?.Primary &&
|
?.Primary &&
|
||||||
item.ImageBlurHashes
|
item.ImageBlurHashes?.Primary[
|
||||||
?.Primary[
|
|
||||||
Object.keys(
|
Object.keys(
|
||||||
item
|
item.ImageBlurHashes
|
||||||
.ImageBlurHashes
|
|
||||||
.Primary,
|
.Primary,
|
||||||
)[0]
|
)[0]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
),
|
))}
|
||||||
)}
|
|
||||||
</CardScroller>
|
</CardScroller>
|
||||||
)}
|
)}
|
||||||
{person.isSuccess && person.data.Items.length > 0 && (
|
{person.isSuccess && person.data.Items.length > 0 && (
|
||||||
@@ -444,8 +450,9 @@ const SearchPage = () => {
|
|||||||
displayCards={8}
|
displayCards={8}
|
||||||
disableDecoration
|
disableDecoration
|
||||||
>
|
>
|
||||||
{person.data.Items.map((item, index) => (
|
{person.data.Items.map((item) => (
|
||||||
<Card
|
<Card
|
||||||
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
cardTitle={item.Name}
|
cardTitle={item.Name}
|
||||||
imageType={"Primary"}
|
imageType={"Primary"}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
@@ -12,7 +12,7 @@ import MenuItem from "@mui/material/MenuItem";
|
|||||||
|
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
|
|
||||||
import { useParams, useNavigate, Link as RouterLink } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BaseItemKind,
|
BaseItemKind,
|
||||||
@@ -26,7 +26,7 @@ import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
|||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
import { getRuntimeMusic, getRuntimeFull, endsAt } from "../../utils/date/time";
|
import { getRuntimeMusic } from "../../utils/date/time";
|
||||||
|
|
||||||
import Hero from "../../components/layouts/item/hero";
|
import Hero from "../../components/layouts/item/hero";
|
||||||
import { Card } from "../../components/card/card";
|
import { Card } from "../../components/card/card";
|
||||||
@@ -36,12 +36,13 @@ import { CardScroller } from "../../components/cardScroller/cardScroller";
|
|||||||
import "./series.module.scss";
|
import "./series.module.scss";
|
||||||
import { EpisodeCardsSkeleton } from "../../components/skeleton/episodeCards";
|
import { EpisodeCardsSkeleton } from "../../components/skeleton/episodeCards";
|
||||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||||
import { usePlaybackStore } from "../../utils/store/playback";
|
|
||||||
|
|
||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
import { ActorCard } from "../../components/card/actorCards";
|
import { ActorCard } from "../../components/card/actorCards";
|
||||||
import { SeasonSelectorSkeleton } from "../../components/skeleton/seasonSelector";
|
import { SeasonSelectorSkeleton } from "../../components/skeleton/seasonSelector";
|
||||||
import { stagger } from "framer-motion";
|
import LikeButton from "../../components/buttons/likeButton";
|
||||||
|
import MarkPlayedButton from "../../components/buttons/markPlayedButton";
|
||||||
|
import { useApi } from "../../utils/store/api";
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|
||||||
@@ -65,30 +66,25 @@ TabPanel.propTypes = {
|
|||||||
value: PropTypes.number.isRequired,
|
value: PropTypes.number.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
function a11yProps(index) {
|
|
||||||
return {
|
|
||||||
id: `full-width-tab-${index}`,
|
|
||||||
"aria-controls": `full-width-tabpanel-${index}`,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const SeriesTitlePage = () => {
|
const SeriesTitlePage = () => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
const navigate = useNavigate();
|
|
||||||
|
const [api] = useApi((state) => [state.api]);
|
||||||
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
|
enabled: Boolean(api),
|
||||||
});
|
});
|
||||||
|
|
||||||
const item = useQuery({
|
const item = useQuery({
|
||||||
queryKey: ["item", id],
|
queryKey: ["item", id],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getUserLibraryApi(window.api).getItem({
|
const result = await getUserLibraryApi(api).getItem({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: id,
|
itemId: id,
|
||||||
fields: [ItemFields.Crew],
|
fields: [ItemFields.Crew],
|
||||||
@@ -103,7 +99,7 @@ const SeriesTitlePage = () => {
|
|||||||
const similarItems = useQuery({
|
const similarItems = useQuery({
|
||||||
queryKey: ["item", id, "similarItem"],
|
queryKey: ["item", id, "similarItem"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getLibraryApi(window.api).getSimilarShows({
|
const result = await getLibraryApi(api).getSimilarShows({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
itemId: item.data.Id,
|
itemId: item.data.Id,
|
||||||
limit: 16,
|
limit: 16,
|
||||||
@@ -118,7 +114,7 @@ const SeriesTitlePage = () => {
|
|||||||
const seasons = useQuery({
|
const seasons = useQuery({
|
||||||
queryKey: ["item", id, "seasons"],
|
queryKey: ["item", id, "seasons"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getTvShowsApi(window.api).getSeasons({
|
const result = await getTvShowsApi(api).getSeasons({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
seriesId: item.data.Id,
|
seriesId: item.data.Id,
|
||||||
isSpecialSeason: false,
|
isSpecialSeason: false,
|
||||||
@@ -133,7 +129,7 @@ const SeriesTitlePage = () => {
|
|||||||
const nextUpEpisode = useQuery({
|
const nextUpEpisode = useQuery({
|
||||||
queryKey: ["item", id, "nextUp"],
|
queryKey: ["item", id, "nextUp"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getTvShowsApi(window.api).getNextUp({
|
const result = await getTvShowsApi(api).getNextUp({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
limit: 1,
|
limit: 1,
|
||||||
parentId: item.data.Id,
|
parentId: item.data.Id,
|
||||||
@@ -148,10 +144,25 @@ const SeriesTitlePage = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const [currentSeason, setCurrentSeason] = useState(0);
|
const [currentSeason, setCurrentSeason] = useState(0);
|
||||||
|
|
||||||
|
const currentSeasonItem = useQuery({
|
||||||
|
queryKey: ["item", id, "season", currentSeason],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getUserLibraryApi(api).getItem({
|
||||||
|
userId: user.data.Id,
|
||||||
|
itemId: seasons.data.Items[currentSeason].Id,
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
enabled: seasons.isSuccess,
|
||||||
|
networkMode: "always",
|
||||||
|
refetchOnWindowFocus: true,
|
||||||
|
});
|
||||||
|
|
||||||
const episodes = useQuery({
|
const episodes = useQuery({
|
||||||
queryKey: ["item", id, `season ${currentSeason + 1}`, "episodes"],
|
queryKey: ["item", id, `season ${currentSeason + 1}`, "episodes"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getTvShowsApi(window.api).getEpisodes({
|
const result = await getTvShowsApi(api).getEpisodes({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
seriesId: item.data.Id,
|
seriesId: item.data.Id,
|
||||||
seasonId: seasons.data.Items[currentSeason].Id,
|
seasonId: seasons.data.Items[currentSeason].Id,
|
||||||
@@ -168,9 +179,7 @@ const SeriesTitlePage = () => {
|
|||||||
const specialFeatures = useQuery({
|
const specialFeatures = useQuery({
|
||||||
queryKey: ["item", id, `specialFeatures`],
|
queryKey: ["item", id, `specialFeatures`],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const result = await getUserLibraryApi(
|
const result = await getUserLibraryApi(api).getSpecialFeatures({
|
||||||
window.api,
|
|
||||||
).getSpecialFeatures({
|
|
||||||
itemId: item.data.Id,
|
itemId: item.data.Id,
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
});
|
});
|
||||||
@@ -178,24 +187,6 @@ const SeriesTitlePage = () => {
|
|||||||
},
|
},
|
||||||
enabled: item.isSuccess,
|
enabled: item.isSuccess,
|
||||||
});
|
});
|
||||||
const [
|
|
||||||
setUrl,
|
|
||||||
setPosition,
|
|
||||||
setDuration,
|
|
||||||
setItemId,
|
|
||||||
setItemName,
|
|
||||||
setSubtitleTracksStore,
|
|
||||||
setSelectedSubtitleTrack,
|
|
||||||
] = usePlaybackStore((state) => [
|
|
||||||
state.setUrl,
|
|
||||||
state.setPosition,
|
|
||||||
state.setDuration,
|
|
||||||
state.setItemId,
|
|
||||||
state.setItemName,
|
|
||||||
state.setSubtitleTracks,
|
|
||||||
state.setSelectedSubtitleTrack,
|
|
||||||
]);
|
|
||||||
|
|
||||||
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||||
|
|
||||||
const [directors, setDirectors] = useState([]);
|
const [directors, setDirectors] = useState([]);
|
||||||
@@ -205,8 +196,8 @@ const SeriesTitlePage = () => {
|
|||||||
setAppBackdrop(
|
setAppBackdrop(
|
||||||
item.data.Type === BaseItemKind.MusicAlbum ||
|
item.data.Type === BaseItemKind.MusicAlbum ||
|
||||||
item.data.Type === BaseItemKind.Episode
|
item.data.Type === BaseItemKind.Episode
|
||||||
? `${window.api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
? `${api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
||||||
: `${window.api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
: `${api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||||
item.data.Id,
|
item.data.Id,
|
||||||
);
|
);
|
||||||
let direTp = item.data.People.filter(
|
let direTp = item.data.People.filter(
|
||||||
@@ -220,7 +211,7 @@ const SeriesTitlePage = () => {
|
|||||||
}
|
}
|
||||||
}, [item.isSuccess]);
|
}, [item.isSuccess]);
|
||||||
|
|
||||||
if (item.isLoading || similarItems.isLoading) {
|
if (item.isPending || similarItems.isPending) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@@ -262,18 +253,15 @@ const SeriesTitlePage = () => {
|
|||||||
displayCards={4}
|
displayCards={4}
|
||||||
disableDecoration
|
disableDecoration
|
||||||
>
|
>
|
||||||
{nextUpEpisode.data.Items.map(
|
{nextUpEpisode.data.Items.map((episode) => {
|
||||||
(episode, index) => {
|
|
||||||
return (
|
return (
|
||||||
<EpisodeCard
|
<EpisodeCard
|
||||||
|
key={episode.Id}
|
||||||
item={episode}
|
item={episode}
|
||||||
cardTitle={`S${episode.ParentIndexNumber}:E${episode.IndexNumber} - ${episode.Name}`}
|
cardTitle={`S${episode.ParentIndexNumber}:E${episode.IndexNumber} - ${episode.Name}`}
|
||||||
cardCaption={
|
cardCaption={episode.Overview}
|
||||||
episode.Overview
|
|
||||||
}
|
|
||||||
imageBlurhash={
|
imageBlurhash={
|
||||||
episode
|
episode.ImageBlurHashes
|
||||||
.ImageBlurHashes
|
|
||||||
?.Primary[
|
?.Primary[
|
||||||
Object.keys(
|
Object.keys(
|
||||||
episode
|
episode
|
||||||
@@ -286,20 +274,18 @@ const SeriesTitlePage = () => {
|
|||||||
"item",
|
"item",
|
||||||
id,
|
id,
|
||||||
`season ${
|
`season ${
|
||||||
currentSeason +
|
currentSeason + 1
|
||||||
1
|
|
||||||
}`,
|
}`,
|
||||||
"episodes",
|
"episodes",
|
||||||
]}
|
]}
|
||||||
userId={user.data.Id}
|
userId={user.data.Id}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
},
|
})}
|
||||||
)}
|
|
||||||
</CardScroller>
|
</CardScroller>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{seasons.isLoading ? (
|
{seasons.isPending ? (
|
||||||
<SeasonSelectorSkeleton />
|
<SeasonSelectorSkeleton />
|
||||||
) : (
|
) : (
|
||||||
<div className="item-series-seasons-container">
|
<div className="item-series-seasons-container">
|
||||||
@@ -327,7 +313,7 @@ const SeriesTitlePage = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
<Chip
|
<Chip
|
||||||
label={
|
label={
|
||||||
episodes.isLoading ? (
|
episodes.isPending ? (
|
||||||
<CircularProgress
|
<CircularProgress
|
||||||
size={20}
|
size={20}
|
||||||
style={{
|
style={{
|
||||||
@@ -345,10 +331,66 @@ const SeriesTitlePage = () => {
|
|||||||
}
|
}
|
||||||
></Chip>
|
></Chip>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
gap: "0.75em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{currentSeasonItem.isSuccess && (
|
||||||
|
<LikeButton
|
||||||
|
itemId={
|
||||||
|
currentSeasonItem.data.Id
|
||||||
|
}
|
||||||
|
isFavorite={
|
||||||
|
currentSeasonItem.data
|
||||||
|
.UserData.IsFavorite
|
||||||
|
}
|
||||||
|
queryKey={[
|
||||||
|
"item",
|
||||||
|
id,
|
||||||
|
"season",
|
||||||
|
currentSeason,
|
||||||
|
]}
|
||||||
|
userId={user.data.Id}
|
||||||
|
itemName={
|
||||||
|
currentSeasonItem.data
|
||||||
|
.Name
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{currentSeasonItem.isSuccess && (
|
||||||
|
<>
|
||||||
|
<MarkPlayedButton
|
||||||
|
itemId={
|
||||||
|
currentSeasonItem
|
||||||
|
.data.Id
|
||||||
|
}
|
||||||
|
isPlayed={
|
||||||
|
currentSeasonItem
|
||||||
|
.data.UserData
|
||||||
|
.Played
|
||||||
|
}
|
||||||
|
queryKey={[
|
||||||
|
"item",
|
||||||
|
id,
|
||||||
|
"season",
|
||||||
|
currentSeason,
|
||||||
|
]}
|
||||||
|
userId={user.data.Id}
|
||||||
|
itemName={
|
||||||
|
currentSeasonItem
|
||||||
|
.data.Name
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<TextField
|
<TextField
|
||||||
value={currentSeason}
|
value={currentSeason}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
setCurrentSeason(e.target.value)
|
setCurrentSeason(
|
||||||
|
e.target.value,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
select
|
select
|
||||||
SelectProps={{
|
SelectProps={{
|
||||||
@@ -372,13 +414,13 @@ const SeriesTitlePage = () => {
|
|||||||
)}
|
)}
|
||||||
</TextField>
|
</TextField>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<Divider />
|
<Divider />
|
||||||
<div className="item-detail-episodes-container">
|
<div className="item-detail-episodes-container">
|
||||||
{episodes.isLoading ? (
|
{episodes.isPending ? (
|
||||||
<EpisodeCardsSkeleton />
|
<EpisodeCardsSkeleton />
|
||||||
) : (
|
) : (
|
||||||
episodes.data.Items.map(
|
episodes.data.Items.map((episode) => {
|
||||||
(episode, index) => {
|
|
||||||
return (
|
return (
|
||||||
<motion.div
|
<motion.div
|
||||||
key={episode.Id}
|
key={episode.Id}
|
||||||
@@ -400,8 +442,7 @@ const SeriesTitlePage = () => {
|
|||||||
ease: "backInOut",
|
ease: "backInOut",
|
||||||
}}
|
}}
|
||||||
style={{
|
style={{
|
||||||
maxWidth:
|
maxWidth: "23.3vw",
|
||||||
"23.3vw",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<EpisodeCard
|
<EpisodeCard
|
||||||
@@ -410,7 +451,7 @@ const SeriesTitlePage = () => {
|
|||||||
episode.ParentIndexNumber ==
|
episode.ParentIndexNumber ==
|
||||||
0
|
0
|
||||||
? `${episode.SeasonName} - ${episode.Name}`
|
? `${episode.SeasonName} - ${episode.Name}`
|
||||||
: !!episode.IndexNumberEnd
|
: episode.IndexNumberEnd
|
||||||
? `${episode.IndexNumber}-${episode.IndexNumberEnd}. ${episode.Name}`
|
? `${episode.IndexNumber}-${episode.IndexNumberEnd}. ${episode.Name}`
|
||||||
: `${episode.IndexNumber}. ${episode.Name}`
|
: `${episode.IndexNumber}. ${episode.Name}`
|
||||||
}
|
}
|
||||||
@@ -441,14 +482,12 @@ const SeriesTitlePage = () => {
|
|||||||
"episodes",
|
"episodes",
|
||||||
]}
|
]}
|
||||||
userId={
|
userId={
|
||||||
user.data
|
user.data.Id
|
||||||
.Id
|
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
},
|
})
|
||||||
)
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -460,15 +499,12 @@ const SeriesTitlePage = () => {
|
|||||||
displayCards={8}
|
displayCards={8}
|
||||||
disableDecoration
|
disableDecoration
|
||||||
>
|
>
|
||||||
{specialFeatures.data.map(
|
{specialFeatures.data.map((special) => {
|
||||||
(special, index) => {
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
key={special.Id}
|
key={special.Id}
|
||||||
item={special}
|
item={special}
|
||||||
seriesId={
|
seriesId={special.SeriesId}
|
||||||
special.SeriesId
|
|
||||||
}
|
|
||||||
cardTitle={special.Name}
|
cardTitle={special.Name}
|
||||||
imageType="Primary"
|
imageType="Primary"
|
||||||
cardCaption={getRuntimeMusic(
|
cardCaption={getRuntimeMusic(
|
||||||
@@ -481,11 +517,9 @@ const SeriesTitlePage = () => {
|
|||||||
"similarItem",
|
"similarItem",
|
||||||
]}
|
]}
|
||||||
imageBlurhash={
|
imageBlurhash={
|
||||||
!!special
|
!!special.ImageBlurHashes
|
||||||
.ImageBlurHashes
|
|
||||||
?.Primary &&
|
?.Primary &&
|
||||||
special
|
special.ImageBlurHashes
|
||||||
.ImageBlurHashes
|
|
||||||
.Primary[
|
.Primary[
|
||||||
Object.keys(
|
Object.keys(
|
||||||
special
|
special
|
||||||
@@ -498,8 +532,7 @@ const SeriesTitlePage = () => {
|
|||||||
onClick={() => {}}
|
onClick={() => {}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
},
|
})}
|
||||||
)}
|
|
||||||
</CardScroller>
|
</CardScroller>
|
||||||
)}
|
)}
|
||||||
{item.data.People.length > 0 && (
|
{item.data.People.length > 0 && (
|
||||||
@@ -508,7 +541,7 @@ const SeriesTitlePage = () => {
|
|||||||
displayCards={8}
|
displayCards={8}
|
||||||
disableDecoration
|
disableDecoration
|
||||||
>
|
>
|
||||||
{item.data.People.map((person, index) => {
|
{item.data.People.map((person) => {
|
||||||
return (
|
return (
|
||||||
<ActorCard
|
<ActorCard
|
||||||
key={person.Id}
|
key={person.Id}
|
||||||
@@ -534,7 +567,7 @@ const SeriesTitlePage = () => {
|
|||||||
displayCards={8}
|
displayCards={8}
|
||||||
disableDecoration
|
disableDecoration
|
||||||
>
|
>
|
||||||
{similarItems.data.Items.map((similar, index) => {
|
{similarItems.data.Items.map((similar) => {
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
key={similar.Id}
|
key={similar.Id}
|
||||||
@@ -556,7 +589,7 @@ const SeriesTitlePage = () => {
|
|||||||
? `${
|
? `${
|
||||||
similar.ProductionYear
|
similar.ProductionYear
|
||||||
} - ${
|
} - ${
|
||||||
!!similar.EndDate
|
similar.EndDate
|
||||||
? new Date(
|
? new Date(
|
||||||
similar.EndDate,
|
similar.EndDate,
|
||||||
).toLocaleString(
|
).toLocaleString(
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
import { useState, useEffect } from "react";
|
import React, { useState } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import axios from "axios";
|
|
||||||
|
|
||||||
import { EventEmitter as event } from "../../../eventEmitter.js";
|
import { setDefaultServer, setServer } from "../../../utils/storage/servers.js";
|
||||||
import { setServer } from "../../../utils/storage/servers.js";
|
|
||||||
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
|
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
|
||||||
|
|
||||||
// MUI
|
// MUI
|
||||||
import TextField from "@mui/material/TextField";
|
import TextField from "@mui/material/TextField";
|
||||||
@@ -16,216 +12,94 @@ import Grid from "@mui/material/Grid";
|
|||||||
import LoadingButton from "@mui/lab/LoadingButton";
|
import LoadingButton from "@mui/lab/LoadingButton";
|
||||||
import SvgIcon from "@mui/material/SvgIcon";
|
import SvgIcon from "@mui/material/SvgIcon";
|
||||||
import Container from "@mui/material/Container";
|
import Container from "@mui/material/Container";
|
||||||
|
import LinearProgress from "@mui/material/LinearProgress";
|
||||||
|
|
||||||
import { mdiChevronRight } from "@mdi/js";
|
import { mdiChevronRight } from "@mdi/js";
|
||||||
|
|
||||||
import { useSnackbar } from "notistack";
|
import { useSnackbar } from "notistack";
|
||||||
|
|
||||||
import {
|
|
||||||
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";
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||||
|
import { useApi } from "../../../utils/store/api.js";
|
||||||
|
import { MdiInformation } from "../../../components/icons/mdiInformation.jsx";
|
||||||
|
import { yellow } from "@mui/material/colors";
|
||||||
|
|
||||||
export const ServerList = () => {
|
export const ServerSetup = () => {
|
||||||
const [renderServerList, setRenderServerList] = useState(false);
|
/**
|
||||||
const [serverListRender, setServerListRender] = useState([]);
|
* @type {[import("@jellyfin/sdk").Api, function, Jellyfin]}
|
||||||
|
*/
|
||||||
const currentServer = cookies.get("currentServer");
|
const [api, createApi, jellyfin] = useApi((state) => [
|
||||||
const serverList = cookies.get("servers");
|
state.api,
|
||||||
let currentServerIp = "";
|
state.createApi,
|
||||||
serverList.map((item, index) => {
|
state.jellyfin,
|
||||||
currentServerIp = item[currentServer];
|
]);
|
||||||
// console.log(item);
|
|
||||||
});
|
|
||||||
|
|
||||||
const createServerListRender = async () => {
|
|
||||||
let serverListKeys = [];
|
|
||||||
serverList.map((item, index) => {
|
|
||||||
serverListKeys.push(Object.keys(item));
|
|
||||||
// for (let item in servers) {
|
|
||||||
// if (item != "currentServer") {
|
|
||||||
// setServerList([...serverList, JSON.parse(servers[item])]);
|
|
||||||
// serverList.push(JSON.parse(servers[item]));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
return serverListKeys;
|
|
||||||
// console.log(serverListRender);
|
|
||||||
// localStorage.setItem("servers", serverList);
|
|
||||||
};
|
|
||||||
|
|
||||||
const ServerList = (props) => {
|
|
||||||
const startRender = props.startRender;
|
|
||||||
if (startRender) {
|
|
||||||
return serverList.map((item, index) => {
|
|
||||||
let serverIndex = serverListRender[index];
|
|
||||||
let itm = item[serverIndex];
|
|
||||||
console.log(itm.serverAddress);
|
|
||||||
console.log("serverIndex : ", serverIndex);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={index}
|
|
||||||
className="server"
|
|
||||||
style={{ color: "white" }}
|
|
||||||
>
|
|
||||||
{/* <Typography></Typography> */}
|
|
||||||
hello {itm.serverAddress} This is WIP
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
} else if (!startRender) {
|
|
||||||
return <h1>Hfjsi</h1>;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// const serverList = createServerList();
|
|
||||||
useEffect(() => {
|
|
||||||
createServerListRender().then((serverListKeys) => {
|
|
||||||
console.log("ServerListKeys : ", serverListKeys);
|
|
||||||
setServerListRender(serverListKeys);
|
|
||||||
setRenderServerList(true);
|
|
||||||
});
|
|
||||||
// console.log(serverList);
|
|
||||||
}, []);
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Container maxWidth="md" className="centered">
|
|
||||||
<Typography color="textPrimary" variant="h3">
|
|
||||||
Select Server:
|
|
||||||
</Typography>
|
|
||||||
<div className="serverList">
|
|
||||||
<ServerList
|
|
||||||
startRender={renderServerList}
|
|
||||||
></ServerList>
|
|
||||||
{/*
|
|
||||||
{serverList.map((item, index) => {
|
|
||||||
// let serverIndex = serverListRender[index];
|
|
||||||
// let itm = item[serverIndex];
|
|
||||||
// console.log(itm.serverAddress);
|
|
||||||
// console.log("serverIndex : ", serverIndex);
|
|
||||||
return (
|
|
||||||
// <></>
|
|
||||||
<div key={index} className="server">
|
|
||||||
hello{" "}
|
|
||||||
{
|
|
||||||
item[serverListRender[index]]
|
|
||||||
.serverAddress
|
|
||||||
}{" "}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})} */}
|
|
||||||
</div>
|
|
||||||
</Container>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
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 { enqueueSnackbar } = useSnackbar();
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const [loading, setLoading] = useState(false);
|
const checkServer = useMutation({
|
||||||
|
mutationFn: async () => {
|
||||||
const usersAvailable = async () => {};
|
const servers =
|
||||||
const addServer = async () => {
|
await jellyfin.discovery.getRecommendedServerCandidates(
|
||||||
event.emit("create-jellyfin-api", serverIp);
|
serverIp,
|
||||||
let sysInfo = await getSystemApi(window.api).getPublicSystemInfo();
|
);
|
||||||
sysInfo = sysInfo.data;
|
const bestServer = jellyfin.discovery.findBestServer(servers);
|
||||||
|
return bestServer;
|
||||||
// Set Server Config to Tauri store
|
},
|
||||||
sysInfo.Ip = serverIp;
|
onSuccess: (bestServer) => {
|
||||||
setServer(sysInfo);
|
if (bestServer) {
|
||||||
};
|
console.info(bestServer);
|
||||||
const checkServer = async () => {
|
createApi(bestServer.address, null);
|
||||||
setServerCheckState(true);
|
setDefaultServer(bestServer.systemInfo.Id);
|
||||||
try {
|
setServer(bestServer.systemInfo.Id, bestServer);
|
||||||
const result = await axios.get(`${serverIp}/System/Ping`);
|
enqueueSnackbar("Client added successfully", {
|
||||||
if (result.data == "Jellyfin Server") {
|
variant: "success",
|
||||||
event.emit("create-jellyfin-api", serverIp);
|
});
|
||||||
let sysInfo = await getSystemApi(
|
navigate("/login/index");
|
||||||
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");
|
|
||||||
} else {
|
|
||||||
navigate("/login/manual");
|
|
||||||
}
|
}
|
||||||
} else {
|
},
|
||||||
|
onError: (err) => {
|
||||||
|
console.error(err);
|
||||||
|
enqueueSnackbar(`${err}`, { variant: "error" });
|
||||||
|
enqueueSnackbar("Something went wrong", { variant: "error" });
|
||||||
|
},
|
||||||
|
onSettled: (bestServer) => {
|
||||||
|
console.log(bestServer);
|
||||||
|
if (!bestServer) {
|
||||||
enqueueSnackbar(
|
enqueueSnackbar(
|
||||||
"The provided ip address doesn't seem point to a Jellyfin server.",
|
`Provided server address is not a Jellyfin server.`,
|
||||||
{ variant: "error" },
|
{
|
||||||
|
variant: "error",
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
},
|
||||||
enqueueSnackbar("Unable to verfiy server address.", {
|
|
||||||
variant: "error",
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
setServerCheckState(false);
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleAddServer = () => {
|
|
||||||
// setLoading(true);
|
|
||||||
// let data;
|
|
||||||
// fetch(`${serverIp}/System/Ping`, {
|
|
||||||
// body: JSON.stringify(data),
|
|
||||||
// })
|
|
||||||
// .then((res) => res.json())
|
|
||||||
// .then((data) => {
|
|
||||||
// if (data == "Jellyfin Server") {
|
|
||||||
// addServer();
|
|
||||||
// setLoading(false);
|
|
||||||
// return true;
|
|
||||||
// } else {
|
|
||||||
// enqueueSnackbar(
|
|
||||||
// "The server address does not seem be a jellyfin server",
|
|
||||||
// { variant: "error" },
|
|
||||||
// );
|
|
||||||
// setLoading(false);
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// .catch((error) => {
|
|
||||||
// setLoading(false);
|
|
||||||
// enqueueSnackbar(
|
|
||||||
// "Unable to verify whether the give address is a valid Jellyfin server",
|
|
||||||
// { variant: "error" },
|
|
||||||
// );
|
|
||||||
// console.error(error);
|
|
||||||
// });
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Container maxWidth="sm" className={"centered serverContainer"}>
|
<LinearProgress
|
||||||
|
sx={{
|
||||||
|
position: "fixed",
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
opacity: checkServer.isPending ? 1 : 0,
|
||||||
|
transition: "opacity 350ms",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Container
|
||||||
|
maxWidth="sm"
|
||||||
|
className={"centered serverContainer"}
|
||||||
|
style={{
|
||||||
|
opacity: checkServer.isPending ? "0.5" : "1",
|
||||||
|
transition: "opacity 350ms",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Grid
|
<Grid
|
||||||
container
|
container
|
||||||
spacing={2}
|
spacing={2}
|
||||||
@@ -245,7 +119,6 @@ export const ServerSetup = (props) => {
|
|||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setServerIp(event.target.value);
|
setServerIp(event.target.value);
|
||||||
}}
|
}}
|
||||||
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%" }}>
|
||||||
@@ -253,18 +126,39 @@ export const ServerSetup = (props) => {
|
|||||||
variant="contained"
|
variant="contained"
|
||||||
sx={{ width: "100%" }}
|
sx={{ width: "100%" }}
|
||||||
size="large"
|
size="large"
|
||||||
loading={checkingServer}
|
loading={checkServer.isPending}
|
||||||
endIcon={
|
endIcon={
|
||||||
<SvgIcon>
|
<SvgIcon>
|
||||||
<path d={mdiChevronRight}></path>
|
<path d={mdiChevronRight}></path>
|
||||||
</SvgIcon>
|
</SvgIcon>
|
||||||
}
|
}
|
||||||
loadingPosition="end"
|
loadingPosition="end"
|
||||||
onClick={() => checkServer()}
|
onClick={checkServer.mutate}
|
||||||
>
|
>
|
||||||
Add Server
|
Add Server
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Grid
|
||||||
|
item
|
||||||
|
xl={5}
|
||||||
|
md={6}
|
||||||
|
sx={{
|
||||||
|
width: "100%",
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
gap: 1,
|
||||||
|
opacity: 0.6,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MdiInformation
|
||||||
|
sx={{
|
||||||
|
color: yellow[700],
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
Example: https://demo.jellyfin.org/stable
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Container>
|
</Container>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -0,0 +1,197 @@
|
|||||||
|
/** @format */
|
||||||
|
import React, { useState } from "react";
|
||||||
|
|
||||||
|
import Typography from "@mui/material/Typography";
|
||||||
|
import Paper from "@mui/material/Paper";
|
||||||
|
import IconButton from "@mui/material/IconButton";
|
||||||
|
import Chip from "@mui/material/Chip";
|
||||||
|
import { red } from "@mui/material/colors";
|
||||||
|
|
||||||
|
import "./serverList.module.scss";
|
||||||
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||||
|
import {
|
||||||
|
delServer,
|
||||||
|
getAllServer,
|
||||||
|
getDefaultServer,
|
||||||
|
setDefaultServer,
|
||||||
|
} from "../../../utils/storage/servers";
|
||||||
|
import { AppBarBackOnly } from "../../../components/appBar/backOnly";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { useSnackbar } from "notistack";
|
||||||
|
import { delUser } from "../../../utils/storage/user";
|
||||||
|
|
||||||
|
import { relaunch } from "@tauri-apps/api/process";
|
||||||
|
|
||||||
|
const ServerList = () => {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const [serverState, setServerState] = useState(null);
|
||||||
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
|
const servers = useQuery({
|
||||||
|
queryKey: ["servers-list"],
|
||||||
|
queryFn: async () => await getAllServer(),
|
||||||
|
});
|
||||||
|
const defaultServer = useQuery({
|
||||||
|
queryKey: ["default-server"],
|
||||||
|
queryFn: async () => await getDefaultServer(),
|
||||||
|
});
|
||||||
|
const handleServerChange = useMutation({
|
||||||
|
mutationFn: async () => {
|
||||||
|
await delUser();
|
||||||
|
await setDefaultServer(serverState);
|
||||||
|
},
|
||||||
|
onSuccess: async () => {
|
||||||
|
await relaunch();
|
||||||
|
},
|
||||||
|
onError: (error) => {
|
||||||
|
console.error(error);
|
||||||
|
enqueueSnackbar("Error changing the server", {
|
||||||
|
variant: "error",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleDelete = (serverId) => {
|
||||||
|
let tempList = servers.data.filter(
|
||||||
|
(item) => item[0] != defaultServer.data && item[0] != serverId,
|
||||||
|
);
|
||||||
|
delServer(serverId).then(async () => {
|
||||||
|
// console.log(serverId);
|
||||||
|
await delUser();
|
||||||
|
if (serverId == defaultServer.data) {
|
||||||
|
if (tempList.length > 0) {
|
||||||
|
setDefaultServer(tempList[0][0]);
|
||||||
|
} else {
|
||||||
|
navigate("/setup/server");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
servers.refetch();
|
||||||
|
defaultServer.refetch();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="server-list">
|
||||||
|
<AppBarBackOnly />
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
width: "40vw",
|
||||||
|
alignItems: "center",
|
||||||
|
marginBottom: "2em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Typography variant="h3" fontWeight={200}>
|
||||||
|
Servers
|
||||||
|
</Typography>
|
||||||
|
<IconButton
|
||||||
|
style={{
|
||||||
|
fontSize: "1.64em",
|
||||||
|
}}
|
||||||
|
onClick={() => navigate("/setup/server")}
|
||||||
|
>
|
||||||
|
<div className="material-symbols-rounded">add</div>
|
||||||
|
</IconButton>
|
||||||
|
</div>
|
||||||
|
<Paper className="server-list-container">
|
||||||
|
{servers.isSuccess &&
|
||||||
|
servers.data.map((server, index) => (
|
||||||
|
<div key={index} className="server-list-item">
|
||||||
|
<div className="material-symbols-rounded server-list-item-icon">
|
||||||
|
dns
|
||||||
|
</div>
|
||||||
|
<div className="server-list-item-info">
|
||||||
|
<Typography
|
||||||
|
variant="h6"
|
||||||
|
fontWeight={400}
|
||||||
|
sx={{
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{server[1].systemInfo.ServerName}
|
||||||
|
{server[0] ==
|
||||||
|
defaultServer.data && (
|
||||||
|
<Chip
|
||||||
|
label={
|
||||||
|
<Typography
|
||||||
|
variant="caption"
|
||||||
|
fontWeight={
|
||||||
|
600
|
||||||
|
}
|
||||||
|
fontFamily="JetBrains Mono Variable"
|
||||||
|
>
|
||||||
|
Current
|
||||||
|
</Typography>
|
||||||
|
}
|
||||||
|
color="info"
|
||||||
|
sx={{
|
||||||
|
ml: 2,
|
||||||
|
width: "5.4em",
|
||||||
|
}}
|
||||||
|
size="medium"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Typography>
|
||||||
|
<Typography
|
||||||
|
variant="subtitle1"
|
||||||
|
style={{
|
||||||
|
opacity: 0.7,
|
||||||
|
}}
|
||||||
|
fontWeight={300}
|
||||||
|
>
|
||||||
|
{server[1].address}
|
||||||
|
</Typography>
|
||||||
|
<Typography
|
||||||
|
variant="subtitle2"
|
||||||
|
style={{
|
||||||
|
opacity: 0.5,
|
||||||
|
}}
|
||||||
|
fontWeight={300}
|
||||||
|
>
|
||||||
|
Version:{" "}
|
||||||
|
{server[1].systemInfo.Version}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
<div className="server-list-item-buttons">
|
||||||
|
<IconButton
|
||||||
|
style={{
|
||||||
|
fontSize: "1.64em",
|
||||||
|
}}
|
||||||
|
onClick={() => {
|
||||||
|
setServerState(server[0]);
|
||||||
|
handleServerChange.mutate();
|
||||||
|
}}
|
||||||
|
disabled={
|
||||||
|
handleServerChange.isPending
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div className="material-symbols-rounded">
|
||||||
|
start
|
||||||
|
</div>
|
||||||
|
</IconButton>
|
||||||
|
<IconButton
|
||||||
|
style={{
|
||||||
|
fontSize: "1.64em",
|
||||||
|
|
||||||
|
color: red[400],
|
||||||
|
}}
|
||||||
|
disabled={
|
||||||
|
handleServerChange.isPending
|
||||||
|
}
|
||||||
|
onClick={() => {
|
||||||
|
handleDelete(server[0]);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className="material-symbols-rounded">
|
||||||
|
delete_forever
|
||||||
|
</div>
|
||||||
|
</IconButton>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</Paper>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default ServerList;
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
.server-list {
|
||||||
|
position: absolute;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
&-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 40vw;
|
||||||
|
padding: 1.2em;
|
||||||
|
border-radius: 20px !important;
|
||||||
|
max-height: 46vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
&-item {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 3.4em 1fr auto;
|
||||||
|
justify-items: start;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.8em;
|
||||||
|
&-icon {
|
||||||
|
font-size: 3.4em !important;
|
||||||
|
}
|
||||||
|
&-info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
// width: 100%;
|
||||||
|
}
|
||||||
|
&-buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: 0.5em;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
border-bottom: 1.2px solid rgb(255 255 255 / 0.1);
|
||||||
|
|
||||||
|
$spacing: 0.75em;
|
||||||
|
|
||||||
|
padding-bottom: $spacing;
|
||||||
|
margin-bottom: $spacing;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,7 +38,7 @@ body {
|
|||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: overlay;
|
overflow-y: auto;
|
||||||
overscroll-behavior: none;
|
overscroll-behavior: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ body {
|
|||||||
top: -100px;
|
top: -100px;
|
||||||
left: -100px;
|
left: -100px;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
filter: blur(100px) saturate(120%) contrast(90%);
|
filter: blur(120px) saturate(130%) contrast(140%);
|
||||||
&-container {
|
&-container {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
@@ -133,3 +133,37 @@ h1 {
|
|||||||
.empty {
|
.empty {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.MuiChip-label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.material-symbols-rounded {
|
||||||
|
font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 25, "opsz" 40;
|
||||||
|
font-size: 1.1em;
|
||||||
|
transition: all $transition-time-default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.audio-playing .scrollY {
|
||||||
|
padding-bottom: 9em !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.audio-playing .scrollY.library {
|
||||||
|
padding-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.audio-playing .library-items {
|
||||||
|
padding-bottom: 9em !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.library-items,
|
||||||
|
.scrollY {
|
||||||
|
transition: all $transition-time-default !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Normalize listItemIcons for material symbols
|
||||||
|
.MuiListItemIcon-root {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
@@ -6,28 +6,65 @@ const servers = new Store(".servers.dat");
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set server in .servers.dat
|
* Set server in .servers.dat
|
||||||
* @param {object} data - Server info
|
* @param {string} serverId
|
||||||
|
* @param {object} serverInfo
|
||||||
*/
|
*/
|
||||||
const setServer = async (data) => {
|
export const setServer = async (serverId, serverInfo) => {
|
||||||
let server = servers.set("server", data);
|
servers.set(serverId, serverInfo);
|
||||||
await servers.save();
|
await servers.save();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Server list
|
* Set default server
|
||||||
|
* @param {string} serverId
|
||||||
|
*/
|
||||||
|
export const setDefaultServer = async (serverId) => {
|
||||||
|
servers.set("defaultServer", serverId);
|
||||||
|
await servers.save();
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a Server
|
||||||
* @returns {object} server
|
* @returns {object} server
|
||||||
*/
|
*/
|
||||||
const getServer = async () => {
|
export const getServer = async (serverId) => {
|
||||||
let server = await servers.get("server");
|
let server = await servers.get(serverId);
|
||||||
|
return server;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all Servers
|
||||||
|
*/
|
||||||
|
export const getAllServer = async () => {
|
||||||
|
let server = await servers.entries();
|
||||||
|
// remove default server field from this result
|
||||||
|
server = server.filter((item) => item[0] != "defaultServer");
|
||||||
|
return server;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get default server
|
||||||
|
*/
|
||||||
|
export const getDefaultServer = async () => {
|
||||||
|
let server = await servers.get("defaultServer");
|
||||||
return server;
|
return server;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the given server from client storage
|
* Delete the given server from client storage
|
||||||
|
* @param {string} serverId
|
||||||
*/
|
*/
|
||||||
const delServer = async () => {
|
export const delServer = async (serverId) => {
|
||||||
await servers.delete("server");
|
await servers.delete(serverId);
|
||||||
await servers.save();
|
await servers.save();
|
||||||
};
|
};
|
||||||
|
|
||||||
export { setServer, getServer, delServer };
|
/**
|
||||||
|
* Delete the all servers from client storage
|
||||||
|
*/
|
||||||
|
export const delAllServer = async () => {
|
||||||
|
await servers.clear();
|
||||||
|
// remove the default server
|
||||||
|
await setDefaultServer(null);
|
||||||
|
await servers.save();
|
||||||
|
};
|
||||||
@@ -31,5 +31,6 @@ const getUser = async () => {
|
|||||||
*/
|
*/
|
||||||
const delUser = async () => {
|
const delUser = async () => {
|
||||||
await user.clear();
|
await user.clear();
|
||||||
|
await user.save();
|
||||||
};
|
};
|
||||||
export { saveUser, getUser, delUser };
|
export { saveUser, getUser, delUser };
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
/** @format */
|
||||||
|
import { create } from "zustand";
|
||||||
|
import { Api, Jellyfin } from "@jellyfin/sdk";
|
||||||
|
import { version as appVer } from "../../../package.json";
|
||||||
|
|
||||||
|
// Initial custom axios client to use tauri's http module
|
||||||
|
import axios from "axios";
|
||||||
|
import axiosTauriApiAdapter from "axios-tauri-api-adapter";
|
||||||
|
import { v4 as uuidv4 } from "uuid";
|
||||||
|
|
||||||
|
export const axiosClient = axios.create({
|
||||||
|
adapter: axiosTauriApiAdapter,
|
||||||
|
headers: { "Access-Control-Allow-Origin": "*" },
|
||||||
|
timeout: 60000,
|
||||||
|
});
|
||||||
|
|
||||||
|
const deviceId = localStorage.getItem("deviceId");
|
||||||
|
|
||||||
|
if (!deviceId) {
|
||||||
|
localStorage.setItem("deviceId", uuidv4());
|
||||||
|
}
|
||||||
|
|
||||||
|
const jellyfin = new Jellyfin({
|
||||||
|
clientInfo: {
|
||||||
|
name: "JellyPlayer",
|
||||||
|
version: appVer,
|
||||||
|
},
|
||||||
|
deviceInfo: {
|
||||||
|
name: "JellyPlayer",
|
||||||
|
id: deviceId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {import("@jellyfin/sdk").Api} Api
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const useApi = create((set) => ({
|
||||||
|
/**
|
||||||
|
* @type {Api}
|
||||||
|
*/
|
||||||
|
api: null,
|
||||||
|
deviceId: localStorage.getItem("deviceId"),
|
||||||
|
jellyfin: jellyfin,
|
||||||
|
createApi: (serverAddress, accessToken) =>
|
||||||
|
set((state) => ({
|
||||||
|
...state,
|
||||||
|
api: jellyfin.createApi(serverAddress, accessToken, axiosClient),
|
||||||
|
})),
|
||||||
|
}));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create api
|
||||||
|
* @param {string} serverAddress
|
||||||
|
* @param {string} accessToken
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const createApi = (serverAddress, accessToken) =>
|
||||||
|
useApi.setState((state) => ({
|
||||||
|
...state,
|
||||||
|
api: jellyfin.createApi(serverAddress, accessToken, axiosClient),
|
||||||
|
}));
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
import { create } from "zustand";
|
||||||
|
import { getAllServer, getDefaultServer, getServer } from "../storage/servers";
|
||||||
|
import { getUser } from "../storage/user";
|
||||||
|
import { version } from "../../../package.json";
|
||||||
|
/**
|
||||||
|
* Central Store controls the base state required by the app
|
||||||
|
*/
|
||||||
|
export const useCentralStore = create(() => ({
|
||||||
|
defaultServerOnDisk: async () => await getDefaultServer(),
|
||||||
|
defaultServerInfoOnDisk: async () => {
|
||||||
|
let a = await getDefaultServer();
|
||||||
|
return await getServer(a);
|
||||||
|
},
|
||||||
|
allServersOnDisk: async () => getAllServer(),
|
||||||
|
userOnDisk: async () => getUser(),
|
||||||
|
/** This is the initial route that app goes to just after app startups */
|
||||||
|
initialRoute: null,
|
||||||
|
clientVersion: version,
|
||||||
|
}));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets app inital route
|
||||||
|
* @param {string} route
|
||||||
|
*/
|
||||||
|
export const setInitialRoute = (route) => {
|
||||||
|
useCentralStore.setState((state) => ({ ...state, initialRoute: route }));
|
||||||
|
};
|
||||||