Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e81f4f6c56 | ||
|
|
fea68f8cab | ||
|
|
ce4b635d78 | ||
|
|
83ebd5de7e | ||
|
|
3f44e5fc96 | ||
|
|
39ad113573 | ||
|
|
9ff7482aea | ||
|
|
36e3d2a7cb | ||
|
|
691d5e0157 | ||
|
|
94986db688 | ||
|
|
9bf0b25662 | ||
|
|
42ca912ca7 | ||
|
|
6ac3383f6e | ||
|
|
922d956565 | ||
|
|
ca527548d1 | ||
|
|
e16a6c2415 | ||
|
|
c60b1e416e | ||
|
|
df7994b4b2 | ||
|
|
03e72d81da | ||
|
|
c8a7f8a632 | ||
|
|
d9644f325c | ||
|
|
38dde2a63d | ||
|
|
8aef2fc22d | ||
|
|
458890ba35 | ||
|
|
8d9d38fa39 | ||
|
|
957f9b53bb | ||
|
|
02d412a9b6 | ||
|
|
e4ade5659c | ||
|
|
19ff2af29b | ||
|
|
3c058928cb | ||
|
|
25ac859efd | ||
|
|
5b2968b5bf | ||
|
|
6cccd12a41 | ||
|
|
3ea75c8308 | ||
|
|
2ce1cd688d | ||
|
|
756d8d7f4b | ||
|
|
3738d81fab | ||
|
|
9f4c2f990a | ||
|
|
027cf93492 | ||
|
|
092a1c74ab | ||
|
|
fb7c86631d | ||
|
|
7137cbc13e | ||
|
|
989542107f | ||
|
|
97981c7d35 | ||
|
|
797c80b8cd | ||
|
|
377f926fea | ||
|
|
dd4f5bab30 | ||
|
|
e47b7afd15 | ||
|
|
a16523118b | ||
|
|
b2aaed792e | ||
|
|
117ddba9b6 | ||
|
|
1a25bb20cb | ||
|
|
8ba41979e2 | ||
|
|
1bd295e0d4 | ||
|
|
479ae161b1 | ||
|
|
6957641999 | ||
|
|
419c76d81c | ||
|
|
bd5313ebf3 | ||
|
|
16dcff113d | ||
|
|
e2d50addc1 | ||
|
|
2ddaf61399 | ||
|
|
2570c96f31 | ||
|
|
fbe31a190a | ||
|
|
7c1df32117 | ||
|
|
b690ff5b3e | ||
|
|
a04e263ad5 | ||
|
|
0e0833876b | ||
|
|
4d92a059d1 | ||
|
|
5c41bfeca1 | ||
|
|
7df95a05ed | ||
|
|
3911459eed | ||
|
|
b1c0704bac | ||
|
|
9022dc16ab | ||
|
|
a08c51a00c | ||
|
|
ccb2a628cf | ||
|
|
d3708bd83b | ||
|
|
41c4c333d1 | ||
|
|
1d31496854 | ||
|
|
9c4c1191d8 | ||
|
|
ddd6485a0b | ||
|
|
53f042a453 | ||
|
|
a507b0a0c9 | ||
|
|
ed1633fb21 | ||
|
|
cf59815089 | ||
|
|
58dfe935c6 | ||
|
|
aef5629343 | ||
|
|
864219c0fe | ||
|
|
d9a12e24e7 | ||
|
|
fa3b2c7e6b | ||
|
|
0035488770 | ||
|
|
ac565b65fe | ||
|
|
464a3ff5a2 | ||
|
|
e9cd7c4e27 | ||
|
|
a6b377208f | ||
|
|
8ef12225c6 | ||
|
|
ca9cb9e7d6 | ||
|
|
201bc0b092 | ||
|
|
3f92769b86 | ||
|
|
b1d1985a80 | ||
|
|
d73eade38a | ||
|
|
9ad438429f | ||
|
|
0d3b7c855c | ||
|
|
45655b7464 | ||
|
|
dbe719744a | ||
|
|
fadc3f7a70 | ||
|
|
3d12d416f7 | ||
|
|
cfe0361224 | ||
|
|
fd8c6431d5 | ||
|
|
b8dc3828e8 | ||
|
|
909aead056 | ||
|
|
88474b494b | ||
|
|
3833f4d626 | ||
|
|
ef55f13d7b | ||
|
|
3db18e22a4 | ||
|
|
1e93fb1c29 | ||
|
|
18df836cf4 | ||
|
|
2bbe846184 | ||
|
|
50f8e1c0f1 | ||
|
|
fdbe279071 | ||
|
|
90094d9103 | ||
|
|
51647cdd0d | ||
|
|
628f90ef57 | ||
|
|
7cba5a39f6 | ||
|
|
ee524b57c7 | ||
|
|
9aea2e4750 | ||
|
|
c49f8d8c76 | ||
|
|
1158c38575 | ||
|
|
f08a3e8337 | ||
|
|
64cc9fa7ff | ||
|
|
fd2d8a1efd | ||
|
|
0febb68047 | ||
|
|
e51c2261c2 | ||
|
|
537cf61df5 | ||
|
|
62f7a6cd48 | ||
|
|
ee48de0f30 | ||
|
|
272f74473a | ||
|
|
b02b3a95d2 | ||
|
|
d6c7c29b46 | ||
|
|
f12d92f42c | ||
|
|
aebea6a3b2 | ||
|
|
7c19efa448 | ||
|
|
cb0fb0eef8 | ||
|
|
e21a12e36f | ||
|
|
dbc2243dd4 | ||
|
|
4372ecbb4e | ||
|
|
69d0b4558f | ||
|
|
fc685414be | ||
|
|
68a97196d2 | ||
|
|
1c55dd77ef | ||
|
|
112b2babc1 | ||
|
|
3d40912b6f | ||
|
|
8d00739199 | ||
|
|
b66130950b | ||
|
|
5212e2c497 | ||
|
|
221cd4722a | ||
|
|
c851201872 | ||
|
|
12d771c6c7 | ||
|
|
275a05a0a3 | ||
|
|
65205e5c4e | ||
|
|
1a59605e17 | ||
|
|
3782c79464 | ||
|
|
cceb97d0d6 | ||
|
|
2df503c48a | ||
|
|
03323d954e | ||
|
|
6cb5130b08 | ||
|
|
b1ab16220c | ||
|
|
8ca01ccc2b | ||
|
|
81afd14b55 | ||
|
|
95f5cdd481 | ||
|
|
e33b8ff266 | ||
|
|
42af75b79d | ||
|
|
4e71297f02 | ||
|
|
eca1bcb995 | ||
|
|
4f7d58fe1d | ||
|
|
23e892f45b | ||
|
|
664293d82b | ||
|
|
1e9438227c | ||
|
|
4604b4f103 | ||
|
|
e62e9384d8 | ||
|
|
301dc3dcc1 | ||
|
|
93b79c5fba | ||
|
|
899fcb0479 | ||
|
|
61230c01bb | ||
|
|
059f391e52 | ||
|
|
c73774a3b2 | ||
|
|
8170c4a2d8 | ||
|
|
29ab3e96c7 | ||
|
|
7388876967 | ||
|
|
e2ae87ef9c | ||
|
|
355bbcdbe3 |
No files matched your search
@@ -0,0 +1,38 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -0,0 +1,19 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "npm" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
commit-message:
|
||||
prefix: "chore(package-update) NPM"
|
||||
- package-ecosystem: "cargo"
|
||||
directory: "/src-tauri"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
commit-message:
|
||||
prefix: "chore(package-update) CARGO"
|
||||
@@ -1,17 +1,19 @@
|
||||

|
||||
|
||||
# :memo: Prerequisites:
|
||||
# 📝 Prerequisites:
|
||||
- Nodejs (≥19.1.0)
|
||||
- Rust (≥1.66.1)
|
||||
- Visual Studio C++ Build tools
|
||||
|
||||
# :warning: Getting started:
|
||||
# ℹ️ Getting started:
|
||||
- Install Nodejs and Rust.
|
||||
> **Note** : Install Rust from https://www.rust-lang.org/learn/get-started
|
||||
- install depencies using npm:
|
||||
```shell
|
||||
npm install
|
||||
```
|
||||
|
||||
# :information_source: Development:
|
||||
# 🛠️ Development:
|
||||
- Running the app:
|
||||
```shell
|
||||
npm run tauri dev
|
||||
@@ -22,5 +24,16 @@
|
||||
```
|
||||
- other commands can be found inside the `"scripts"` inside [package.json](https://github.com/prayag17/JellyPlayer/blob/main/package.json)
|
||||
|
||||
# :sos: Help Wanted:
|
||||
- Home sections containing latest media.
|
||||
# 💻 Contribution:
|
||||
- Checkout `issues` to see currently worked on features and bugs
|
||||
- Add features or fix bugs
|
||||
- Create a pull request
|
||||
|
||||
# 📃 Roadmap:
|
||||
- Checkout [GitHub Project](https://github.com/users/prayag17/projects/3)
|
||||
> **Note** : There is no current due date for alpha 1 release
|
||||
|
||||
# 🎊 Special thanks to:
|
||||
- [@ferferga](https://github.com/ferferga) for helping in development behind the scenes.
|
||||
- All contributors of [jellyfin/jellyfin-vue](https://github.com/jellyfin/jellyfin-vue).
|
||||
- And also [@jellyfin](https://github.com/jellyfin/) for creating the main service
|
||||
|
Before Width: | Height: | Size: 393 KiB |
@@ -10,7 +10,13 @@
|
||||
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<svg style="width:0;height:0;position:absolute;" aria-hidden="true" focusable="false">
|
||||
<linearGradient id="clr-gradient-default" x2="1" y2="1">
|
||||
<stop offset="0%" stop-color="hsl(337, 96%, 56%)" />
|
||||
<stop offset="100%" stop-color="hsl(273, 100%, 36%)" />
|
||||
</linearGradient>
|
||||
</svg>
|
||||
<script type="module" src="/src/main.jsx"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jellyplayer",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"version": "1.0.0-alpha0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -10,37 +10,41 @@
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.10.5",
|
||||
"@emotion/react": "^11.11.1",
|
||||
"@emotion/styled": "^11.10.5",
|
||||
"@fontsource/open-sans": "^4.5.13",
|
||||
"@jellyfin/sdk": "^0.7.0",
|
||||
"@mdi/js": "^7.1.96",
|
||||
"@mui/lab": "^5.0.0-alpha.110",
|
||||
"@mui/material": "^5.10.15",
|
||||
"@fontsource/open-sans": "^5.0.3",
|
||||
"@jellyfin/sdk": "^0.8.2",
|
||||
"@mdi/js": "^7.2.96",
|
||||
"@mui/lab": "^5.0.0-alpha.134",
|
||||
"@mui/material": "^5.13.0",
|
||||
"@tanstack/react-query": "^4.26.1",
|
||||
"@tanstack/react-query-devtools": "^4.29.19",
|
||||
"@tauri-apps/api": "^1.4.0",
|
||||
"axios": "^1.4.0",
|
||||
"blurhash": "^2.0.5",
|
||||
"events": "^3.3.0",
|
||||
"framer-motion": "^7.10.2",
|
||||
"localforage": "^1.10.0",
|
||||
"match-sorter": "^6.3.1",
|
||||
"mdi-material-ui": "^7.6.0",
|
||||
"notistack": "^2.0.8",
|
||||
"framer-motion": "^10.12.10",
|
||||
"notistack": "^3.0.1",
|
||||
"react": "^18.2.0",
|
||||
"react-cookie": "^4.1.1",
|
||||
"react-blurhash": "^0.3.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-konami-code": "^2.3.0",
|
||||
"react-material-ui-carousel": "^3.4.2",
|
||||
"react-multi-carousel": "^2.8.2",
|
||||
"react-router-dom": "^6.4.3",
|
||||
"sort-by": "^1.2.0",
|
||||
"react-multi-carousel": "^2.8.3",
|
||||
"react-player": "^2.12.0",
|
||||
"react-router-dom": "^6.14.0",
|
||||
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
|
||||
"uuid": "^9.0.0",
|
||||
"vite-plugin-svgr": "^2.2.2"
|
||||
"vite-plugin-svgr": "^3.2.0",
|
||||
"zustand": "^4.3.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "^1.2.2",
|
||||
"@types/react": "^18.0.24",
|
||||
"@types/react-dom": "^18.0.8",
|
||||
"@vitejs/plugin-react": "^2.2.0",
|
||||
"sass": "^1.56.1",
|
||||
"vite": "^3.2.3"
|
||||
"@tauri-apps/cli": "^1.3.1",
|
||||
"@types/react": "^18.2.11",
|
||||
"@types/react-dom": "^18.2.6",
|
||||
"@vitejs/plugin-react": "^4.0.0",
|
||||
"sass": "^1.63.3",
|
||||
"vite": "^4.3.1"
|
||||
},
|
||||
"license": "GPL-3.0-only"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 289 KiB After Width: | Height: | Size: 289 KiB |
|
After Width: | Height: | Size: 71 KiB |
@@ -0,0 +1,57 @@
|
||||
<svg width="1197" height="247" viewBox="0 0 1197 247" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g clip-path="url(#clip0_504_8)">
|
||||
<path d="M169.982 114.384C171.569 115.293 172.888 116.605 173.805 118.187C174.722 119.769 175.205 121.566 175.205 123.395C175.205 125.224 174.722 127.021 173.805 128.603C172.888 130.185 171.569 131.497 169.982 132.406L87.6225 180.207C80.8918 184.117 71.6631 179.65 71.6631 171.196V123.395V75.5942C71.6631 67.1397 80.8918 62.673 87.6225 66.583L128.802 90.4834L169.982 114.384Z" fill="url(#pattern0)"/>
|
||||
<g filter="url(#filter0_d_504_8)">
|
||||
<path d="M71.6631 123.395V171.196C71.6631 179.65 80.8918 184.117 87.6225 180.207L169.982 132.406C171.569 131.497 172.888 130.185 173.805 128.603C174.722 127.021 175.205 125.224 175.205 123.395C175.205 121.566 174.722 119.769 173.805 118.187C172.888 116.605 171.569 115.293 169.982 114.384L128.802 90.4834M71.6631 123.395V75.5942C71.6631 67.1397 80.8918 62.673 87.6225 66.583L128.802 90.4834M71.6631 123.395L128.802 90.4834" stroke="white" stroke-width="10" shape-rendering="crispEdges"/>
|
||||
</g>
|
||||
<g clip-path="url(#clip1_504_8)">
|
||||
<path d="M268.49 132.788C263.093 132.788 258.076 131.572 253.438 129.139C248.801 126.63 245 123.209 242.035 118.876C239.071 114.543 237.322 109.754 236.79 104.509H241.009C241.541 108.994 243.1 113.099 245.684 116.824C248.269 120.473 251.538 123.362 255.491 125.49C259.52 127.543 263.853 128.569 268.49 128.569C273.584 128.569 278.259 127.315 282.516 124.806C286.773 122.297 290.156 118.838 292.665 114.429C295.173 110.02 296.428 105.079 296.428 99.6052V55.9316H260.85V51.7125H300.533V99.6052C300.533 105.839 299.089 111.502 296.2 116.596C293.387 121.613 289.51 125.566 284.569 128.455C279.703 131.344 274.344 132.788 268.49 132.788Z" fill="white"/>
|
||||
<path d="M326.901 51.7125H382.775V55.9316H331.12V88.0881H376.048V92.3073H331.12V126.858H382.775V131.078H326.901V51.7125Z" fill="white"/>
|
||||
<path d="M414.16 131.078V51.7125H418.38V126.858H473.684V131.078H414.16Z" fill="white"/>
|
||||
<path d="M498.569 131.078V51.7125H502.789V126.858H558.093V131.078H498.569Z" fill="white"/>
|
||||
<path d="M579.444 51.7125L607.609 94.1318L635.546 51.7125H640.564L609.662 98.5789V131.078H605.442V98.5789L574.426 51.7125H579.444Z" fill="white"/>
|
||||
<path d="M669.782 131.078H665.563V51.7125H697.492C702.813 51.7125 707.716 52.8528 712.201 55.1334C716.763 57.414 720.374 60.6448 723.034 64.826C725.695 69.0071 727.025 73.8344 727.025 79.3078C727.025 84.5532 725.657 89.3805 722.92 93.7897C720.26 98.1988 716.611 101.582 711.973 103.938C707.944 105.991 703.117 107.017 697.492 107.017H669.782V131.078ZM669.782 102.798H697.492C702.357 102.798 706.348 102.038 709.465 100.517C713.494 98.6169 716.725 95.7662 719.157 91.9652C721.59 88.1642 722.806 83.945 722.806 79.3078C722.806 74.7466 721.59 70.5655 719.157 66.7645C716.725 62.9635 713.456 60.1127 709.351 58.2122C706.234 56.6918 702.281 55.9316 697.492 55.9316H669.782V102.798Z" fill="white"/>
|
||||
<path d="M751.797 131.078V51.7125H756.016V126.858H811.32V131.078H751.797Z" fill="white"/>
|
||||
<path d="M898.124 131.078H823.32L860.722 50.002L898.124 131.078Z" fill="url(#paint0_linear_504_8)"/>
|
||||
<path d="M917.08 51.7125L945.245 94.1318L973.183 51.7125H978.2L947.298 98.5789V131.078H943.079V98.5789L912.062 51.7125H917.08Z" fill="white"/>
|
||||
<path d="M1002.17 51.7125H1058.05V55.9316H1006.39V88.0881H1051.32V92.3073H1006.39V126.858H1058.05V131.078H1002.17V51.7125Z" fill="white"/>
|
||||
<path d="M1131.17 54.3352C1135.73 56.4637 1139.3 59.6186 1141.89 63.7997C1144.55 67.9808 1145.88 72.618 1145.88 77.7114C1145.88 83.641 1144.05 88.9624 1140.4 93.6756C1136.83 98.3129 1131.24 102.013 1125.62 103.534L1085.78 51.7125H1116C1119.35 51.7125 1122.2 51.9405 1124.55 52.3966C1126.99 52.7767 1129.19 53.4229 1131.17 54.3352Z" fill="url(#paint1_linear_504_8)"/>
|
||||
<path d="M1146.79 131.078L1125.62 103.534H1085.78V131.078H1146.79Z" fill="url(#paint2_linear_504_8)"/>
|
||||
<path d="M256.77 180.696H242.154L238.95 187.788H236.97L248.562 162.588H250.398L261.99 187.788H260.01L256.77 180.696ZM256.086 179.148L249.462 164.604L242.874 179.148H256.086ZM303.243 187.788L303.207 166.224L292.659 184.44H291.759L281.211 166.296V187.788H279.411V162.588H280.959L292.227 182.064L303.495 162.588H305.007L305.043 187.788H303.243ZM326.321 187.968C323.849 187.968 321.617 187.416 319.625 186.312C317.633 185.184 316.061 183.648 314.909 181.704C313.781 179.76 313.217 177.588 313.217 175.188C313.217 172.788 313.781 170.616 314.909 168.672C316.061 166.728 317.633 165.204 319.625 164.1C321.617 162.972 323.849 162.408 326.321 162.408C328.793 162.408 331.025 162.96 333.017 164.064C335.009 165.168 336.569 166.692 337.697 168.636C338.849 170.58 339.425 172.764 339.425 175.188C339.425 177.612 338.849 179.796 337.697 181.74C336.569 183.684 335.009 185.208 333.017 186.312C331.025 187.416 328.793 187.968 326.321 187.968ZM326.321 186.276C328.433 186.276 330.341 185.796 332.045 184.836C333.749 183.876 335.093 182.556 336.077 180.876C337.061 179.172 337.553 177.276 337.553 175.188C337.553 173.1 337.061 171.216 336.077 169.536C335.093 167.832 333.749 166.5 332.045 165.54C330.341 164.58 328.433 164.1 326.321 164.1C324.209 164.1 322.289 164.58 320.561 165.54C318.857 166.5 317.513 167.832 316.529 169.536C315.545 171.216 315.053 173.1 315.053 175.188C315.053 177.276 315.545 179.172 316.529 180.876C317.513 182.556 318.857 183.876 320.561 184.836C322.289 185.796 324.209 186.276 326.321 186.276ZM347.593 162.588H357.565C360.181 162.588 362.497 163.128 364.513 164.208C366.553 165.288 368.137 166.788 369.265 168.708C370.393 170.604 370.957 172.764 370.957 175.188C370.957 177.612 370.393 179.784 369.265 181.704C368.137 183.6 366.553 185.088 364.513 186.168C362.497 187.248 360.181 187.788 357.565 187.788H347.593V162.588ZM357.421 186.132C359.749 186.132 361.801 185.676 363.577 184.764C365.353 183.828 366.721 182.532 367.681 180.876C368.641 179.22 369.121 177.324 369.121 175.188C369.121 173.052 368.641 171.156 367.681 169.5C366.721 167.844 365.353 166.56 363.577 165.648C361.801 164.712 359.749 164.244 357.421 164.244H349.429V186.132H357.421ZM396.523 186.132V187.788H379.135V162.588H395.983V164.244H380.971V174.18H394.399V175.8H380.971V186.132H396.523ZM422.513 187.788L416.501 179.364C415.613 179.484 414.797 179.544 414.053 179.544H406.853V187.788H405.017V162.588H414.053C417.221 162.588 419.705 163.344 421.505 164.856C423.305 166.344 424.205 168.42 424.205 171.084C424.205 173.076 423.689 174.756 422.657 176.124C421.649 177.468 420.197 178.416 418.301 178.968L424.601 187.788H422.513ZM414.053 177.924C416.741 177.924 418.793 177.336 420.209 176.16C421.625 174.96 422.333 173.268 422.333 171.084C422.333 168.9 421.625 167.22 420.209 166.044C418.793 164.844 416.741 164.244 414.053 164.244H406.853V177.924H414.053ZM453.247 162.588V187.788H451.735L434.563 165.9V187.788H432.727V162.588H434.275L451.411 184.476V162.588H453.247ZM477.162 187.968C475.794 187.968 474.51 187.656 473.31 187.032C472.134 186.384 471.186 185.496 470.466 184.368L471.582 183.144C472.278 184.176 473.094 184.968 474.03 185.52C474.99 186.048 476.034 186.312 477.162 186.312C478.842 186.312 480.09 185.832 480.906 184.872C481.746 183.888 482.166 182.388 482.166 180.372V164.244H472.878V162.588H484.002V180.372C484.002 182.892 483.426 184.788 482.274 186.06C481.122 187.332 479.418 187.968 477.162 187.968ZM511.765 186.132V187.788H494.377V162.588H511.225V164.244H496.213V174.18H509.641V175.8H496.213V186.132H511.765ZM520.259 162.588H522.095V186.132H536.603V187.788H520.259V162.588ZM543.118 162.588H544.954V186.132H559.462V187.788H543.118V162.588ZM571.081 179.112V187.788H569.245V179.112L559.093 162.588H561.109L570.217 177.42L579.325 162.588H581.233L571.081 179.112ZM588.843 164.244V175.008H602.271V176.664H588.843V187.788H587.007V162.588H603.855V164.244H588.843ZM611.518 162.588H613.354V187.788H611.518V162.588ZM644.455 162.588V187.788H642.943L625.771 165.9V187.788H623.935V162.588H625.483L642.619 184.476V162.588H644.455ZM676.758 187.968C674.286 187.968 672.054 187.416 670.062 186.312C668.094 185.208 666.534 183.684 665.382 181.74C664.254 179.796 663.69 177.612 663.69 175.188C663.69 172.764 664.254 170.58 665.382 168.636C666.534 166.692 668.094 165.168 670.062 164.064C672.054 162.96 674.286 162.408 676.758 162.408C678.582 162.408 680.262 162.708 681.798 163.308C683.334 163.884 684.642 164.748 685.722 165.9L684.57 167.088C682.554 165.096 679.974 164.1 676.83 164.1C674.718 164.1 672.798 164.58 671.07 165.54C669.342 166.5 667.986 167.832 667.002 169.536C666.018 171.216 665.526 173.1 665.526 175.188C665.526 177.276 666.018 179.172 667.002 180.876C667.986 182.556 669.342 183.876 671.07 184.836C672.798 185.796 674.718 186.276 676.83 186.276C679.95 186.276 682.53 185.268 684.57 183.252L685.722 184.44C684.642 185.592 683.322 186.468 681.762 187.068C680.226 187.668 678.558 187.968 676.758 187.968ZM693.671 162.588H695.507V186.132H710.015V187.788H693.671V162.588ZM716.53 162.588H718.366V187.788H716.53V162.Line truncated
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
|
||||
<use xlink:href="#image0_504_8" transform="matrix(0 -0.000244141 0.000274658 0 -0.0625001 1)"/>
|
||||
</pattern>
|
||||
<filter id="filter0_d_504_8" x="-21.3369" y="-25.8237" width="293.542" height="306.437" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset dx="2" dy="4"/>
|
||||
<feGaussianBlur stdDeviation="45"/>
|
||||
<feComposite in2="hardAlpha" operator="out"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0"/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_504_8"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_504_8" result="shape"/>
|
||||
</filter>
|
||||
<linearGradient id="paint0_linear_504_8" x1="879.722" y1="91.7373" x2="824.111" y2="130.497" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FB2576"/>
|
||||
<stop offset="1" stop-color="#150050"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_504_8" x1="1138.4" y1="59.7188" x2="1086.16" y2="130.497" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FB2576"/>
|
||||
<stop offset="1" stop-color="#150050"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_504_8" x1="1138.4" y1="59.7188" x2="1086.16" y2="130.497" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FB2576"/>
|
||||
<stop offset="1" stop-color="#150050"/>
|
||||
</linearGradient>
|
||||
<clipPath id="clip0_504_8">
|
||||
<rect width="1196.79" height="246.79" fill="white"/>
|
||||
</clipPath>
|
||||
<clipPath id="clip1_504_8">
|
||||
<rect width="910" height="146.786" fill="white" transform="translate(236.79 50.002)"/>
|
||||
</clipPath>
|
||||
<image id="image0_504_8" width="4096" height="4096" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAEAAAABAACAYAAADyoyQXAAAAAXNSR0IArs4c6QAAIABJREFUeF7s/QmS5DquNIxm3V7I/63jvv0v6556poEiAGJwJ6nIrNPV1nYqU8LgcAxSKETmr//39f/7/fX19fXr+I/5nz2WySD6nh9ED5GRthF5RIbF69scjzK8ormJ5CpeGPuI7AyvqM6af+1F/ub5n/XVWmjWvvUbYUPyjcqgcihPsZx/BuFqhRfUPtrvckwivRzJZ7lFsDD61RSq4mB8Ididyw10Dcpqtbp+IT3t4fJ6esex3RxUOcowV7zOzKHKJst1hb/y90YMKOdIbVb4URtoXc3yv2qf5ext+YyHFc4Zu4wsywdjm5X9SVhY7JH8+YFow/9W7WD6WirT6edmdDQhkR//+O8ve1z+np37MpqjbBSV1dS/X1oR2jxW6THGPtrmOIgzWduJObkiG6NvGmNe4loZdXy/nu0YA+qvlutZ1PXn47mZ+R8RQxtu/zce+/0/okZuOcnqbzsY//n6ksceWSH34HKG6hnB9f/rf8pny6rh5JS5PZmiUb/+6vx4Vff7PPhb4W8wxlo0tXX8arDaaeD6PHR+j3PjxGFm85DPX52oWHb06svmNd15QOwZbkQctppdTm55a+VOj2Kl1wniU9eWz7o3E+Me9KdMr1+L+feRsyCvIceyHwJu4jrNMuddGTxWbjm3t3JuIn6iq5KXxYExxcdYt15N3Z1dcs/JtbHj987gzF6JTS14cUZ5lZmL4o049q5JJVbTdZBPR8ivrjbXPRT92Kwunh0MR8rV4yxjaIOfnCrnbI2HMbnXGuMZkV3/tLZu4TM4ES9rMp0JnhNeQ2P95T4r5eLhMFTPj9/wHSPksF/YtE5uAbV/yWHSqBQm58VkczBXob7/tfyjSLjYcelakslkxT1Tabav4xzKM3U8Xdrjfk4/RzBvc0+fozMRw8nVAzNNMP9RjaHdGc/jlXpgMjUfJ+Kltl5LNI5RyXzSr2YGR+HnFp2xUWWs+Ue7D6lL5F5i7XpUeVjjorK+7/z8lWYfBsTSgfPnfTLyEf08nD7DO3GyTwIsojUs2fMLpLpmaqt+Ood5vqTq+HMJ6KlRCIjPXuyvfgobRVxz0ANgEKN2oyrC9SXB8/karWAIUClMjqtL1OZ63YxFjFYc1me2xub7HMWFcqfx11q1RMsxKonPKdwi+h064tubD3nWeZy1Ri3RcOLXrdomMxGr3kYrN77CMX3uWanjza+u811bcYNc1fG8Rtb4+FcjRuLaK8PHyPrf42GPFRb7v1n+T/l0/H05+LMZ+rPR7836Xi4Ka+b0Xt84L/v9Ms/HcZyM5P6YpHfu24IMN44TeOIqjOF25VPuWquW0NEyTywZ2+zTd1c+cDhgvm8pPHH3ufQvbH3tIYXZPDitZT2uz2OOk1DWFKsbnzEpZSTKX6oe+y9WXv/eAOh4K1vXK2QX8c1e/zeqQuPjdn0cvfz18+evv8Xvt8lT9tEbdRQfwn5Li8UY/n6cuP17MqOf64jE1mQU34fNJ5avr1/3S8uPXuPh5vex+fuy/etWPvi/OOocPHYbb4fMP4ePO/r/XD//+ufy1mxbnH68vVC1vM6HrDrLx2Wh82Tz2DFpfLJCNb+6dptWj0tfQ+zx63edSWs/smmPt8wPNfD/vv5XpCgb1o0eX0YWUQ97vNRZuVk9b47phM3HotOCx5DHIkuPw4Zy5HFij+205eV5xv6MTpSj2pafh1pvrH9PB+UkyhWSr6y/ZvWjWOTx9Xh9C8hMmI2L0ctmyjgF8nmIyGd8IljW9LV2lYM1X9hLkmgPZr3Dzu6ql3bZq/hjrpnInI/qD507Vh/tfUZvBmOV+zdwztp8I76qHmd9ruYNrW+m32Zkq/rI+EHOsXEiNmdk/uKYYQ3T2fmV0YotTBf/6jD6kjnzE53jjv9ZGwAcVSLjs7FKHuNz1gqyIUGvT2ZR34i1ep3gOh/F2I57VjydqAJHO/52Dlourmc0Tq82JZ8ersb8b3cDgM5WW8T/XRsAqLzdF4GIvwvrnWtDysBRsgnAtQHA8bxxZNavf1Ffx48FzrFT7s0SzgXNo4eo557jh78bdC4b15pgTl00otpBFs1fNsfe8yaFX8N3Hh5EpkOFUufC9zf4NHxVmzRUs0HbH6WfI5O11QZYzFOeW4kPz10w0x0QHus7sKYL3IcNEUYUr2MY1/67G87YOzGF67m5DWrXq/Ph1i5/jcvjAbv65q8yxt1m9AwAr5+ea1Jx2zqrG3MwcyYGeVoLTfon8vz4vmZ0CmrFadw6Lol7n5Pc/ylxv8UjsnesznHmaeX4OPSc9IgGePEjDXzOf9ea0++QcP1REtfVFOTPujPZmMrLJoYIlcLkLkxMTaJ2fTnmqFev7ViNopZosaOSFU+dSdxiZnO+ZhlNFKvXtaiuX2OxNmqXmSS4TVTye+sBR/nZDUtQXJ+q0WjqMte+OiZmgtczl7c2d92JtOp48/shXH/tehDn1p7BEdXXQ+5ekPPM2d6Vhd0x74ziT7bFfXrjpHfzstN79UQkw74Dx2iDs8pJj9FkT26qvK36Puwz3/hEeJgYMMzoYkjG84Uefe6D4fRs7sLU2M6es8UVovHvebKGRoZzh+YZWcjN88SwgseUf9tY9XRco+OZVUx5P9dI0XrIY5J+8HqobfL14NtEJwbSiytXO22fYaquEyaT2Rxdq9Fx4llO60jqukDrukaz2j++PpPZyEIdo60mTwNjm/W1X/4dnPut7re4n8ufa/H7Ph0znPwZKJmIPiX7l7nONMcFJ+3mU5jYYG2qZNb88tq8xlRY4Hd1le0c7WostT7x/clULc09x65x257CNDCpy7aWrTVdiUBNsS5uHzxxL0NywXpjYtSNuZ+RjSqlxrKOQ/puP1eL9q8c+ovw7YYHp83bsLeo/jzdXta9NwHwMOm6STYAOAWxDQCkTW/x+nhM891+e3i7q/v4PT8mIjyw3nXadW7PxyL7m0Bt7+JMbQBw+HY2AegbAwibd+BPfM8mAPei+gPP/9yL/MVLwc8mAP+5MI8bAHRGJQd2QwabX7cG1ZwYN0VoNdg8Su5sXi13tn49rNexnm/Z1/b4kDdRBxKfrJe8Rka/v9oGALYRxoHqDVk9dMchNX7dvkvGw6fJ1BdyxG9lMxrcmd9P8RpfVPgcobY8OZRn3Uw6V+/71wMXrXUr58WKchL5nPUhGazqcRbjeryxBQSz1Y6sVXJZHAz/6LyIcpPVAGKbiWO0N2qz85OJq8LK9GDFGzs/PmXvbQ4Q++jcsRMZ7X1Gz5/619E3/H3a5hvxZT2X+as4Xc0bWntZb0b437RdcbbKC2sflWc5Qe2ycj8FB4s7k9/59dCKLUwXfcEkXjqY+YnOccf/bgBw1JvlTP4+nsNfihntVK9cjK8ZeFg8K7mcjrLJxnFqHN7LD5Gulc24vFCN0XgMXwv7b+ttuP3feCzeAOD2ZgfjP89ztHP0PL7FovqHL2eonufsovZbTvMs4nzs/G6qz9gbYoc2ABir2K9pkZ3jRxenXysN4PnM0d0AYHxV0s+9V02d96q2HxyGMa+mRXWoy4pbX3f2fd6kejwzQ+zCqLJ/11jqc9gAoMiPE2kc78jQI3v/IDerGLnvzlRWhwXvlxyf27ymolp4fDmB8xg8DRu3RjK4dfnQdYTkyLtWRZ3v2ROjSlQJsSBfzT9HL6pzVZP5K9VRjAXDpr6Mw6D2dFffv6U1U89Z1ybYk1l/ZRFVnI26oh+jQnEwL/mJQHzkeN7D70H4zKewdS/rFt7j8LDM48M1cEk/xq4/Z2lOq7Myr3/Fg+vnT6bZCmCsoRiZXGA2maWtFZfaI+Y/sulr8zZrjVqi1REqWfE0V9sMIzhSiTXXQm1GFYXry07bhQmfBDXOS6KW63HEsnM9M/rfw5N93SmbeVj8MVeYvpzhtUYt0SJC5t6uPDNXgpHxjkI80rjF8Hira/tcpt/zj1nGpOLYkCqorvurGHpFVp7mcrRi1dPdFe9uXN60/ZUub34Pwaxl6MPqrHGlt+ZpTVsHMG/Lf9LK0oP79yVxfR9Zrl9bryVyRkb9uacJ2k6MisGLZphBXPtHvXZe46ebtbfDCiqFyV24mAygdrNasVWG2rywYtKMFCZbcY9WNTLT0CgrTDq763EyWR1nCdp7KM699YCiw/K3VuNSm+nOeH7jFYXXFJenCNtaTTWrPhYcIS5ZXZvnLM1p9ejX9JGcYzWZ54O943pffpU3ZBrsiGIvzh2IfqIN/BMnLvkT4/xvxvQ3czr7a88MJypJOPyuXNR+awkm8r3WYs+cH066eZ3TqmruOO9bTv2Zk8x3EzNx4Drc817crvw711gFurYDhw9qcbsQYRu+sxB/iV4i6/reT10ymkOef3lswNEqyVGcw+LjlkcVnucXs5j+DjX6a+9eZvuGAoEtswFA76Kx/iRPDWL/95a3GwCcH5HbuY7w0JO6snuvcyNn46LwMSa5OULDK31dfvoZrw40Nr0Y/ZlhdhMAZwOAU/PsA7GI/l7w/+tOjNqA4Obp2Vyg8XYu+L82BThZ+8+9QcA/PSMeZ7a+vJzJfLeftZz10ae4lOucSXndWV6+rS9bTxaz4vKuIRm7rVGNUdeLxJzWor8BwEWEN6ZlUdmLXnYuu0BaPcSOd0kcCz4boP4ldQZL5tfHOUaY+fX4iG4JKu522vIuZJV/VIeJzw5Y79Lv45JjZNSqYom4tNgZzr0+YfWRGkYxonJVD4yjVfON6+c9Xc2FqK68umRld8uv1B/Cg52AMzMomutoDdquQ/Wy3otymeVn1h4zp2Z9MP2P+GDsZdft1XPenF61ic7kqu6yGkLPvRHfim+kNhD+0evrbPxMbnZgyXCuYmFsM7JMLLine truncated
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.9 MiB |
|
After Width: | Height: | Size: 632 KiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 2.8 MiB |
@@ -0,0 +1,97 @@
|
||||
<!-- @format -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main>
|
||||
<img src="./assetsStatic/LogoBig.png" alt="" srcset="">
|
||||
</main>
|
||||
<div class="loading">
|
||||
<div class="indicator"></div>
|
||||
</div>
|
||||
<div class="background"></div>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
overflow: hidden;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: black;
|
||||
}
|
||||
|
||||
.background {
|
||||
position: fixed;
|
||||
z-index: 0;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: calc(100vw + 5em);
|
||||
height: calc(100vh + 5em);
|
||||
background-image: url("./assetsStatic/meshbackground.png");
|
||||
background-size: cover;
|
||||
filter: brightness(0.3);
|
||||
}
|
||||
|
||||
main {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.loading {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
background: hsla(255, 100%, 4%, 0.5);
|
||||
z-index: 1;
|
||||
height: 14px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.indicator {
|
||||
background: hsl(337, 96%, 56%);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
/* transform: scaleX(0.5); */
|
||||
transform-origin: left;
|
||||
animation: loading 1s infinite;
|
||||
}
|
||||
|
||||
@keyframes loading {
|
||||
0% {
|
||||
transform: scaleX(0) translateX(-100%);
|
||||
transform-origin: left;
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scaleX(1) translateX(100%);
|
||||
transform-origin: left;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,11 +1,11 @@
|
||||
[package]
|
||||
name = "app"
|
||||
version = "0.1.0"
|
||||
description = "A Tauri App"
|
||||
authors = ["you"]
|
||||
license = ""
|
||||
repository = ""
|
||||
default-run = "app"
|
||||
name = "jellyplayer"
|
||||
version = "1.0.0"
|
||||
description = "A Modern Jellyfin Client"
|
||||
authors = ["prayag17", "JellyPlayer contributors (https://github.com/prayag17/JellyPlayer/graphs/contributors)"]
|
||||
license = "GPL-3.0-only"
|
||||
repository = "https://github.com/prayag17/JellyPlayer/"
|
||||
default-run = "jellyplayer"
|
||||
edition = "2021"
|
||||
rust-version = "1.59"
|
||||
|
||||
@@ -17,8 +17,10 @@ tauri-build = { version = "1.2.1", features = [] }
|
||||
[dependencies]
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "1.2.2", features = [] }
|
||||
tauri = { version = "1.2.2", features = ["devtools", "http-all", "process-exit", "process-relaunch", "shell-all", "window-set-fullscreen"] }
|
||||
tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" }
|
||||
tauri-plugin-localhost = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
|
||||
portpicker = "0.1" # used in the example to pick a random free port
|
||||
|
||||
[features]
|
||||
# by default Tauri runs in production mode
|
||||
|
||||
@@ -1,11 +1,55 @@
|
||||
#![cfg_attr(
|
||||
all(not(debug_assertions), target_os = "windows"),
|
||||
windows_subsystem = "windows"
|
||||
)]
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
use tauri::Manager;
|
||||
|
||||
use tauri::{utils::config::AppUrl, WindowUrl};
|
||||
|
||||
// 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
|
||||
// HTTP. However, when running tauri dev, we already have a localhost server
|
||||
// provided by vite, so don't enable it
|
||||
#[cfg(debug_assertions)]
|
||||
const USE_LOCALHOST_SERVER: bool = false;
|
||||
#[cfg(not(debug_assertions))]
|
||||
const USE_LOCALHOST_SERVER: bool = true;
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_store::Builder::default().build())
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
let port = portpicker::pick_unused_port().expect("failed to find unused port");
|
||||
|
||||
let window_url = if USE_LOCALHOST_SERVER {
|
||||
WindowUrl::External(format!("http://localhost:{}", port).parse().unwrap())
|
||||
} else {
|
||||
WindowUrl::App("index.html".into())
|
||||
};
|
||||
|
||||
let mut context = tauri::generate_context!();
|
||||
let mut builder = tauri::Builder::default();
|
||||
|
||||
if USE_LOCALHOST_SERVER {
|
||||
// rewrite the config so the IPC is enabled on this URL
|
||||
context.config_mut().build.dist_dir = AppUrl::Url(window_url.clone());
|
||||
context.config_mut().build.dev_path = AppUrl::Url(window_url.clone());
|
||||
builder = builder.plugin(tauri_plugin_localhost::Builder::new(port).build());
|
||||
}
|
||||
|
||||
|
||||
builder
|
||||
.invoke_handler(tauri::generate_handler![close_splashscreen])
|
||||
.plugin(tauri_plugin_store::Builder::default().build())
|
||||
.run(context)
|
||||
.expect("error while running tauri application");
|
||||
// tauri::Builder::default()
|
||||
// .run(tauri::generate_context!())
|
||||
// .expect("error while running tauri application");
|
||||
}
|
||||
@@ -8,11 +8,25 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "JellyPlayer",
|
||||
"version": "0.1.0"
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
"all": false
|
||||
"process": {
|
||||
"all": false,
|
||||
"exit": true,
|
||||
"relaunch": true,
|
||||
"relaunchDangerousAllowSymlinkMacos": false
|
||||
},
|
||||
"window": {
|
||||
"setFullscreen": true
|
||||
},
|
||||
"shell": {
|
||||
"all": true
|
||||
},
|
||||
"http": {
|
||||
"all": true
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
@@ -57,9 +71,20 @@
|
||||
{
|
||||
"fullscreen": false,
|
||||
"height": 600,
|
||||
"width": 800,
|
||||
"resizable": true,
|
||||
"title": "JellyPlayer",
|
||||
"width": 800
|
||||
"visible": false,
|
||||
"center": true
|
||||
},
|
||||
{
|
||||
"width": 800,
|
||||
"height": 300,
|
||||
"center": true,
|
||||
"decorations": false,
|
||||
"resizable": false,
|
||||
"url": "splash.html",
|
||||
"label": "splashscreen"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#root {
|
||||
max-width: 1280px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 6em;
|
||||
padding: 1.5em;
|
||||
will-change: filter;
|
||||
}
|
||||
.logo:hover {
|
||||
filter: drop-shadow(0 0 2em #646cffaa);
|
||||
}
|
||||
.logo.react:hover {
|
||||
filter: drop-shadow(0 0 2em #61dafbaa);
|
||||
}
|
||||
|
||||
@keyframes logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
a:nth-of-type(2) .logo {
|
||||
animation: logo-spin infinite 20s linear;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 2em;
|
||||
}
|
||||
|
||||
.read-the-docs {
|
||||
color: #888;
|
||||
}
|
||||
@@ -1,13 +1,18 @@
|
||||
/** @format */
|
||||
|
||||
import { useState, useEffect, useContext } from "react";
|
||||
import React, { useState, useEffect } from "react";
|
||||
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
|
||||
import Konami from "react-konami-code";
|
||||
// @ts-ignore
|
||||
const Kon = Konami.default ? Konami.default : Konami;
|
||||
|
||||
import { ThemeProvider } from "@mui/material/styles";
|
||||
import { SnackbarProvider } from "notistack";
|
||||
import { useCookies, Cookies } from "react-cookie";
|
||||
import { SnackbarProvider, useSnackbar } from "notistack";
|
||||
import {
|
||||
Routes,
|
||||
Route,
|
||||
Navigate,
|
||||
useNavigate,
|
||||
useLocation,
|
||||
Outlet,
|
||||
@@ -16,29 +21,57 @@ import { AnimatePresence, motion } from "framer-motion";
|
||||
|
||||
import { EventEmitter as event } from "./eventEmitter.js";
|
||||
|
||||
import { relaunch } from "@tauri-apps/api/process";
|
||||
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
|
||||
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||
|
||||
// Theming
|
||||
import CssBaseline from "@mui/material/CssBaseline";
|
||||
import { theme } from "./theme";
|
||||
import "./styles/global.scss";
|
||||
|
||||
// MUI
|
||||
import Dialog from "@mui/material/Dialog";
|
||||
import DialogActions from "@mui/material/DialogActions";
|
||||
import DialogContent from "@mui/material/DialogContent";
|
||||
import DialogContentText from "@mui/material/DialogContentText";
|
||||
import DialogTitle from "@mui/material/DialogTitle";
|
||||
import Button from "@mui/material/Button";
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
|
||||
// Routes
|
||||
import { ServerSetup, ServerList } from "./routes/setup/server/root";
|
||||
import { Home } from "./routes/home/root";
|
||||
import {
|
||||
UserLogin,
|
||||
LoginWithImage,
|
||||
UserLoginManual,
|
||||
} from "./routes/login/root";
|
||||
import { ServerSetup, ServerList } from "./routes/setup/server";
|
||||
import Home from "./routes/home";
|
||||
import { UserLogin, LoginWithImage, UserLoginManual } from "./routes/login";
|
||||
import LibraryView from "./routes/library";
|
||||
import ItemDetail from "./routes/item";
|
||||
import FavouritePage from "./routes/favourite/index.jsx";
|
||||
import Settings from "./routes/settings";
|
||||
import About from "./routes/about";
|
||||
|
||||
import { VideoPlayer } from "./routes/player/videoPlayer.jsx";
|
||||
|
||||
import { SideMenu } from "./components/menu/sidemenu.jsx";
|
||||
import { AppBar } from "./components/appBar/appBar.jsx";
|
||||
|
||||
// Fonts
|
||||
import "@fontsource/open-sans";
|
||||
|
||||
// Jellyfin SDK TypeScript
|
||||
import { Jellyfin } from "@jellyfin/sdk";
|
||||
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 axios from "axios";
|
||||
|
||||
const jellyfin = new Jellyfin({
|
||||
clientInfo: {
|
||||
@@ -52,10 +85,7 @@ const jellyfin = new Jellyfin({
|
||||
});
|
||||
|
||||
event.on("create-jellyfin-api", (serverAddress) => {
|
||||
window.api = jellyfin.createApi(
|
||||
serverAddress,
|
||||
sessionStorage.getItem("accessToken"),
|
||||
);
|
||||
window.api = jellyfin.createApi(serverAddress);
|
||||
// window.api = jellyfin.createApi(serverAddress);
|
||||
});
|
||||
event.on("set-api-accessToken", (serverAddress) => {
|
||||
@@ -67,16 +97,16 @@ event.on("set-api-accessToken", (serverAddress) => {
|
||||
|
||||
const anim = {
|
||||
initial: {
|
||||
transform: "scale(0.99)",
|
||||
opacity: 0,
|
||||
x: -50,
|
||||
},
|
||||
animate: {
|
||||
transform: "scale(1)",
|
||||
opacity: 1,
|
||||
x: 0,
|
||||
},
|
||||
exit: {
|
||||
transform: "scale(0.99)",
|
||||
opacity: 0,
|
||||
x: 50,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -89,8 +119,7 @@ const AnimationWrapper = () => {
|
||||
animate="animate"
|
||||
exit="exit"
|
||||
transition={{
|
||||
duration: 0.3,
|
||||
ease: "easeInOut",
|
||||
duration: 0.35,
|
||||
}}
|
||||
>
|
||||
<Outlet />
|
||||
@@ -98,127 +127,275 @@ const AnimationWrapper = () => {
|
||||
);
|
||||
};
|
||||
|
||||
function App({ hideLoader }) {
|
||||
const [userCookies] = useCookies(["user"]);
|
||||
function App() {
|
||||
const navigate = useNavigate();
|
||||
const cookies = new Cookies();
|
||||
|
||||
const serverAvailable = () => {
|
||||
try {
|
||||
const currentServer = cookies.get("currentServer");
|
||||
const serverList = cookies.get("servers");
|
||||
let currentServerIp = "";
|
||||
serverList.map((item, index) => {
|
||||
currentServerIp = item[currentServer];
|
||||
});
|
||||
const [serverReachable, setServerReachable] = useState(true);
|
||||
|
||||
if (currentServer == undefined) {
|
||||
return false;
|
||||
} else {
|
||||
if (!window.api) {
|
||||
event.emit(
|
||||
"create-jellyfin-api",
|
||||
currentServerIp.serverAddress,
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
|
||||
const createApi = async () => {
|
||||
const server = await getServer();
|
||||
event.emit("create-jellyfin-api", server.Ip);
|
||||
};
|
||||
|
||||
const userSaved = () => {
|
||||
try {
|
||||
userCookies.user[0];
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
const serverAvailable = async () => {
|
||||
const server = await getServer();
|
||||
|
||||
const userAvailable = async () => {
|
||||
const users = await getUserApi(window.api).getPublicUsers();
|
||||
try {
|
||||
if (users.data.length >= 1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
if (server == null) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const HandleLoginRoutes = () => {
|
||||
if (userSaved()) {
|
||||
navigate("/home");
|
||||
} else {
|
||||
userAvailable().then((res) => {
|
||||
if (res) {
|
||||
navigate("/login/users");
|
||||
} else if (!res) {
|
||||
navigate("/login/manual");
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
const usersAvailable = async () => {
|
||||
const users = await getUserApi(window.api).getPublicUsers();
|
||||
if (users.data.length >= 1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const userSaved = async () => {
|
||||
const user = await getUser();
|
||||
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) => {
|
||||
if (reason && reason == "backdropClick") {
|
||||
return;
|
||||
}
|
||||
await relaunch();
|
||||
};
|
||||
|
||||
const handleRemoveServer = async () => {
|
||||
await delServer();
|
||||
await delUser();
|
||||
await relaunch();
|
||||
};
|
||||
const location = useLocation();
|
||||
|
||||
if (!window.api) {
|
||||
serverAvailable().then((available) => {
|
||||
if (available) {
|
||||
createApi().then(
|
||||
userSaved().then((userSavedBool) => {
|
||||
if (userSavedBool) {
|
||||
userLogin();
|
||||
}
|
||||
}),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
const [easterEgg, setEasterEgg] = useState(false);
|
||||
const sixtyNine = () => {
|
||||
setEasterEgg(true);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
appWindow.setFullscreen(false);
|
||||
}, [location]);
|
||||
|
||||
return (
|
||||
<SnackbarProvider maxSnack={5}>
|
||||
<ThemeProvider theme={theme}>
|
||||
<Kon resetDelay={1000} action={sixtyNine}></Kon>
|
||||
<Dialog
|
||||
open={easterEgg}
|
||||
onClose={() => setEasterEgg(false)}
|
||||
>
|
||||
<iframe
|
||||
width="560"
|
||||
height="315"
|
||||
src="https://www.youtube.com/embed/dQw4w9WgXcQ?controls=0&autoplay=1"
|
||||
title="EasterEgg"
|
||||
frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
></iframe>
|
||||
</Dialog>
|
||||
{/* Show Dialog if server not reachable */}
|
||||
<Dialog
|
||||
open={!serverReachable}
|
||||
onClose={handleRelaunch}
|
||||
aria-labelledby="alert-dialog-text"
|
||||
aria-describedby="alert-dialog-desc"
|
||||
maxWidth="md"
|
||||
sx={{
|
||||
padding: "1em",
|
||||
}}
|
||||
>
|
||||
<DialogTitle id="alert-dialog-text">
|
||||
Unable to reach server
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<DialogContentText id="alert-dialog-desc">
|
||||
Unable to connect to the jellyfin server.
|
||||
</DialogContentText>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={handleRemoveServer}>
|
||||
Remove Server
|
||||
</Button>
|
||||
<Button onClick={handleRelaunch}>
|
||||
Restart JellyPlayer
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
<AnimatePresence>
|
||||
<CssBaseline />
|
||||
<Routes key={location.pathname} location={location}>
|
||||
<Route element={<AnimationWrapper />}>
|
||||
{/* Main Routes */}
|
||||
<Route path="/home" element={<Home />} />
|
||||
<Route
|
||||
path="/setup/server"
|
||||
element={<ServerSetup />}
|
||||
/>
|
||||
<Route
|
||||
path="/servers/list"
|
||||
element={<ServerList />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/login/withImg/:userName/:userId/"
|
||||
element={<LoginWithImage />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/login/users"
|
||||
element={<UserLogin />}
|
||||
/>
|
||||
<Route
|
||||
path="/login/manual"
|
||||
element={<UserLoginManual />}
|
||||
/>
|
||||
<div style={{ display: "flex" }}>
|
||||
<CssBaseline />
|
||||
<SideMenu />
|
||||
<AppBar />
|
||||
<Routes
|
||||
key={location.pathname}
|
||||
location={location}
|
||||
>
|
||||
<Route element={<AnimationWrapper />}>
|
||||
<Route
|
||||
path="/"
|
||||
element={<LogicalRoutes />}
|
||||
/>
|
||||
|
||||
{/* Logical Routes */}
|
||||
<Route
|
||||
exact
|
||||
path="/login"
|
||||
element={
|
||||
<HandleLoginRoutes></HandleLoginRoutes>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/home"
|
||||
element={<Home />}
|
||||
/>
|
||||
<Route
|
||||
path="/setup/server"
|
||||
element={<ServerSetup />}
|
||||
/>
|
||||
<Route
|
||||
path="/servers/list"
|
||||
element={<ServerList />}
|
||||
/>
|
||||
<Route
|
||||
path="/login/withImg/:userName/:userId/"
|
||||
element={<LoginWithImage />}
|
||||
/>
|
||||
<Route
|
||||
path="/login/users"
|
||||
element={<UserLogin />}
|
||||
/>
|
||||
<Route
|
||||
path="/login/manual"
|
||||
element={<UserLoginManual />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/library/:id"
|
||||
element={<LibraryView />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/item/:id"
|
||||
element={<ItemDetail />}
|
||||
/>
|
||||
<Route
|
||||
path="/favourite"
|
||||
element={<FavouritePage />}
|
||||
/>
|
||||
<Route
|
||||
path="/settings"
|
||||
element={<Settings />}
|
||||
/>
|
||||
<Route
|
||||
path="/about"
|
||||
element={<About />}
|
||||
/>
|
||||
<Route
|
||||
path="/player"
|
||||
element={<VideoPlayer />}
|
||||
/>
|
||||
|
||||
<Route
|
||||
path="/"
|
||||
element={
|
||||
serverAvailable() ? (
|
||||
<Navigate to="/login" />
|
||||
) : (
|
||||
<Navigate to="/setup/server" />
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Route>
|
||||
</Routes>
|
||||
<Route
|
||||
path="/login"
|
||||
element={<LoginLogicalRoutes />}
|
||||
/>
|
||||
</Route>
|
||||
</Routes>
|
||||
</div>
|
||||
</AnimatePresence>
|
||||
</ThemeProvider>
|
||||
</SnackbarProvider>
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Part of the Jellyfin project (https://jellyfin.media)
|
||||
-
|
||||
- All copyright belongs to the Jellyfin contributors; a full list can
|
||||
- be found in the file CONTRIBUTORS.md
|
||||
-
|
||||
- This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||
- To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
<svg id="banner-dark" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1536 512">
|
||||
<defs>
|
||||
<linearGradient id="linear-gradient" x1="110.25" y1="213.3" x2="496.14" y2="436.09" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#aa5cc3"/>
|
||||
<stop offset="1" stop-color="#00a4dc"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<title>banner-dark</title>
|
||||
<g id="banner-dark">
|
||||
<g id="banner-dark-icon">
|
||||
<path id="inner-shape" d="M261.42,201.62c-20.44,0-86.24,119.29-76.2,139.43s142.48,19.92,152.4,0S281.86,201.63,261.42,201.62Z" fill="url(#linear-gradient)"/>
|
||||
<path id="outer-shape" d="M261.42,23.3C199.83,23.3,1.57,382.73,31.8,443.43s429.34,60,459.24,0S323,23.3,261.42,23.3ZM411.9,390.76c-19.59,39.33-281.08,39.77-300.9,0S221.1,115.48,261.45,115.48,431.49,351.42,411.9,390.76Z" fill="url(#linear-gradient)"/>
|
||||
</g>
|
||||
<g id="jellyfin-light-outlines" style="isolation:isolate" transform="translate(43.8)">
|
||||
<path d="M556.64,350.75a67,67,0,0,1-22.87-27.47,8.91,8.91,0,0,1-1.49-4.75,7.42,7.42,0,0,1,2.83-5.94,9.25,9.25,0,0,1,6.09-2.38c3.16,0,5.94,1.69,8.31,5.05a48.09,48.09,0,0,0,16.34,20.34,40.59,40.59,0,0,0,24,7.58q20.51,0,33.27-12.62t12.77-33.12V159a8.44,8.44,0,0,1,2.67-6.39,9.56,9.56,0,0,1,6.83-2.52,9,9,0,0,1,6.68,2.52,8.7,8.7,0,0,1,2.53,6.39v138.4a64.7,64.7,0,0,1-8.32,32.67,59,59,0,0,1-23,22.72Q608.62,361,589.9,361A57.21,57.21,0,0,1,556.64,350.75Z" fill="#fff"/>
|
||||
<path d="M831.66,279.47a8.77,8.77,0,0,1-6.24,2.53H713.16q0,17.82,7.27,31.92a54.91,54.91,0,0,0,20.79,22.28q13.51,8.18,31.93,8.17a54,54,0,0,0,25.54-5.94,52.7,52.7,0,0,0,18.12-15.15,10,10,0,0,1,6.24-2.67,8.14,8.14,0,0,1,7.72,7.72,8.81,8.81,0,0,1-3,6.24,74.7,74.7,0,0,1-23.91,19A65.56,65.56,0,0,1,773.45,361q-22.87,0-40.4-9.8a69.51,69.51,0,0,1-27.32-27.48q-9.79-17.66-9.8-40.83,0-24.36,9.65-42.62t25.69-27.92a65.2,65.2,0,0,1,34.16-9.65A70,70,0,0,1,798.84,211a65.78,65.78,0,0,1,25.39,24.36q9.81,16,10.1,38A8.07,8.07,0,0,1,831.66,279.47ZM733.5,231.8Q718.8,243.68,714.64,266H815.92v-2.38A46.91,46.91,0,0,0,807,240.27a48.47,48.47,0,0,0-18.56-15.15,54,54,0,0,0-23-5.2Q748.2,219.92,733.5,231.8Z" fill="#fff"/>
|
||||
<path d="M888.24,355.5a8.92,8.92,0,0,1-15.3-6.38v-202a8.91,8.91,0,1,1,17.82,0v202A8.65,8.65,0,0,1,888.24,355.5Z" fill="#fff"/>
|
||||
<path d="M956.55,355.5a8.92,8.92,0,0,1-15.3-6.38v-202a8.91,8.91,0,1,1,17.82,0v202A8.65,8.65,0,0,1,956.55,355.5Z" fill="#fff"/>
|
||||
<path d="M1122.86,206.11a8.7,8.7,0,0,1,2.53,6.39v131q0,23.44-9.21,40.09a61.58,61.58,0,0,1-25.54,25.25q-16.34,8.61-36.83,8.61a96.73,96.73,0,0,1-23.31-2.68,61.72,61.72,0,0,1-18-7.12q-6.24-3.87-6.24-8.62a17.94,17.94,0,0,1,.6-3,8.06,8.06,0,0,1,3-4.45,7.49,7.49,0,0,1,4.45-1.49,7.91,7.91,0,0,1,3.56.89q19,10.39,36.24,10.4,24.65,0,39.06-15.44t14.4-42.18V333.38a54.37,54.37,0,0,1-21.38,20,62.55,62.55,0,0,1-30.3,7.58q-25.83,0-39.2-15.45t-13.37-41.87V212.5a8.91,8.91,0,1,1,17.82,0V301q0,21.39,9.36,32.38t29.25,11a48,48,0,0,0,23.32-6.09,49.88,49.88,0,0,0,17.82-16,37.44,37.44,0,0,0,6.68-21.24V212.5a9,9,0,0,1,15.29-6.39Z" fill="#fff"/>
|
||||
<path d="M1210.18,161.41q-5.21,6.24-5.2,17.23v30.59h33.27a8.19,8.19,0,0,1,5.79,2.38,8.26,8.26,0,0,1,0,11.88,8.22,8.22,0,0,1-5.79,2.37H1205V349.12a8.91,8.91,0,1,1-17.82,0V225.86h-21.68a7.83,7.83,0,0,1-5.94-2.52,8.21,8.21,0,0,1-2.37-5.79,8,8,0,0,1,2.37-6.09,8.33,8.33,0,0,1,5.94-2.23h21.68V178.64q0-18.7,10.84-29t29-10.24a46.1,46.1,0,0,1,15.45,2.52q7.13,2.53,7.12,8.17a8.07,8.07,0,0,1-2.37,5.94,7.37,7.37,0,0,1-5.35,2.37,18.81,18.81,0,0,1-6.53-1.48,42,42,0,0,0-10.4-1.78Q1215.37,155.18,1210.18,161.41ZM1276,180.87c-2.19-1.88-3.27-4.61-3.27-8.17v-3q0-5.34,3.41-8.17t9.36-2.82q11.88,0,11.88,11v3c0,3.56-1,6.29-3.12,8.17s-5.1,2.82-9.06,2.82S1278.14,182.75,1276,180.87Zm15.59,174.63a8.92,8.92,0,0,1-15.3-6.38V212.5a8.91,8.91,0,1,1,17.82,0V349.12A8.65,8.65,0,0,1,1291.56,355.5Z" fill="#fff"/>
|
||||
<path d="M1452.53,218.88q12.92,16.2,12.92,42.92v87.32a8.4,8.4,0,0,1-2.67,6.38,8.8,8.8,0,0,1-6.24,2.53,8.64,8.64,0,0,1-8.91-8.91V262.69q0-19.31-9.65-31.33t-29.85-12a53.28,53.28,0,0,0-42.77,21.83,36.24,36.24,0,0,0-7.13,21.53v86.43a8.91,8.91,0,1,1-17.82,0V216.06a8.91,8.91,0,1,1,17.82,0V232.4q8-12.77,23-21.24A61.84,61.84,0,0,1,1412,202.7Q1439.61,202.7,1452.53,218.88Z" fill="#fff"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.7 KiB |
@@ -0,0 +1,222 @@
|
||||
/** @format */
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import { relaunch } from "@tauri-apps/api/process";
|
||||
|
||||
import MuiAppBar from "@mui/material/AppBar";
|
||||
import TextField from "@mui/material/TextField";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Toolbar from "@mui/material/Toolbar";
|
||||
import Avatar from "@mui/material/Avatar";
|
||||
import Box from "@mui/material/Box";
|
||||
import ListItemIcon from "@mui/material/ListItemIcon";
|
||||
import Menu from "@mui/material/Menu";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import useScrollTrigger from "@mui/material/useScrollTrigger";
|
||||
|
||||
import { MdiMagnify } from "../icons/mdiMagnify";
|
||||
import { theme } from "../../theme";
|
||||
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import "./appBar.module.scss";
|
||||
import { MdiAccount } from "../icons/mdiAccount";
|
||||
import { MdiHeartOutline } from "../icons/mdiHeartOutline";
|
||||
import { MdiArrowLeft } from "../icons/mdiArrowLeft";
|
||||
import { MdiCog } from "../icons/mdiCog";
|
||||
import { MdiInformation } from "../icons/mdiInformation";
|
||||
import { MdiMenu } from "../icons/mdiMenu";
|
||||
import { useDrawerStore } from "../../utils/store/drawer";
|
||||
import { delServer } from "../../utils/storage/servers";
|
||||
import { delUser } from "../../utils/storage/user";
|
||||
import { MdiDelete } from "../icons/mdiDelete";
|
||||
|
||||
export const AppBar = () => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const [display, setDisplay] = useState(false);
|
||||
const [backButtonVisible, setBackButtonVisible] = useState(false);
|
||||
|
||||
const location = useLocation();
|
||||
|
||||
const user = useQuery({
|
||||
queryKey: ["user"],
|
||||
queryFn: async () => {
|
||||
let usr = await getUserApi(window.api).getCurrentUser();
|
||||
return usr.data;
|
||||
},
|
||||
enabled: display,
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const trigger = useScrollTrigger({
|
||||
disableHysteresis: true,
|
||||
threshold: 0,
|
||||
});
|
||||
|
||||
const [anchorEl, setAnchorEl] = useState(null);
|
||||
const openMenu = Boolean(anchorEl);
|
||||
const handleMenuOpen = (event) => {
|
||||
setAnchorEl(event.currentTarget);
|
||||
};
|
||||
const handleMenuClose = () => {
|
||||
setAnchorEl(null);
|
||||
};
|
||||
|
||||
const [setDrawerOpen] = useDrawerStore((state) => [state.setOpen]);
|
||||
|
||||
const handleDrawerOpen = () => {
|
||||
setDrawerOpen(true);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
location.pathname.includes("login") ||
|
||||
location.pathname.includes("setup") ||
|
||||
location.pathname.includes("player") ||
|
||||
location.pathname === "/"
|
||||
) {
|
||||
setDisplay(false);
|
||||
} else {
|
||||
setDisplay(true);
|
||||
}
|
||||
}, [location]);
|
||||
|
||||
useEffect(() => {
|
||||
if (location.pathname == "/home") {
|
||||
setBackButtonVisible(false);
|
||||
} else {
|
||||
setBackButtonVisible(true);
|
||||
}
|
||||
}, [location]);
|
||||
|
||||
if (!display) {
|
||||
return <></>;
|
||||
}
|
||||
if (display) {
|
||||
return (
|
||||
<MuiAppBar
|
||||
sx={{
|
||||
backgroundColor: "transparent",
|
||||
paddingRight: "0 !important",
|
||||
}}
|
||||
className={trigger ? "appBar backdropVisible" : "appBar"}
|
||||
elevation={0}
|
||||
>
|
||||
<Toolbar
|
||||
sx={{
|
||||
justifyContent: "space-between",
|
||||
paddingLeft: "12px !important",
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
gap: 1,
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<IconButton
|
||||
color="inherit"
|
||||
aria-label="open drawer"
|
||||
onClick={handleDrawerOpen}
|
||||
>
|
||||
<MdiMenu />
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={() => navigate(-1)}
|
||||
sx={{
|
||||
transition: "transform 0.2s",
|
||||
transform: backButtonVisible
|
||||
? "scale(1)"
|
||||
: "scale(0)",
|
||||
transformOrigin: "left",
|
||||
ml: 2,
|
||||
}}
|
||||
>
|
||||
<MdiArrowLeft />
|
||||
</IconButton>
|
||||
|
||||
<TextField
|
||||
variant="outlined"
|
||||
placeholder="Search..."
|
||||
size="small"
|
||||
/>
|
||||
<IconButton>
|
||||
<MdiMagnify />
|
||||
</IconButton>
|
||||
</Box>
|
||||
<Box sx={{ display: "flex", gap: 2 }}>
|
||||
<IconButton>
|
||||
<MdiHeartOutline />
|
||||
</IconButton>
|
||||
<IconButton
|
||||
sx={{ p: 0 }}
|
||||
onClick={handleMenuOpen}
|
||||
>
|
||||
{user.isSuccess &&
|
||||
(user.data.PrimaryImageTag ==
|
||||
undefined ? (
|
||||
<Avatar
|
||||
className="appBar-avatar"
|
||||
alt={user.data.Name}
|
||||
>
|
||||
<MdiAccount className="appBar-avatar-icon" />
|
||||
</Avatar>
|
||||
) : (
|
||||
<Avatar
|
||||
className="appBar-avatar"
|
||||
src={
|
||||
window.api.basePath +
|
||||
"/Users/" +
|
||||
user.data.Id +
|
||||
"/Images/Primary"
|
||||
}
|
||||
alt={user.data.Name}
|
||||
>
|
||||
<MdiAccount className="appBar-avatar-icon" />
|
||||
</Avatar>
|
||||
))}
|
||||
</IconButton>
|
||||
<Menu
|
||||
anchorEl={anchorEl}
|
||||
open={openMenu}
|
||||
onClose={handleMenuClose}
|
||||
sx={{ mt: 1 }}
|
||||
>
|
||||
<MenuItem
|
||||
onClick={() => navigate("/settings")}
|
||||
>
|
||||
<ListItemIcon>
|
||||
<MdiCog />
|
||||
</ListItemIcon>
|
||||
Settings
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => navigate("/about")}>
|
||||
<ListItemIcon>
|
||||
<MdiInformation />
|
||||
</ListItemIcon>
|
||||
About
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
onClick={async () => {
|
||||
await delServer();
|
||||
await delUser();
|
||||
await relaunch();
|
||||
}}
|
||||
>
|
||||
<ListItemIcon>
|
||||
<MdiDelete />
|
||||
</ListItemIcon>
|
||||
Remove Server
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</Box>
|
||||
</Toolbar>
|
||||
</MuiAppBar>
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
/** @format */
|
||||
|
||||
.appBar {
|
||||
transition: background-color $transition-time-fast,
|
||||
backdrop-filter $transition-time-fast,
|
||||
box-shadow $transition-time-default !important;
|
||||
&.backdropVisible {
|
||||
background-color: $clr-background-dark-opacity-0_8;
|
||||
backdrop-filter: blur(30px);
|
||||
}
|
||||
&-avatar {
|
||||
background: $clr-gradient-dark;
|
||||
&-icon {
|
||||
fill: url(#clr-gradient-default) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +1,15 @@
|
||||
/** @format */
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import Typography from "@mui/material/Typography";
|
||||
import ButtonBase from "@mui/material/ButtonBase";
|
||||
import Box from "@mui/material/Box";
|
||||
|
||||
import Account from "mdi-material-ui/Account";
|
||||
import { MdiAccount } from "../icons/mdiAccount";
|
||||
|
||||
import "./avatar.module.scss";
|
||||
|
||||
export const AvatarCard = ({ userName, userId, userImageAvailable }) => {
|
||||
export const AvatarImage = ({ userId, userImageTags }) => {
|
||||
return (
|
||||
<ButtonBase className="card square">
|
||||
<div className="card-image-container">
|
||||
{userImageAvailable ? (
|
||||
<div
|
||||
className="card-image"
|
||||
style={{
|
||||
backgroundImage:
|
||||
"url('" +
|
||||
window.api.basePath +
|
||||
"/Users/" +
|
||||
userId +
|
||||
"/Images/Primary')",
|
||||
// http://localhost/Users/{userId}/Images/{imageType}
|
||||
}}
|
||||
></div>
|
||||
) : (
|
||||
<div className="card-image empty"></div>
|
||||
)}
|
||||
<div className="card-image-icon-container">
|
||||
<Account className="card-image-icon" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="card-text-container">
|
||||
<Typography
|
||||
variant="button"
|
||||
color="textPrimary"
|
||||
className="card-text"
|
||||
>
|
||||
{userName}
|
||||
</Typography>
|
||||
</div>
|
||||
</ButtonBase>
|
||||
);
|
||||
};
|
||||
|
||||
export const AvatarImage = ({ userId }) => {
|
||||
return (
|
||||
<div className="avatar-image-container">
|
||||
<Box className="avatar-image-container">
|
||||
<div
|
||||
className="avatar-image"
|
||||
style={{
|
||||
@@ -61,9 +23,9 @@ export const AvatarImage = ({ userId }) => {
|
||||
></div>
|
||||
|
||||
<div className="avatar-image-icon-container">
|
||||
<Account className="avatar-image-icon" />
|
||||
<MdiAccount className="avatar-image-icon" />
|
||||
</div>
|
||||
</div>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -71,12 +33,7 @@ export const AvatarSideMenu = ({ userName }) => {
|
||||
return <div></div>;
|
||||
};
|
||||
|
||||
AvatarCard.propType = {
|
||||
userName: PropTypes.string.isRequired,
|
||||
userId: PropTypes.string.isRequired,
|
||||
userImageAvailable: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
AvatarImage.propType = {
|
||||
userId: PropTypes.string.isRequired,
|
||||
userImageTags: PropTypes.any,
|
||||
};
|
||||
@@ -1,42 +1,5 @@
|
||||
/** @format */
|
||||
|
||||
.userCard {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.card.square {
|
||||
width: fit-content;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
gap: 0.5em;
|
||||
margin-bottom: 0.5em;
|
||||
.card-image {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
&-container {
|
||||
font-size: 5em;
|
||||
}
|
||||
&-icon {
|
||||
font-size: 1.5em !important;
|
||||
&-container {
|
||||
position: static;
|
||||
width: 1.5em !important;
|
||||
height: 1.5em !important;
|
||||
aspect-ratio: 1;
|
||||
border-radius: $border-radius-default;
|
||||
color: $clr-accent-default;
|
||||
background: $clr-accent-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
.card-text {
|
||||
margin: 0 !important;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.avatar-image {
|
||||
aspect-ratio: 1;
|
||||
height: 100%;
|
||||
@@ -55,8 +18,8 @@
|
||||
&-icon {
|
||||
height: 100%;
|
||||
padding: 0.2em;
|
||||
background: $clr-accent-dark;
|
||||
color: $clr-accent-default;
|
||||
font-size: 6em !important;
|
||||
background: $clr-gradient-dark;
|
||||
fill: url(#clr-gradient-default) !important;
|
||||
font-size: 7em !important;
|
||||
}
|
||||
}
|
||||
@@ -1,110 +1,403 @@
|
||||
/** @format */
|
||||
import React from "react";
|
||||
import React, { useState } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import MuiCard from "@mui/material/Card";
|
||||
import CardContent from "@mui/material/CardContent";
|
||||
import CardMedia from "@mui/material/CardMedia";
|
||||
import CardActionArea from "@mui/material/CardActionArea";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Chip from "@mui/material/Chip";
|
||||
import ButtonGroup from "@mui/material/ButtonGroup";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
|
||||
import { Blurhash } from "react-blurhash";
|
||||
import { green, pink } from "@mui/material/colors";
|
||||
|
||||
import {
|
||||
MediaCollectionTypeIconCollectionCard,
|
||||
MediaTypeIconCollectionCard,
|
||||
TypeIconCollectionCard,
|
||||
} from "../utils/iconsCollection";
|
||||
|
||||
import { borderRadiusDefault } from "../../palette.module.scss";
|
||||
import "./card.module.scss";
|
||||
import { MdiCheck } from "../icons/mdiCheck";
|
||||
|
||||
export const CardLandscape = ({ itemName, itemId, imageTags, iconType }) => {
|
||||
const imageAvailable = () => {
|
||||
console.log(imageTags);
|
||||
if (imageTags == undefined) {
|
||||
console.log("hee");
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import { MdiHeartOutline } from "../icons/mdiHeartOutline";
|
||||
import { MdiHeart } from "../icons/mdiHeart";
|
||||
|
||||
export const Card = ({
|
||||
itemName,
|
||||
itemId,
|
||||
imageTags,
|
||||
iconType,
|
||||
cardType = "",
|
||||
subText = "",
|
||||
playedPercent,
|
||||
cardOrientation,
|
||||
cardProps,
|
||||
onClickEvent,
|
||||
watchedStatus,
|
||||
watchedCount,
|
||||
blurhash,
|
||||
currentUser,
|
||||
favourite,
|
||||
disableOverlay,
|
||||
}) => {
|
||||
const navigate = useNavigate();
|
||||
const [imgLoading, setImgLoading] = useState(true);
|
||||
const [isWatched, setIsWatched] = useState(watchedStatus);
|
||||
const [isFavorite, setisFavorite] = useState(favourite);
|
||||
const [watchedCountState, setWatchedCountState] = useState(watchedCount);
|
||||
const handleMarkAsPlayOrUnMarkAsPlay = async () => {
|
||||
let result;
|
||||
if (!isWatched) {
|
||||
result = await getPlaystateApi(window.api).markPlayedItem({
|
||||
userId: currentUser.Id,
|
||||
itemId: itemId,
|
||||
});
|
||||
} else if (isWatched) {
|
||||
result = await getPlaystateApi(window.api).markUnplayedItem({
|
||||
userId: currentUser.Id,
|
||||
itemId: itemId,
|
||||
});
|
||||
}
|
||||
setIsWatched(result.data.Played);
|
||||
setWatchedCountState(result.data.UnplayedItemCount);
|
||||
};
|
||||
const handleLiking = async () => {
|
||||
let result;
|
||||
if (isFavorite) {
|
||||
result = await getUserLibraryApi(window.api).unmarkFavoriteItem({
|
||||
userId: currentUser.Id,
|
||||
itemId: itemId,
|
||||
});
|
||||
} else if (!isFavorite) {
|
||||
result = await getUserLibraryApi(window.api).markFavoriteItem({
|
||||
userId: currentUser.Id,
|
||||
itemId: itemId,
|
||||
});
|
||||
}
|
||||
setisFavorite(result.data.IsFavorite);
|
||||
};
|
||||
return (
|
||||
<div className="card landscape">
|
||||
<div className="card-image-container">
|
||||
{imageAvailable ? (
|
||||
<div
|
||||
className="card-image"
|
||||
style={{
|
||||
backgroundImage:
|
||||
"url('" +
|
||||
window.api.basePath +
|
||||
"/Items/" +
|
||||
itemId +
|
||||
"/Images/Primary')",
|
||||
}}
|
||||
></div>
|
||||
) : (
|
||||
<div className="card-image empty"></div>
|
||||
)}
|
||||
<div className="card-image-icon-container">
|
||||
{MediaCollectionTypeIconCollectionCard[iconType]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="card-text-container">
|
||||
<Typography variant="button" color="white">
|
||||
{itemName}
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
const availableMarkButtonTypes = [
|
||||
"Audio",
|
||||
"AudioBook",
|
||||
"Book",
|
||||
"BoxSet",
|
||||
"CollectionFolder",
|
||||
"Movie",
|
||||
"Season",
|
||||
"Series",
|
||||
"Video",
|
||||
"Episode",
|
||||
];
|
||||
const allowedLikeButton = [
|
||||
"Audio",
|
||||
"AudioBook",
|
||||
"Book",
|
||||
"BoxSet",
|
||||
"CollectionFolder",
|
||||
"Movie",
|
||||
"MusicAlbum",
|
||||
"MusicVideo",
|
||||
"Season",
|
||||
"Series",
|
||||
"Video",
|
||||
"Channel",
|
||||
"MusicAlbum",
|
||||
"MusicArtist",
|
||||
"Person",
|
||||
"Photo",
|
||||
"Playlist",
|
||||
"Studio",
|
||||
"Episode",
|
||||
];
|
||||
|
||||
return (
|
||||
<MuiCard
|
||||
className={"card " + cardOrientation}
|
||||
sx={{
|
||||
background: "transparent",
|
||||
borderRadius: borderRadiusDefault,
|
||||
mr: 1,
|
||||
}}
|
||||
elevation={0}
|
||||
{...cardProps}
|
||||
>
|
||||
<CardActionArea
|
||||
sx={{ p: "1px" }}
|
||||
component={Box}
|
||||
onClick={
|
||||
!!onClickEvent
|
||||
? onClickEvent
|
||||
: () => {
|
||||
navigate(`/item/${itemId}`);
|
||||
}
|
||||
}
|
||||
className="cardBox"
|
||||
>
|
||||
<Box
|
||||
className="card-media-container"
|
||||
sx={{
|
||||
position: "relative",
|
||||
m: 1,
|
||||
aspectRatio:
|
||||
cardOrientation == "landscape"
|
||||
? "1.777"
|
||||
: cardOrientation == "portait"
|
||||
? "0.666"
|
||||
: "1",
|
||||
}}
|
||||
>
|
||||
<>
|
||||
<Chip
|
||||
className="card-indicator"
|
||||
label={<MdiCheck />}
|
||||
sx={{
|
||||
transition: "opacity 150ms",
|
||||
opacity: isWatched ? 1 : 0,
|
||||
}}
|
||||
/>
|
||||
|
||||
{!!watchedCountState && (
|
||||
<Chip
|
||||
className="card-indicator card-indicator-text"
|
||||
label={watchedCountState}
|
||||
></Chip>
|
||||
)}
|
||||
<div
|
||||
className="card-media-image-container"
|
||||
style={{ opacity: imgLoading ? 0 : 1 }}
|
||||
// style={{ opacity: 1 }}
|
||||
>
|
||||
{imageTags &&
|
||||
(cardType == "thumb" ? (
|
||||
<CardMedia
|
||||
component="img"
|
||||
image={
|
||||
window.api.basePath +
|
||||
"/Items/" +
|
||||
itemId +
|
||||
"/Images/Backdrop?fillHeight=300&fillWidth=532&quality=96"
|
||||
}
|
||||
alt={itemName}
|
||||
sx={{
|
||||
width: "100%",
|
||||
aspectRatio:
|
||||
cardOrientation ==
|
||||
"landscape"
|
||||
? "1.777"
|
||||
: cardOrientation ==
|
||||
"portait"
|
||||
? "0.666"
|
||||
: "1",
|
||||
borderRadius:
|
||||
borderRadiusDefault,
|
||||
overflow: "hidden",
|
||||
}}
|
||||
onLoad={() =>
|
||||
setImgLoading(false)
|
||||
}
|
||||
className="card-image"
|
||||
></CardMedia>
|
||||
) : (
|
||||
<CardMedia
|
||||
component="img"
|
||||
image={
|
||||
iconType == "User"
|
||||
? window.api
|
||||
.basePath +
|
||||
"/Users/" +
|
||||
itemId +
|
||||
"/Images/Primary?fillHeight=532&fillWidth=300&quality=96"
|
||||
: window.api
|
||||
.basePath +
|
||||
"/Items/" +
|
||||
itemId +
|
||||
"/Images/Primary?fillHeight=532&fillWidth=300&quality=96"
|
||||
}
|
||||
alt={itemName}
|
||||
sx={{
|
||||
width: "100%",
|
||||
aspectRatio:
|
||||
cardOrientation ==
|
||||
"landscape"
|
||||
? "1.777"
|
||||
: cardOrientation ==
|
||||
"portait"
|
||||
? "0.666"
|
||||
: "1",
|
||||
}}
|
||||
className="card-image"
|
||||
onLoad={() =>
|
||||
setImgLoading(false)
|
||||
}
|
||||
></CardMedia>
|
||||
))}
|
||||
</div>
|
||||
{!!blurhash && (
|
||||
<Blurhash
|
||||
hash={blurhash}
|
||||
width="100%"
|
||||
height="100%"
|
||||
resolutionX={24}
|
||||
resolutionY={24}
|
||||
style={{
|
||||
aspectRatio:
|
||||
cardOrientation == "landscape"
|
||||
? "1.777"
|
||||
: cardOrientation ==
|
||||
"portait"
|
||||
? "0.666"
|
||||
: "1",
|
||||
}}
|
||||
className="card-image-blurhash"
|
||||
/>
|
||||
)}
|
||||
<div className="card-image-icon-container">
|
||||
{cardType == "lib"
|
||||
? MediaCollectionTypeIconCollectionCard[
|
||||
iconType
|
||||
]
|
||||
: TypeIconCollectionCard[iconType]}
|
||||
</div>
|
||||
{!!playedPercent && (
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
value={playedPercent}
|
||||
sx={{
|
||||
width: "90%",
|
||||
position: "absolute",
|
||||
left: "5%",
|
||||
bottom: "5%",
|
||||
borderRadius: "100px",
|
||||
height: "5px",
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
{!disableOverlay && (
|
||||
<Box
|
||||
className="card-media-overlay"
|
||||
sx={{
|
||||
display: "flex",
|
||||
alignItems: "flex-end",
|
||||
justifyContent: "flex-end",
|
||||
p: 1,
|
||||
}}
|
||||
>
|
||||
<ButtonGroup>
|
||||
{availableMarkButtonTypes.includes(
|
||||
iconType,
|
||||
) && (
|
||||
<IconButton
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
handleMarkAsPlayOrUnMarkAsPlay();
|
||||
}}
|
||||
onFocus={(e) =>
|
||||
e.stopPropagation
|
||||
}
|
||||
>
|
||||
<MdiCheck
|
||||
sx={{
|
||||
color: isWatched
|
||||
? green[400]
|
||||
: "white",
|
||||
}}
|
||||
/>
|
||||
</IconButton>
|
||||
)}
|
||||
{allowedLikeButton.includes(
|
||||
iconType,
|
||||
) && (
|
||||
<IconButton
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
handleLiking();
|
||||
}}
|
||||
onFocus={(e) =>
|
||||
e.stopPropagation
|
||||
}
|
||||
>
|
||||
{isFavorite ? (
|
||||
<MdiHeart
|
||||
sx={{
|
||||
color: pink[700],
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<MdiHeartOutline />
|
||||
)}
|
||||
</IconButton>
|
||||
)}
|
||||
</ButtonGroup>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
<CardContent
|
||||
className="card-text-container"
|
||||
sx={{
|
||||
padding: "0 0.5em",
|
||||
backgroundColor: "transparent",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
gutterBottom={false}
|
||||
variant="h6"
|
||||
component="div"
|
||||
color="white"
|
||||
fontWeight={500}
|
||||
textAlign="left"
|
||||
noWrap
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
>
|
||||
{itemName}
|
||||
</Typography>
|
||||
|
||||
<Typography
|
||||
gutterBottom
|
||||
variant="subtitle1"
|
||||
component="div"
|
||||
textAlign="left"
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
noWrap
|
||||
sx={{ opacity: 0.5 }}
|
||||
>
|
||||
{subText}
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</CardActionArea>
|
||||
</MuiCard>
|
||||
);
|
||||
};
|
||||
|
||||
export const CardPotrait = ({ itemName, itemId, imageTags, iconType }) => {
|
||||
const imageAvailable = () => {
|
||||
console.log(imageTags);
|
||||
if (imageTags == undefined) {
|
||||
console.log("hee");
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div className="card portrait">
|
||||
<div className="card-image-container">
|
||||
{imageAvailable ? (
|
||||
<div
|
||||
className="card-image"
|
||||
style={{
|
||||
backgroundImage:
|
||||
"url('" +
|
||||
window.api.basePath +
|
||||
"/Items/" +
|
||||
itemId +
|
||||
"/Images/Primary?quality=95&fillHeight=350&fillWidth=243')",
|
||||
}}
|
||||
></div>
|
||||
) : (
|
||||
<div className="card-image empty"></div>
|
||||
)}
|
||||
<div className="card-image-icon-container">
|
||||
{MediaTypeIconCollectionCard[iconType]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="card-text-container">
|
||||
<Typography variant="button" color="white">
|
||||
{itemName}
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
CardLandscape.propTypes = {
|
||||
Card.propTypes = {
|
||||
itemName: PropTypes.string.isRequired,
|
||||
itemId: PropTypes.string.isRequired,
|
||||
imageTags: PropTypes.object,
|
||||
iconType: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
CardPotrait.propTypes = {
|
||||
itemName: PropTypes.string.isRequired,
|
||||
itemId: PropTypes.string.isRequired,
|
||||
imageTags: PropTypes.object,
|
||||
imageTags: PropTypes.bool,
|
||||
iconType: PropTypes.string.isRequired,
|
||||
cardType: PropTypes.string,
|
||||
subText: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
playedPercent: PropTypes.number,
|
||||
cardOrientation: PropTypes.string.isRequired,
|
||||
onClickEvent: PropTypes.func,
|
||||
watchedStatus: PropTypes.bool,
|
||||
watchedCount: PropTypes.number,
|
||||
blurhash: PropTypes.string,
|
||||
currentUser: PropTypes.object,
|
||||
favourite: PropTypes.bool,
|
||||
};
|
||||
@@ -1,52 +1,92 @@
|
||||
/** @format */
|
||||
|
||||
.card {
|
||||
margin-right: 1em;
|
||||
|
||||
&.landscape {
|
||||
--image-aspect-ratio: 1.77;
|
||||
border-radius: $border-radius-default;
|
||||
&-media {
|
||||
&-container {
|
||||
position: relative;
|
||||
border-radius: $border-radius-default;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 0 7px rgb(0 0 0 / 0.2);
|
||||
}
|
||||
&-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgb(0 0 0 / 0.6);
|
||||
opacity: 0;
|
||||
transition: opacity $transition-time-default;
|
||||
z-index: 10;
|
||||
}
|
||||
&-image-container {
|
||||
transition: opacity $transition-time-default;
|
||||
}
|
||||
}
|
||||
|
||||
&.portrait {
|
||||
--image-aspect-ratio: 0.65;
|
||||
&Box:hover .card-media-overlay,
|
||||
&Box:focus-within .card-media-overlay,
|
||||
&Box:focus .card-media-overlay {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&-image {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
border-radius: 10px;
|
||||
aspect-ratio: var(--image-aspect-ratio);
|
||||
border-radius: $border-radius-default;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
&-container {
|
||||
position: relative;
|
||||
border-radius: $border-radius-default;
|
||||
overflow: hidden;
|
||||
}
|
||||
&-icon {
|
||||
font-size: 4.5em !important;
|
||||
fill: url(#clr-gradient-default) !important;
|
||||
|
||||
&-container {
|
||||
display: flex;
|
||||
display: flex !important;
|
||||
aspect-ratio: 1.777;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100% !important;
|
||||
color: transparent;
|
||||
background: $clr-gradient-dark;
|
||||
border-radius: 10px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
border-radius: $border-radius-default;
|
||||
color: $clr-accent-default;
|
||||
background: $clr-accent-dark;
|
||||
z-index: 0;
|
||||
height: 100%;
|
||||
z-index: -2;
|
||||
}
|
||||
}
|
||||
&-blurhash {
|
||||
position: absolute !important;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border-radius: $border-radius-default;
|
||||
overflow: hidden;
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
&-text-container {
|
||||
margin-top: 0.5em;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
&-indicator {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 5px;
|
||||
z-index: 10;
|
||||
// border-radius: 100px;
|
||||
background: $clr-gradient-default;
|
||||
box-shadow: 0 0 5px rgb(0 0 0 / 0.4);
|
||||
&-text {
|
||||
aspect-ratio: 1;
|
||||
padding: 5px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,421 @@
|
||||
/** @format */
|
||||
import React, { useState } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
import Divider from "@mui/material/Divider";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Box from "@mui/material/Box";
|
||||
import MuiCard from "@mui/material/Card";
|
||||
import CardContent from "@mui/material/CardContent";
|
||||
import CardMedia from "@mui/material/CardMedia";
|
||||
import CardActionArea from "@mui/material/CardActionArea";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Chip from "@mui/material/Chip";
|
||||
import ButtonGroup from "@mui/material/ButtonGroup";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import { Blurhash } from "react-blurhash";
|
||||
import { green, pink } from "@mui/material/colors";
|
||||
|
||||
import { TypeIconCollectionCard } from "../utils/iconsCollection";
|
||||
|
||||
import { borderRadiusDefault } from "../../palette.module.scss";
|
||||
import "./card.module.scss";
|
||||
import { MdiCheck } from "../icons/mdiCheck";
|
||||
|
||||
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import { MdiHeartOutline } from "../icons/mdiHeartOutline";
|
||||
import { MdiHeart } from "../icons/mdiHeart";
|
||||
import { endsAt, getRuntime } from "../../utils/date/time";
|
||||
import { MdiStarHalfFull } from "../icons/mdiStarHalfFull";
|
||||
|
||||
export const EpisodeCard = ({
|
||||
itemName,
|
||||
itemRating,
|
||||
itemTicks,
|
||||
itemId,
|
||||
imageTags,
|
||||
subText = "",
|
||||
playedPercent,
|
||||
cardProps,
|
||||
onClickEvent,
|
||||
watchedStatus,
|
||||
blurhash,
|
||||
currentUser,
|
||||
favourite,
|
||||
showName,
|
||||
episodeLocation,
|
||||
centerAlignText = false,
|
||||
parentId,
|
||||
}) => {
|
||||
const navigate = useNavigate();
|
||||
const [imgLoaded, setImgLoaded] = useState(false);
|
||||
const [isWatched, setIsWatched] = useState(watchedStatus);
|
||||
const [isFavourite, setIsFavourite] = useState(favourite);
|
||||
const handleMarkAsPlayOrUnMarkAsPlay = async () => {
|
||||
let result;
|
||||
if (!isWatched) {
|
||||
result = await getPlaystateApi(window.api).markPlayedItem({
|
||||
userId: currentUser.Id,
|
||||
itemId: itemId,
|
||||
});
|
||||
} else if (isWatched) {
|
||||
result = await getPlaystateApi(window.api).markUnplayedItem({
|
||||
userId: currentUser.Id,
|
||||
itemId: itemId,
|
||||
});
|
||||
}
|
||||
setIsWatched(result.data.Played);
|
||||
};
|
||||
const handleLiking = async () => {
|
||||
let result;
|
||||
if (isFavourite) {
|
||||
result = await getUserLibraryApi(window.api).unmarkFavoriteItem({
|
||||
userId: currentUser.Id,
|
||||
itemId: itemId,
|
||||
});
|
||||
} else if (!isFavourite) {
|
||||
result = await getUserLibraryApi(window.api).markFavoriteItem({
|
||||
userId: currentUser.Id,
|
||||
itemId: itemId,
|
||||
});
|
||||
}
|
||||
setIsFavourite(result.data.IsFavorite);
|
||||
};
|
||||
|
||||
return (
|
||||
<MuiCard
|
||||
className="card landscape"
|
||||
sx={{
|
||||
background: "transparent",
|
||||
borderRadius: borderRadiusDefault,
|
||||
mr: 1,
|
||||
mb: 0.5,
|
||||
}}
|
||||
elevation={0}
|
||||
{...cardProps}
|
||||
>
|
||||
<CardActionArea
|
||||
sx={{ p: "1px" }}
|
||||
component="div"
|
||||
onClick={
|
||||
!!onClickEvent
|
||||
? onClickEvent
|
||||
: () => {
|
||||
navigate(`/item/${itemId}`);
|
||||
}
|
||||
}
|
||||
className="cardBox"
|
||||
>
|
||||
<Box
|
||||
className="card-media-container"
|
||||
sx={{
|
||||
position: "relative",
|
||||
m: 1,
|
||||
aspectRatio: "1.777",
|
||||
}}
|
||||
>
|
||||
<>
|
||||
<Chip
|
||||
className="card-indicator"
|
||||
label={<MdiCheck />}
|
||||
sx={{
|
||||
transition: "opacity 150ms",
|
||||
opacity: isWatched ? 1 : 0,
|
||||
}}
|
||||
/>
|
||||
<Box
|
||||
className="card-media-image-container"
|
||||
sx={{
|
||||
opacity: imgLoaded ? 1 : 0,
|
||||
transition: "opacity 250ms",
|
||||
}}
|
||||
>
|
||||
{imageTags && (
|
||||
<CardMedia
|
||||
component="img"
|
||||
image={
|
||||
window.api.basePath +
|
||||
"/Items/" +
|
||||
itemId +
|
||||
"/Images/Primary?fillHeight=300&fillWidth=532&quality=96"
|
||||
}
|
||||
alt={itemName}
|
||||
sx={{
|
||||
width: "100%",
|
||||
aspectRatio: "1.777",
|
||||
borderRadius:
|
||||
borderRadiusDefault,
|
||||
overflow: "hidden",
|
||||
}}
|
||||
onLoad={() => setImgLoaded(true)}
|
||||
className="card-image"
|
||||
></CardMedia>
|
||||
)}
|
||||
</Box>
|
||||
{!!blurhash && (
|
||||
<Blurhash
|
||||
hash={blurhash}
|
||||
width="100%"
|
||||
height="100%"
|
||||
resolutionX={12}
|
||||
resolutionY={18}
|
||||
style={{
|
||||
aspectRatio: "1.777",
|
||||
}}
|
||||
className="card-image-blurhash"
|
||||
/>
|
||||
)}
|
||||
<div className="card-image-icon-container">
|
||||
{TypeIconCollectionCard["Episode"]}
|
||||
</div>
|
||||
{!!playedPercent && (
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
value={playedPercent}
|
||||
sx={{
|
||||
width: "90%",
|
||||
position: "absolute",
|
||||
left: "5%",
|
||||
bottom: "5%",
|
||||
borderRadius: "100px",
|
||||
height: "5px",
|
||||
}}
|
||||
color="white"
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
<Box
|
||||
className="card-media-overlay"
|
||||
sx={{
|
||||
display: "flex",
|
||||
alignItems: "flex-end",
|
||||
justifyContent: "flex-end",
|
||||
p: 1,
|
||||
}}
|
||||
>
|
||||
<ButtonGroup>
|
||||
<IconButton
|
||||
onMouseDown={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
handleMarkAsPlayOrUnMarkAsPlay();
|
||||
}}
|
||||
>
|
||||
<MdiCheck
|
||||
sx={{
|
||||
color: isWatched
|
||||
? green[200]
|
||||
: "white",
|
||||
}}
|
||||
/>
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onMouseDown={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
handleLiking();
|
||||
}}
|
||||
>
|
||||
{isFavourite ? (
|
||||
<MdiHeart
|
||||
sx={{ color: pink[700] }}
|
||||
/>
|
||||
) : (
|
||||
<MdiHeartOutline />
|
||||
)}
|
||||
</IconButton>
|
||||
</ButtonGroup>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
<CardContent
|
||||
className="card-text-container"
|
||||
sx={{
|
||||
padding: "0 0.5em",
|
||||
alignItems: "flex-start",
|
||||
backgroundColor: "transparent",
|
||||
}}
|
||||
>
|
||||
{!!showName && (
|
||||
<>
|
||||
<Typography
|
||||
gutterBottom={false}
|
||||
variant="h5"
|
||||
component="div"
|
||||
color="white"
|
||||
fontWeight={500}
|
||||
textAlign="left"
|
||||
noWrap
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
navigate(`/item/${parentId}`);
|
||||
}}
|
||||
sx={{
|
||||
"&:hover": {
|
||||
textDecoration: "underline",
|
||||
},
|
||||
}}
|
||||
>
|
||||
{showName}
|
||||
{" - "}
|
||||
{episodeLocation}
|
||||
</Typography>
|
||||
</>
|
||||
)}
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
opacity: !!showName ? 0.75 : 1,
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
}}
|
||||
width="100%"
|
||||
mb={0.5}
|
||||
mt={0.5}
|
||||
>
|
||||
<Typography
|
||||
gutterBottom={false}
|
||||
variant="h6"
|
||||
component="div"
|
||||
color="white"
|
||||
fontWeight={500}
|
||||
textAlign={
|
||||
centerAlignText ? "center" : "left"
|
||||
}
|
||||
noWrap
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
>
|
||||
{itemName}
|
||||
</Typography>
|
||||
{!!itemTicks && (
|
||||
<Typography
|
||||
gutterBottom={false}
|
||||
variant="h6"
|
||||
component="div"
|
||||
color="white"
|
||||
fontWeight={300}
|
||||
textAlign="left"
|
||||
noWrap
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
sx={{
|
||||
opacity: 0.65,
|
||||
flexShrink: 0,
|
||||
}}
|
||||
>
|
||||
{getRuntime(itemTicks)}
|
||||
</Typography>
|
||||
)}
|
||||
</Box>
|
||||
<Stack
|
||||
alignItems="flex-start"
|
||||
width="100%"
|
||||
direction="row"
|
||||
gap={1}
|
||||
divider={
|
||||
<Divider
|
||||
flexItem
|
||||
orientation="vertical"
|
||||
variant="middle"
|
||||
/>
|
||||
}
|
||||
mb={1}
|
||||
>
|
||||
{!!itemRating && (
|
||||
<Typography
|
||||
gutterBottom={false}
|
||||
variant="subtitle1"
|
||||
component="div"
|
||||
color="white"
|
||||
fontWeight={300}
|
||||
textAlign="left"
|
||||
noWrap
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
sx={{
|
||||
opacity: 0.65,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-start",
|
||||
}}
|
||||
>
|
||||
<MdiStarHalfFull
|
||||
sx={{
|
||||
fontSize: "1.2em",
|
||||
mr: "0.25em",
|
||||
}}
|
||||
/>{" "}
|
||||
{Math.round(itemRating * 10) / 10}
|
||||
</Typography>
|
||||
)}
|
||||
{!!itemTicks && (
|
||||
<Typography
|
||||
gutterBottom={false}
|
||||
variant="subtitle1"
|
||||
component="div"
|
||||
color="white"
|
||||
fontWeight={300}
|
||||
textAlign="left"
|
||||
noWrap
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
sx={{
|
||||
opacity: 0.65,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-start",
|
||||
}}
|
||||
>
|
||||
{endsAt(itemTicks)}
|
||||
</Typography>
|
||||
)}
|
||||
</Stack>
|
||||
<Typography
|
||||
gutterBottom
|
||||
variant="body2"
|
||||
component="div"
|
||||
color="white"
|
||||
textAlign="left"
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
sx={{
|
||||
display: "-webkit-box",
|
||||
overflow: "hidden",
|
||||
WebkitBoxOrient: "vertical",
|
||||
WebkitLineClamp: 3,
|
||||
opacity: 0.45,
|
||||
}}
|
||||
>
|
||||
{subText}
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</CardActionArea>
|
||||
</MuiCard>
|
||||
);
|
||||
};
|
||||
|
||||
EpisodeCard.propTypes = {
|
||||
itemName: PropTypes.string.isRequired,
|
||||
itemId: PropTypes.string.isRequired,
|
||||
imageTags: PropTypes.bool,
|
||||
subText: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
playedPercent: PropTypes.number,
|
||||
onClickEvent: PropTypes.func,
|
||||
watchedStatus: PropTypes.bool,
|
||||
blurhash: PropTypes.string,
|
||||
currentUser: PropTypes.object,
|
||||
favourite: PropTypes.bool,
|
||||
showName: PropTypes.string,
|
||||
episodeLocation: PropTypes.string,
|
||||
itemTicks: PropTypes.number,
|
||||
itemRating: PropTypes.number,
|
||||
centerAlignText: PropTypes.bool,
|
||||
parentId: PropTypes.any,
|
||||
};
|
||||
@@ -1,83 +1,106 @@
|
||||
/** @format */
|
||||
|
||||
import { useRef, useEffect } from "react";
|
||||
import { useState } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import Carousel from "react-multi-carousel";
|
||||
import "react-multi-carousel/lib/styles.css";
|
||||
|
||||
import ChevronLeft from "mdi-material-ui/ChevronLeft";
|
||||
import ChevronRight from "mdi-material-ui/ChevronRight";
|
||||
import { MdiChevronLeft } from "../icons/mdiChevronLeft";
|
||||
import { MdiChevronRight } from "../icons/mdiChevronRight";
|
||||
|
||||
import { styled } from "@mui/material/styles";
|
||||
import Button from "@mui/material/Button";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import ButtonGroup from "@mui/material/ButtonGroup";
|
||||
|
||||
import "./cardScroller.module.scss";
|
||||
|
||||
const CarouselButton = styled(Button)(() => ({
|
||||
color: "white",
|
||||
height: "100%",
|
||||
}));
|
||||
|
||||
const SliderButtonRight = ({ onClick }) => {
|
||||
return (
|
||||
<CarouselButton
|
||||
onClick={() => onClick()}
|
||||
className="card-scroller-button right"
|
||||
variant="text"
|
||||
>
|
||||
<ChevronRight />
|
||||
</CarouselButton>
|
||||
);
|
||||
};
|
||||
|
||||
const SliderButtonLeft = ({ onClick }) => {
|
||||
return (
|
||||
<CarouselButton
|
||||
onClick={() => onClick()}
|
||||
className="card-scroller-button left"
|
||||
variant="text"
|
||||
>
|
||||
<ChevronLeft />
|
||||
</CarouselButton>
|
||||
);
|
||||
};
|
||||
|
||||
export const CardScroller = ({ children, displayCards }) => {
|
||||
export const CardScroller = ({
|
||||
children,
|
||||
displayCards,
|
||||
title,
|
||||
headingProps,
|
||||
disableDecoration = false,
|
||||
boxProps,
|
||||
}) => {
|
||||
const responsive = {
|
||||
superLargeDesktop: {
|
||||
// the naming can be any, depends on you.
|
||||
breakpoint: { max: 4000, min: 3000 },
|
||||
items: displayCards + 1,
|
||||
slidesToSlide: displayCards + 1,
|
||||
},
|
||||
desktop: {
|
||||
breakpoint: { max: 3000, min: 1024 },
|
||||
breakpoint: { max: 3000, min: 625 },
|
||||
items: displayCards,
|
||||
slidesToSlide: displayCards, // optional, default to 1.
|
||||
},
|
||||
tablet: {
|
||||
breakpoint: { max: 1024, min: 464 },
|
||||
items: displayCards - 1,
|
||||
slidesToSlide: displayCards - 1, // optional, default to 1.
|
||||
},
|
||||
mobile: {
|
||||
breakpoint: { max: 464, min: 0 },
|
||||
breakpoint: { max: 624, min: 464 },
|
||||
items: displayCards - 2,
|
||||
slidesToSlide: displayCards - 2, // optional, default to 1.
|
||||
},
|
||||
mobile: {
|
||||
breakpoint: { max: 464, min: 0 },
|
||||
items: displayCards - 5,
|
||||
slidesToSlide: displayCards - 5, // optional, default to 1.
|
||||
},
|
||||
};
|
||||
|
||||
const [carouselRef, setCarouselRef] = useState();
|
||||
|
||||
return (
|
||||
<Carousel
|
||||
swipeable={false}
|
||||
draggable={false}
|
||||
responsive={responsive}
|
||||
arrows={true}
|
||||
customRightArrow={<SliderButtonRight />}
|
||||
customLeftArrow={<SliderButtonLeft />}
|
||||
className="card-scroller"
|
||||
>
|
||||
{children}
|
||||
</Carousel>
|
||||
<Box {...boxProps} className="card-scroller-container" mb={1}>
|
||||
<Box
|
||||
sx={{ mb: 1 }}
|
||||
className={
|
||||
disableDecoration
|
||||
? `card-scroller-header-container hidden-decoration`
|
||||
: `card-scroller-header-container`
|
||||
}
|
||||
>
|
||||
<Typography
|
||||
variant="h4"
|
||||
color="textPrimary"
|
||||
className="card-scroller-heading"
|
||||
{...headingProps}
|
||||
>
|
||||
<div className="card-scroller-heading-decoration"></div>{" "}
|
||||
{title}
|
||||
</Typography>
|
||||
<ButtonGroup className="card-scroller-button-group">
|
||||
<IconButton
|
||||
className="card-scroller-button"
|
||||
onClick={() => carouselRef.previous()}
|
||||
>
|
||||
<MdiChevronLeft />
|
||||
</IconButton>
|
||||
<IconButton
|
||||
className="card-scroller-button"
|
||||
onClick={() => carouselRef.next()}
|
||||
>
|
||||
<MdiChevronRight />
|
||||
</IconButton>
|
||||
</ButtonGroup>
|
||||
</Box>
|
||||
<Carousel
|
||||
swipeable={false}
|
||||
draggable={false}
|
||||
responsive={responsive}
|
||||
arrows={false}
|
||||
ref={(el) => setCarouselRef(el)}
|
||||
// customButtonGroup={<HomeSectionHeader />}
|
||||
// renderButtonGroupOutside={true}
|
||||
className="card-scroller"
|
||||
>
|
||||
{children}
|
||||
</Carousel>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
CardScroller.propTypes = {
|
||||
displayCards: PropTypes.number.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
headingProps: PropTypes.any,
|
||||
};
|
||||
@@ -7,23 +7,31 @@
|
||||
display: flex;
|
||||
}
|
||||
&-button {
|
||||
color: white;
|
||||
position: absolute !important;
|
||||
top: 49%;
|
||||
transform: translateY(-50%);
|
||||
background-color: $clr-background-dark !important;
|
||||
border-radius: $border-radius-intensity-1 !important;
|
||||
opacity: 0;
|
||||
transition: opacity $transition-time-default !important;
|
||||
&:hover,
|
||||
&:focus {
|
||||
opacity: 1;
|
||||
}
|
||||
&.right {
|
||||
right: 0%;
|
||||
}
|
||||
&.left {
|
||||
left: 0%;
|
||||
aspect-ratio: 1;
|
||||
}
|
||||
&-header-container {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
&-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: 0.35em;
|
||||
position: relative;
|
||||
margin-bottom: 0.25em !important;
|
||||
&-decoration {
|
||||
width: 0.75em;
|
||||
height: 3px;
|
||||
background: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hidden-decoration {
|
||||
.card-scroller-heading-decoration {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
/** @format */
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
||||
import { Card } from "../../components/card/card";
|
||||
import { CardsSkeleton } from "../skeleton/cards";
|
||||
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
|
||||
export const LatestMediaSection = ({ latestMediaLib }) => {
|
||||
const user = useQuery({
|
||||
queryKey: ["home", "user"],
|
||||
queryFn: async () => {
|
||||
let usr = await getUserApi(window.api).getCurrentUser();
|
||||
return usr.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
});
|
||||
const fetchLatestMedia = async (library) => {
|
||||
const media = await getUserLibraryApi(window.api).getLatestMedia({
|
||||
userId: user.data.Id,
|
||||
parentId: library,
|
||||
limit: 16,
|
||||
fields: ["PrimaryImageAspectRatio"],
|
||||
});
|
||||
return media.data;
|
||||
};
|
||||
const data = useQuery({
|
||||
queryKey: ["homeSection, latestMedia", latestMediaLib],
|
||||
queryFn: () => fetchLatestMedia(latestMediaLib[0]),
|
||||
enabled: !!user.data,
|
||||
networkMode: "always",
|
||||
});
|
||||
if (data.isLoading) {
|
||||
return <CardsSkeleton />;
|
||||
}
|
||||
if (data.isSuccess && data.data.length >= 1) {
|
||||
return (
|
||||
<CardScroller
|
||||
displayCards={8}
|
||||
title={"Latest " + latestMediaLib[1]}
|
||||
>
|
||||
{data.data.map((item, index) => {
|
||||
return (
|
||||
<Card
|
||||
key={index}
|
||||
itemName={
|
||||
!!item.SeriesId
|
||||
? item.SeriesName
|
||||
: item.Name
|
||||
}
|
||||
itemId={
|
||||
!!item.SeriesId
|
||||
? item.SeriesId
|
||||
: item.Id
|
||||
}
|
||||
// imageTags={false}
|
||||
imageTags={!!item.ImageTags.Primary}
|
||||
iconType={item.Type}
|
||||
subText={item.ProductionYear}
|
||||
playedPercent={
|
||||
item.UserData.PlayedPercentage
|
||||
}
|
||||
cardOrientation={
|
||||
item.PrimaryImageAspectRatio == 1
|
||||
? "sqaure"
|
||||
: "portait"
|
||||
}
|
||||
watchedStatus={
|
||||
item.Type == BaseItemKind.Audio
|
||||
? false
|
||||
: item.UserData.Played
|
||||
}
|
||||
watchedCount={
|
||||
item.UserData.UnplayedItemCount
|
||||
}
|
||||
blurhash={
|
||||
item.ImageBlurHashes == {}
|
||||
? ""
|
||||
: !!item.ImageTags.Primary
|
||||
? !!item.ImageBlurHashes.Primary
|
||||
? item.ImageBlurHashes
|
||||
.Primary[
|
||||
item.ImageTags
|
||||
.Primary
|
||||
]
|
||||
: ""
|
||||
: ""
|
||||
}
|
||||
currentUser={user.data}
|
||||
favourite={item.UserData.IsFavorite}
|
||||
></Card>
|
||||
);
|
||||
})}
|
||||
</CardScroller>
|
||||
);
|
||||
}
|
||||
|
||||
return <></>;
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
/** @format */
|
||||
|
||||
import { MdiChevronLeft } from "./mdiChevronLeft";
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiAccount } from "@mdi/js";
|
||||
|
||||
export const MdiAccount = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiAccount}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiAccountMusic } from "@mdi/js";
|
||||
|
||||
export const MdiAccountMusic = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiAccountMusic}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiAccountTie } from "@mdi/js";
|
||||
|
||||
export const MdiAccountTie = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiAccountTie}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiAlbum } from "@mdi/js";
|
||||
|
||||
export const MdiAlbum = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiAlbum}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiAlertDecagram } from "@mdi/js";
|
||||
|
||||
export const MdiAlertDecagram = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiAlertDecagram}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -4,9 +4,9 @@ import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiArrowLeft } from "@mdi/js";
|
||||
|
||||
export const MdiArrowLeft = () => {
|
||||
export const MdiArrowLeft = (props) => {
|
||||
return (
|
||||
<SvgIcon>
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiArrowLeft}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiBackburger } from "@mdi/js";
|
||||
|
||||
export const MdiBackburger = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiBackburger}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiBook } from "@mdi/js";
|
||||
|
||||
export const MdiBook = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiBook}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiBookMultiple } from "@mdi/js";
|
||||
|
||||
export const MdiBookMultiple = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiBookMultiple}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiBookMusic } from "@mdi/js";
|
||||
|
||||
export const MdiBookMusic = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiBookMusic}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiCheck } from "@mdi/js";
|
||||
|
||||
export const MdiCheck = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiCheck}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiChevronDown } from "@mdi/js";
|
||||
|
||||
export const MdiChevronDown = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiChevronDown}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiChevronLeft } from "@mdi/js";
|
||||
|
||||
export const MdiChevronLeft = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiChevronLeft}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -4,9 +4,9 @@ import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiChevronRight } from "@mdi/js";
|
||||
|
||||
export const MdiChevronRight = () => {
|
||||
export const MdiChevronRight = (props) => {
|
||||
return (
|
||||
<SvgIcon>
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiChevronRight}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiClockOutline } from "@mdi/js";
|
||||
|
||||
export const MdiClockOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiClockOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiClose } from "@mdi/js";
|
||||
|
||||
export const MdiClose = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiClose}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
/** @format */
|
||||
|
||||
import { MdiChevronLeft } from "./mdiChevronLeft";
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiCog } from "@mdi/js";
|
||||
|
||||
export const MdiCog = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiCog}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiDelete } from "@mdi/js";
|
||||
|
||||
export const MdiDelete = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiDelete}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiDramaMasks } from "@mdi/js";
|
||||
|
||||
export const MdiDramaMasks = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiDramaMasks}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiEmoticonCry } from "@mdi/js";
|
||||
|
||||
export const MdiEmoticonCry = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiEmoticonCry}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiEmoticonCryOutline } from "@mdi/js";
|
||||
|
||||
export const MdiEmoticonCryOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiEmoticonCryOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiEmoticonDead } from "@mdi/js";
|
||||
|
||||
export const MdiEmoticonDead = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiEmoticonDead}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -4,9 +4,9 @@ import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiEyeOffOutline } from "@mdi/js";
|
||||
|
||||
export const MdiEyeOffOutline = () => {
|
||||
export const MdiEyeOffOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon>
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiEyeOffOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
|
||||
@@ -4,9 +4,9 @@ import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiEyeOutline } from "@mdi/js";
|
||||
|
||||
export const MdiEyeOutline = () => {
|
||||
export const MdiEyeOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon>
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiEyeOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiFastForward } from "@mdi/js";
|
||||
|
||||
export const MdiFastForward = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFastForward}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiFilmstrip } from "@mdi/js";
|
||||
|
||||
export const MdiFilmstrip = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFilmstrip}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiFilterOutline } from "@mdi/js";
|
||||
|
||||
export const MdiFilterOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFilterOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiFolderMultiple } from "@mdi/js";
|
||||
|
||||
export const MdiFolderMultiple = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFolderMultiple}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiFolderMusicOutline } from "@mdi/js";
|
||||
|
||||
export const MdiFolderMusicOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFolderMusicOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiFolderOutline } from "@mdi/js";
|
||||
|
||||
export const MdiFolderOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFolderOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiFullscreen } from "@mdi/js";
|
||||
|
||||
export const MdiFullscreen = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFullscreen}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiFullscreenExit } from "@mdi/js";
|
||||
|
||||
export const MdiFullscreenExit = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiFullscreenExit}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiHeart } from "@mdi/js";
|
||||
|
||||
export const MdiHeart = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiHeart}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiHeartOutline } from "@mdi/js";
|
||||
|
||||
export const MdiHeartOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiHeartOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiHomeVariantOutline } from "@mdi/js";
|
||||
|
||||
export const MdiHomeVariantOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiHomeVariantOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiImage } from "@mdi/js";
|
||||
|
||||
export const MdiImage = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiImage}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiImageMultiple } from "@mdi/js";
|
||||
|
||||
export const MdiImageMultiple = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiImageMultiple}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiInformation } from "@mdi/js";
|
||||
|
||||
export const MdiInformation = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiInformation}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiLogoutVariant } from "@mdi/js";
|
||||
|
||||
export const MdiLogoutVariant = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiLogoutVariant}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiMagnify } from "@mdi/js";
|
||||
|
||||
export const MdiMagnify = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiMagnify}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiMenu } from "@mdi/js";
|
||||
|
||||
export const MdiMenu = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiMenu}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiMicrophone } from "@mdi/js";
|
||||
|
||||
export const MdiMicrophone = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiMicrophone}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiMovieOutline } from "@mdi/js";
|
||||
|
||||
export const MdiMovieOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiMovieOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiMultimedia } from "@mdi/js";
|
||||
|
||||
export const MdiMultimedia = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiMultimedia}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiMusic } from "@mdi/js";
|
||||
|
||||
export const MdiMusic = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiMusic}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiMusicBoxMultipleOutline } from "@mdi/js";
|
||||
|
||||
export const MdiMusicBoxMultipleOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiMusicBoxMultipleOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiPause } from "@mdi/js";
|
||||
|
||||
export const MdiPause = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiPause}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiPictureInPictureBottomRight } from "@mdi/js";
|
||||
|
||||
export const MdiPictureInPictureBottomRight = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiPictureInPictureBottomRight}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiPlay } from "@mdi/js";
|
||||
|
||||
export const MdiPlay = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiPlay}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiPlayBoxMultiple } from "@mdi/js";
|
||||
|
||||
export const MdiPlayBoxMultiple = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiPlayBoxMultiple}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiPlayOutline } from "@mdi/js";
|
||||
|
||||
export const MdiPlayOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiPlayOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiPlaySpeed } from "@mdi/js";
|
||||
|
||||
export const MdiPlaySpeed = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiPlaySpeed}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiPlaylistMusicOutline } from "@mdi/js";
|
||||
|
||||
export const MdiPlaylistMusicOutline = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiPlaylistMusicOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiRewind } from "@mdi/js";
|
||||
|
||||
export const MdiRewind = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiRewind}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiSortAscending } from "@mdi/js";
|
||||
|
||||
export const MdiSortAscending = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiSortAscending}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiSortDescending } from "@mdi/js";
|
||||
|
||||
export const MdiSortDescending = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiSortDescending}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiStar } from "@mdi/js";
|
||||
|
||||
export const MdiStar = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiStar}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiStarHalfFull } from "@mdi/js";
|
||||
|
||||
export const MdiStarHalfFull = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiStarHalfFull}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiTelevision } from "@mdi/js";
|
||||
|
||||
export const MdiTelevision = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiTelevision}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiTelevisionClassic } from "@mdi/js";
|
||||
|
||||
export const MdiTelevisionClassic = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiTelevisionClassic}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiVolumeHigh } from "@mdi/js";
|
||||
|
||||
export const MdiVolumeHigh = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiVolumeHigh}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiVolumeOff } from "@mdi/js";
|
||||
|
||||
export const MdiVolumeOff = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiVolumeOff}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiYoutube } from "@mdi/js";
|
||||
|
||||
export const MdiYoutube = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiYoutube}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
/** @format */
|
||||
|
||||
.album {
|
||||
&-image-icon {
|
||||
fill: url(#clr-gradient-default) !important;
|
||||
|
||||
&-container {
|
||||
background: $clr-gradient-dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
/** @format */
|
||||
import { useState } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import TableContainer from "@mui/material/TableContainer";
|
||||
import Table from "@mui/material/Table";
|
||||
import TableBody from "@mui/material/TableBody";
|
||||
import TableHead from "@mui/material/TableHead";
|
||||
import TableRow from "@mui/material/TableRow";
|
||||
import TableCell from "@mui/material/TableCell";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import MuiLink from "@mui/material/Link";
|
||||
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
|
||||
import { getRuntimeMusic } from "../../../utils/date/time";
|
||||
|
||||
import { MdiClockOutline } from "../../icons/mdiClockOutline";
|
||||
import { MdiHeart } from "../../icons/mdiHeart";
|
||||
import { MdiHeartOutline } from "../../icons/mdiHeartOutline";
|
||||
import { MdiAlbum } from "../../icons/mdiAlbum";
|
||||
|
||||
import "./albumArtist.scss";
|
||||
|
||||
export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||
const albumTracks = useQuery({
|
||||
queryKey: ["artist", "album", album.Id],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(window.api).getItems({
|
||||
userId: user.Id,
|
||||
parentId: album.Id,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const handleLikingTrack = async (track) => {
|
||||
let result;
|
||||
if (track.UserData.IsFavorite) {
|
||||
result = await getUserLibraryApi(window.api).unmarkFavoriteItem({
|
||||
userId: user.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);
|
||||
|
||||
return (
|
||||
<Box sx={{ mb: 6 }} {...boxProps}>
|
||||
<Stack direction="row" gap={3} mb={3}>
|
||||
{!!album.ImageTags?.Primary && (
|
||||
<Box
|
||||
className="album-image"
|
||||
sx={{
|
||||
aspectRatio: 1,
|
||||
borderRadius: "10px",
|
||||
overflow: "hidden",
|
||||
width: "12em",
|
||||
boxShadow: "0 0 10px rgb(0 0 0 /0.2)",
|
||||
position: "relative",
|
||||
height: "12em",
|
||||
}}
|
||||
>
|
||||
<img
|
||||
src={`${window.api.basePath}/Items/${album.Id}/Images/Primary?fillHeight=532&fillWidth=532&quality=96`}
|
||||
style={{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
objectFit: "cover",
|
||||
opacity: imgLoaded ? 1 : 0,
|
||||
transition: "opacity 250ms",
|
||||
position: "relative",
|
||||
zIndex: 2,
|
||||
}}
|
||||
onLoad={() => setImgLoaded(true)}
|
||||
/>
|
||||
<Box
|
||||
className="album-image-icon-container"
|
||||
sx={{
|
||||
position: "absolute",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
top: 0,
|
||||
left: 0,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
zIndex: 1,
|
||||
}}
|
||||
>
|
||||
<MdiAlbum
|
||||
className="album-image-icon"
|
||||
sx={{ fontSize: "6em" }}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
)}
|
||||
<Stack>
|
||||
<Typography
|
||||
variant="h5"
|
||||
sx={{ opacity: `0.7`, mb: 1 }}
|
||||
>
|
||||
{album.ProductionYear}
|
||||
</Typography>
|
||||
<MuiLink
|
||||
component={Link}
|
||||
to={`/item/${album.Id}`}
|
||||
variant="h3"
|
||||
color="inherit"
|
||||
underline="hover"
|
||||
>
|
||||
{album.Name}
|
||||
</MuiLink>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
<TableContainer
|
||||
component={Paper}
|
||||
sx={{ mb: 2, borderRadius: "15px" }}
|
||||
>
|
||||
<Table>
|
||||
<TableHead
|
||||
sx={{
|
||||
mb: 1,
|
||||
}}
|
||||
>
|
||||
<TableRow>
|
||||
<TableCell
|
||||
sx={{
|
||||
maxWidth: 120,
|
||||
width: 20,
|
||||
}}
|
||||
>
|
||||
<Typography variant="h6">#</Typography>
|
||||
</TableCell>
|
||||
<TableCell sx={{ width: 20 }}></TableCell>
|
||||
<TableCell>
|
||||
<Typography variant="h6">
|
||||
Name
|
||||
</Typography>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Typography variant="h6" align="right">
|
||||
<MdiClockOutline />
|
||||
</Typography>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{albumTracks.isSuccess &&
|
||||
albumTracks.data.Items.map(
|
||||
(mitem, mindex) => {
|
||||
return (
|
||||
<TableRow
|
||||
key={mindex}
|
||||
sx={{
|
||||
"&:last-child td, &:last-child th":
|
||||
{
|
||||
border: 0,
|
||||
},
|
||||
"&:hover": {
|
||||
background:
|
||||
"rgb(255 255 255 / 0.05)",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<TableCell
|
||||
sx={{
|
||||
maxWidth: 120,
|
||||
width: 20,
|
||||
}}
|
||||
>
|
||||
<Typography variant="body1">
|
||||
{
|
||||
mitem.IndexNumber
|
||||
}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
<TableCell
|
||||
sx={{
|
||||
width: 20,
|
||||
}}
|
||||
align="center"
|
||||
>
|
||||
<IconButton
|
||||
onClick={() =>
|
||||
handleLikingTrack(
|
||||
mitem,
|
||||
)
|
||||
}
|
||||
>
|
||||
{mitem.UserData
|
||||
.IsFavorite ? (
|
||||
<MdiHeart />
|
||||
) : (
|
||||
<MdiHeartOutline />
|
||||
)}
|
||||
</IconButton>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Typography variant="body1">
|
||||
{mitem.Name}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
<TableCell align="right">
|
||||
<Typography variant="body1">
|
||||
{getRuntimeMusic(
|
||||
mitem.RunTimeTicks,
|
||||
)}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
);
|
||||
},
|
||||
)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,453 @@
|
||||
/** @format */
|
||||
import { useEffect, useState } from "react";
|
||||
import { delUser } from "../../utils/storage/user";
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
|
||||
import { useNavigate, NavLink, useLocation } from "react-router-dom";
|
||||
|
||||
import { theme } from "../../theme";
|
||||
|
||||
import { styled } from "@mui/material/styles";
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
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 ListItemText from "@mui/material/ListItemText";
|
||||
|
||||
import { MdiClose } from "../icons/mdiClose";
|
||||
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 { useDrawerStore } from "../../utils/store/drawer";
|
||||
|
||||
const drawerWidth = 320;
|
||||
|
||||
const DrawerHeader = styled("div")(({ theme }) => ({
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-end",
|
||||
padding: theme.spacing(0, 1),
|
||||
...theme.mixins.toolbar,
|
||||
}));
|
||||
|
||||
const MiniDrawer = styled(MuiDrawer, {
|
||||
shouldForwardProp: (prop) => prop !== "open",
|
||||
})(({ theme }) => ({
|
||||
flexShrink: 0,
|
||||
whiteSpace: "nowrap",
|
||||
boxSizing: "border-box",
|
||||
backgroundColor: theme.palette.primary.background.dark,
|
||||
overflowX: "hidden",
|
||||
}));
|
||||
|
||||
export const SideMenu = ({}) => {
|
||||
const location = useLocation();
|
||||
|
||||
const [display, setDisplay] = useState(false);
|
||||
|
||||
const navigate = useNavigate();
|
||||
const user = useQuery({
|
||||
queryKey: ["user"],
|
||||
queryFn: async () => {
|
||||
let usr = await getUserApi(window.api).getCurrentUser();
|
||||
return usr.data;
|
||||
},
|
||||
enabled: display,
|
||||
networkMode: "always",
|
||||
});
|
||||
let libraries = useQuery({
|
||||
queryKey: ["libraries"],
|
||||
queryFn: async () => {
|
||||
let libs = await getUserViewsApi(window.api).getUserViews({
|
||||
userId: user.data.Id,
|
||||
});
|
||||
return libs.data;
|
||||
},
|
||||
enabled: !!user.data,
|
||||
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(() => {
|
||||
if (
|
||||
location.pathname.includes("login") ||
|
||||
location.pathname.includes("setup") ||
|
||||
location.pathname.includes("player") ||
|
||||
location.pathname === "/"
|
||||
) {
|
||||
setDisplay(false);
|
||||
} else {
|
||||
setDisplay(true);
|
||||
}
|
||||
}, [location]);
|
||||
|
||||
const [open, setDrawerOpen] = useDrawerStore((state) => [
|
||||
state.open,
|
||||
state.setOpen,
|
||||
]);
|
||||
|
||||
if (!display) {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
if (display) {
|
||||
return (
|
||||
<>
|
||||
<MiniDrawer
|
||||
variant="permanent"
|
||||
open={false}
|
||||
PaperProps={{
|
||||
sx: {
|
||||
backgroundColor: "inherit",
|
||||
border: "none",
|
||||
width: `calc(${theme.spacing(7)} + 10px)`,
|
||||
height: "100vh",
|
||||
zIndex: "1",
|
||||
// display: visible ? "block" : "none",
|
||||
},
|
||||
}}
|
||||
sx={{
|
||||
width: `calc(${theme.spacing(7)} + 10px)`,
|
||||
background: theme.palette.background.paper,
|
||||
}}
|
||||
>
|
||||
<DrawerHeader
|
||||
className="Mui-DrawerHeader"
|
||||
sx={{
|
||||
justifyContent: "center",
|
||||
}}
|
||||
></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,
|
||||
display: "flex",
|
||||
flexDirection:
|
||||
"column",
|
||||
}}
|
||||
>
|
||||
<ListItemIcon
|
||||
sx={{
|
||||
minWidth: 0,
|
||||
justifyContent:
|
||||
"center",
|
||||
}}
|
||||
>
|
||||
{
|
||||
MediaCollectionTypeIconCollection[
|
||||
library
|
||||
.CollectionType
|
||||
]
|
||||
}
|
||||
</ListItemIcon>
|
||||
</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,
|
||||
display: "flex",
|
||||
flexDirection:
|
||||
"column",
|
||||
}}
|
||||
>
|
||||
<ListItemIcon
|
||||
sx={{
|
||||
minWidth: 0,
|
||||
justifyContent:
|
||||
"center",
|
||||
}}
|
||||
>
|
||||
<MdiHomeVariantOutline />
|
||||
</ListItemIcon>
|
||||
</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",
|
||||
}}
|
||||
>
|
||||
<MdiLogoutVariant></MdiLogoutVariant>
|
||||
</ListItemIcon>
|
||||
</ListItemButton>
|
||||
</ListItem>
|
||||
</Tooltip>
|
||||
</List>
|
||||
</>
|
||||
)}
|
||||
</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,
|
||||
}}
|
||||
>
|
||||
<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>
|
||||
</>
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
/** @format */
|
||||
|
||||
.sidemenu {
|
||||
&-item {
|
||||
position: relative;
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 15%;
|
||||
bottom: 15%;
|
||||
left: 7%;
|
||||
width: 5px;
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(
|
||||
135deg,
|
||||
$clr-accent-default,
|
||||
$clr-secondary-default
|
||||
);
|
||||
opacity: 0;
|
||||
transform: translateX(-10px);
|
||||
transition: transform $transition-time-default,
|
||||
opacity $transition-time-default;
|
||||
}
|
||||
&.active::before {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
&-open {
|
||||
.sidemenu-item::before {
|
||||
width: 100%;
|
||||
inset: 0;
|
||||
border-radius: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/** @format */
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import { MdiEmoticonCry } from "../../icons/mdiEmoticonCry";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
export const EmptyNotice = () => {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
width: "100%",
|
||||
height: "100vh",
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
flexFlow: "column",
|
||||
opacity: 0.2,
|
||||
}}
|
||||
>
|
||||
<MdiEmoticonCry sx={{ fontSize: 200 }} />
|
||||
<Typography variant="h3">Nothing found</Typography>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
/** @format */
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { MdiEmoticonDead } from "../../icons/mdiEmoticonDead";
|
||||
|
||||
export const ErrorNotice = () => {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
width: "100%",
|
||||
height: "100vh",
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
flexFlow: "column",
|
||||
opacity: 0.2,
|
||||
}}
|
||||
>
|
||||
<MdiEmoticonDead sx={{ fontSize: 200 }} />
|
||||
<Typography variant="h3">Something went wrong</Typography>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||