Compare commits
28
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
No files matched your search
@@ -30,3 +30,8 @@
|
|||||||
# 📃 Roadmap:
|
# 📃 Roadmap:
|
||||||
- Checkout [GitHub Project](https://github.com/users/prayag17/projects/3)
|
- Checkout [GitHub Project](https://github.com/users/prayag17/projects/3)
|
||||||
> **Note** : There is no current due date for alpha 1 release
|
> **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
|
||||||
Generated
+126
-77
@@ -15,7 +15,7 @@
|
|||||||
"@jellyfin/sdk": "^0.7.0",
|
"@jellyfin/sdk": "^0.7.0",
|
||||||
"@mdi/js": "^7.2.96",
|
"@mdi/js": "^7.2.96",
|
||||||
"@mui/lab": "^5.0.0-alpha.124",
|
"@mui/lab": "^5.0.0-alpha.124",
|
||||||
"@mui/material": "^5.11.14",
|
"@mui/material": "^5.11.15",
|
||||||
"@reduxjs/toolkit": "^1.9.3",
|
"@reduxjs/toolkit": "^1.9.3",
|
||||||
"@tanstack/react-query": "^4.26.1",
|
"@tanstack/react-query": "^4.26.1",
|
||||||
"@tanstack/react-query-devtools": "^4.28.0",
|
"@tanstack/react-query-devtools": "^4.28.0",
|
||||||
@@ -30,10 +30,10 @@
|
|||||||
"react-cookie": "^4.1.1",
|
"react-cookie": "^4.1.1",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-material-ui-carousel": "^3.4.2",
|
"react-material-ui-carousel": "^3.4.2",
|
||||||
"react-multi-carousel": "^2.8.2",
|
"react-multi-carousel": "^2.8.3",
|
||||||
"react-parallax": "^3.5.1",
|
"react-parallax": "^3.5.1",
|
||||||
"react-redux": "^8.0.5",
|
"react-redux": "^8.0.5",
|
||||||
"react-router-dom": "^6.9.0",
|
"react-router-dom": "^6.10.0",
|
||||||
"redux": "^4.2.1",
|
"redux": "^4.2.1",
|
||||||
"sort-by": "^1.2.0",
|
"sort-by": "^1.2.0",
|
||||||
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
|
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
|
||||||
@@ -42,10 +42,10 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tauri-apps/cli": "^1.2.2",
|
"@tauri-apps/cli": "^1.2.2",
|
||||||
"@types/react": "^18.0.24",
|
"@types/react": "^18.0.32",
|
||||||
"@types/react-dom": "^18.0.8",
|
"@types/react-dom": "^18.0.8",
|
||||||
"@vitejs/plugin-react": "^3.1.0",
|
"@vitejs/plugin-react": "^3.1.0",
|
||||||
"sass": "^1.59.3",
|
"sass": "^1.60.0",
|
||||||
"vite": "^4.2.1"
|
"vite": "^4.2.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -950,9 +950,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mui/core-downloads-tracker": {
|
"node_modules/@mui/core-downloads-tracker": {
|
||||||
"version": "5.11.14",
|
"version": "5.11.15",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.11.14.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.11.15.tgz",
|
||||||
"integrity": "sha512-rfc08z6+3Fif+Gopx2/qmk+MEQlwYeA+gOcSK048BHkTty/ol/boHuVeL2BNC/cf9OVRjJLYHtVb/DeW791LSQ==",
|
"integrity": "sha512-Q0e2oBsjHyIWWj1wLzl14btunvBYC0yl+px7zL9R69tF87uenj6q72ieS369BJ6jxYpJwvXfR6/f+TC+ZUsKKg==",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
"url": "https://opencollective.com/mui"
|
"url": "https://opencollective.com/mui"
|
||||||
@@ -1025,14 +1025,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mui/material": {
|
"node_modules/@mui/material": {
|
||||||
"version": "5.11.14",
|
"version": "5.11.15",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.11.14.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.11.15.tgz",
|
||||||
"integrity": "sha512-uoiUyybmo+M+nYARBygmbXgX6s/hH0NKD56LCAv9XvmdGVoXhEGjOvxI5/Bng6FS3NNybnA8V+rgZW1Z/9OJtA==",
|
"integrity": "sha512-E5RbLq9/OvRKmGyeZawdnmFBCvhKkI/Zqgr0xFqW27TGwKLxObq/BreJc6Uu5Sbv8Fjj34vEAbRx6otfOyxn5w==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.21.0",
|
"@babel/runtime": "^7.21.0",
|
||||||
"@mui/base": "5.0.0-alpha.122",
|
"@mui/base": "5.0.0-alpha.123",
|
||||||
"@mui/core-downloads-tracker": "^5.11.14",
|
"@mui/core-downloads-tracker": "^5.11.15",
|
||||||
"@mui/system": "^5.11.14",
|
"@mui/system": "^5.11.15",
|
||||||
"@mui/types": "^7.2.3",
|
"@mui/types": "^7.2.3",
|
||||||
"@mui/utils": "^5.11.13",
|
"@mui/utils": "^5.11.13",
|
||||||
"@types/react-transition-group": "^4.4.5",
|
"@types/react-transition-group": "^4.4.5",
|
||||||
@@ -1068,6 +1068,38 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@mui/material/node_modules/@mui/base": {
|
||||||
|
"version": "5.0.0-alpha.123",
|
||||||
|
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.123.tgz",
|
||||||
|
"integrity": "sha512-pxzcAfET3I6jvWqS4kijiLMn1OmdMw+mGmDa0SqmDZo3bXXdvLhpCCPqCkULG3UykhvFCOcU5HclOX3JCA+Zhg==",
|
||||||
|
"dependencies": {
|
||||||
|
"@babel/runtime": "^7.21.0",
|
||||||
|
"@emotion/is-prop-valid": "^1.2.0",
|
||||||
|
"@mui/types": "^7.2.3",
|
||||||
|
"@mui/utils": "^5.11.13",
|
||||||
|
"@popperjs/core": "^2.11.7",
|
||||||
|
"clsx": "^1.2.1",
|
||||||
|
"prop-types": "^15.8.1",
|
||||||
|
"react-is": "^18.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/mui"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@types/react": "^17.0.0 || ^18.0.0",
|
||||||
|
"react": "^17.0.0 || ^18.0.0",
|
||||||
|
"react-dom": "^17.0.0 || ^18.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@types/react": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@mui/private-theming": {
|
"node_modules/@mui/private-theming": {
|
||||||
"version": "5.11.13",
|
"version": "5.11.13",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.11.13.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.11.13.tgz",
|
||||||
@@ -1126,9 +1158,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mui/system": {
|
"node_modules/@mui/system": {
|
||||||
"version": "5.11.14",
|
"version": "5.11.15",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.11.14.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.11.15.tgz",
|
||||||
"integrity": "sha512-/MBv5dUoijJNEKEGi5tppIszGN0o2uejmeISi5vl0CLcaQsI1cd+uBgK+JYUP1VWvI/MtkWRLVSWtF2FWhu5Nw==",
|
"integrity": "sha512-vCatoWCTnAPquoNifHbqMCMnOElEbLosVUeW0FQDyjCq+8yMABD9E6iY0s14O7iq1wD+qqU7rFAuDIVvJ/AzzA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.21.0",
|
"@babel/runtime": "^7.21.0",
|
||||||
"@mui/private-theming": "^5.11.13",
|
"@mui/private-theming": "^5.11.13",
|
||||||
@@ -1200,9 +1232,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@popperjs/core": {
|
"node_modules/@popperjs/core": {
|
||||||
"version": "2.11.6",
|
"version": "2.11.7",
|
||||||
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz",
|
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.7.tgz",
|
||||||
"integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==",
|
"integrity": "sha512-Cr4OjIkipTtcXKjAsm8agyleBuDHvxzeBoa1v543lbv1YaIwQjESsVcmjiWiPEbC1FIeHOG/Op9kdCmAmiS3Kw==",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
"url": "https://opencollective.com/popperjs"
|
"url": "https://opencollective.com/popperjs"
|
||||||
@@ -1232,9 +1264,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@remix-run/router": {
|
"node_modules/@remix-run/router": {
|
||||||
"version": "1.4.0",
|
"version": "1.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.5.0.tgz",
|
||||||
"integrity": "sha512-BJ9SxXux8zAg991UmT8slpwpsd31K1dHHbD3Ba4VzD+liLQ4WAMSxQp2d2ZPRPfN0jN2NPRowcSSoM7lCaF08Q==",
|
"integrity": "sha512-bkUDCp8o1MvFO+qxkODcbhSqRa6P2GXgrGZVpt0dCXNW2HCSCqYI0ZoAqEOSAjRWmmlKcYgFvN4B4S+zo/f8kg==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": ">=14"
|
||||||
}
|
}
|
||||||
@@ -1745,9 +1777,9 @@
|
|||||||
"integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w=="
|
"integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/react": {
|
"node_modules/@types/react": {
|
||||||
"version": "18.0.28",
|
"version": "18.0.32",
|
||||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.28.tgz",
|
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.32.tgz",
|
||||||
"integrity": "sha512-RD0ivG1kEztNBdoAK7lekI9M+azSnitIn85h4iOiaLjaTrMjzslhaqCGaI4IyCJ1RljWiLCEu4jyrLLgqxBTew==",
|
"integrity": "sha512-gYGXdtPQ9Cj0w2Fwqg5/ak6BcK3Z15YgjSqtyDizWUfx7mQ8drs0NBUzRRsAdoFVTO8kJ8L2TL8Skm7OFPnLUw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/prop-types": "*",
|
"@types/prop-types": "*",
|
||||||
"@types/scheduler": "*",
|
"@types/scheduler": "*",
|
||||||
@@ -2886,9 +2918,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-multi-carousel": {
|
"node_modules/react-multi-carousel": {
|
||||||
"version": "2.8.2",
|
"version": "2.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/react-multi-carousel/-/react-multi-carousel-2.8.2.tgz",
|
"resolved": "https://registry.npmjs.org/react-multi-carousel/-/react-multi-carousel-2.8.3.tgz",
|
||||||
"integrity": "sha512-M9Y7DfAp8bA/r6yexttU6RLA7uyppje4c0ELRuCHZWswH+u7nr0uVP6qHNPjc4XGOEY1MYFOb5nBg7JvoKutuQ==",
|
"integrity": "sha512-wpHwq9Y/ydX+5yxpW8250jMOtg8NuBVlFrDTuS5/MdN0uD0zFIHxVbXhzzc4WFeQl6bn9ZLo8Fef2Ik5aBRgmw==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
@@ -2950,11 +2982,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-router": {
|
"node_modules/react-router": {
|
||||||
"version": "6.9.0",
|
"version": "6.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.10.0.tgz",
|
||||||
"integrity": "sha512-51lKevGNUHrt6kLuX3e/ihrXoXCa9ixY/nVWRLlob4r/l0f45x3SzBvYJe3ctleLUQQ5fVa4RGgJOTH7D9Umhw==",
|
"integrity": "sha512-Nrg0BWpQqrC3ZFFkyewrflCud9dio9ME3ojHCF/WLsprJVzkq3q3UeEhMCAW1dobjeGbWgjNn/PVF6m46ANxXQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@remix-run/router": "1.4.0"
|
"@remix-run/router": "1.5.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": ">=14"
|
||||||
@@ -2964,12 +2996,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-router-dom": {
|
"node_modules/react-router-dom": {
|
||||||
"version": "6.9.0",
|
"version": "6.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.10.0.tgz",
|
||||||
"integrity": "sha512-/seUAPY01VAuwkGyVBPCn1OXfVbaWGGu4QN9uj0kCPcTyNYgL1ldZpxZUpRU7BLheKQI4Twtl/OW2nHRF1u26Q==",
|
"integrity": "sha512-E5dfxRPuXKJqzwSe/qGcqdwa18QiWC6f3H3cWXM24qj4N0/beCIf/CWTipop2xm7mR0RCS99NnaqPNjHtrAzCg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@remix-run/router": "1.4.0",
|
"@remix-run/router": "1.5.0",
|
||||||
"react-router": "6.9.0"
|
"react-router": "6.10.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": ">=14"
|
||||||
@@ -3077,9 +3109,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/sass": {
|
"node_modules/sass": {
|
||||||
"version": "1.59.3",
|
"version": "1.60.0",
|
||||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.59.3.tgz",
|
"resolved": "https://registry.npmjs.org/sass/-/sass-1.60.0.tgz",
|
||||||
"integrity": "sha512-QCq98N3hX1jfTCoUAsF3eyGuXLsY7BCnCEg9qAact94Yc21npG2/mVOqoDvE0fCbWDqiM4WlcJQla0gWG2YlxQ==",
|
"integrity": "sha512-updbwW6fNb5gGm8qMXzVO7V4sWf7LMXnMly/JEyfbfERbVH46Fn6q02BX7/eHTdKpE7d+oTkMMQpFWNUMfFbgQ==",
|
||||||
"devOptional": true,
|
"devOptional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chokidar": ">=3.0.0 <4.0.0",
|
"chokidar": ">=3.0.0 <4.0.0",
|
||||||
@@ -3906,9 +3938,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@mui/core-downloads-tracker": {
|
"@mui/core-downloads-tracker": {
|
||||||
"version": "5.11.14",
|
"version": "5.11.15",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.11.14.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.11.15.tgz",
|
||||||
"integrity": "sha512-rfc08z6+3Fif+Gopx2/qmk+MEQlwYeA+gOcSK048BHkTty/ol/boHuVeL2BNC/cf9OVRjJLYHtVb/DeW791LSQ=="
|
"integrity": "sha512-Q0e2oBsjHyIWWj1wLzl14btunvBYC0yl+px7zL9R69tF87uenj6q72ieS369BJ6jxYpJwvXfR6/f+TC+ZUsKKg=="
|
||||||
},
|
},
|
||||||
"@mui/icons-material": {
|
"@mui/icons-material": {
|
||||||
"version": "5.11.9",
|
"version": "5.11.9",
|
||||||
@@ -3934,14 +3966,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@mui/material": {
|
"@mui/material": {
|
||||||
"version": "5.11.14",
|
"version": "5.11.15",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.11.14.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.11.15.tgz",
|
||||||
"integrity": "sha512-uoiUyybmo+M+nYARBygmbXgX6s/hH0NKD56LCAv9XvmdGVoXhEGjOvxI5/Bng6FS3NNybnA8V+rgZW1Z/9OJtA==",
|
"integrity": "sha512-E5RbLq9/OvRKmGyeZawdnmFBCvhKkI/Zqgr0xFqW27TGwKLxObq/BreJc6Uu5Sbv8Fjj34vEAbRx6otfOyxn5w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/runtime": "^7.21.0",
|
"@babel/runtime": "^7.21.0",
|
||||||
"@mui/base": "5.0.0-alpha.122",
|
"@mui/base": "5.0.0-alpha.123",
|
||||||
"@mui/core-downloads-tracker": "^5.11.14",
|
"@mui/core-downloads-tracker": "^5.11.15",
|
||||||
"@mui/system": "^5.11.14",
|
"@mui/system": "^5.11.15",
|
||||||
"@mui/types": "^7.2.3",
|
"@mui/types": "^7.2.3",
|
||||||
"@mui/utils": "^5.11.13",
|
"@mui/utils": "^5.11.13",
|
||||||
"@types/react-transition-group": "^4.4.5",
|
"@types/react-transition-group": "^4.4.5",
|
||||||
@@ -3950,6 +3982,23 @@
|
|||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react-is": "^18.2.0",
|
"react-is": "^18.2.0",
|
||||||
"react-transition-group": "^4.4.5"
|
"react-transition-group": "^4.4.5"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@mui/base": {
|
||||||
|
"version": "5.0.0-alpha.123",
|
||||||
|
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.123.tgz",
|
||||||
|
"integrity": "sha512-pxzcAfET3I6jvWqS4kijiLMn1OmdMw+mGmDa0SqmDZo3bXXdvLhpCCPqCkULG3UykhvFCOcU5HclOX3JCA+Zhg==",
|
||||||
|
"requires": {
|
||||||
|
"@babel/runtime": "^7.21.0",
|
||||||
|
"@emotion/is-prop-valid": "^1.2.0",
|
||||||
|
"@mui/types": "^7.2.3",
|
||||||
|
"@mui/utils": "^5.11.13",
|
||||||
|
"@popperjs/core": "^2.11.7",
|
||||||
|
"clsx": "^1.2.1",
|
||||||
|
"prop-types": "^15.8.1",
|
||||||
|
"react-is": "^18.2.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@mui/private-theming": {
|
"@mui/private-theming": {
|
||||||
@@ -3974,9 +4023,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@mui/system": {
|
"@mui/system": {
|
||||||
"version": "5.11.14",
|
"version": "5.11.15",
|
||||||
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.11.14.tgz",
|
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.11.15.tgz",
|
||||||
"integrity": "sha512-/MBv5dUoijJNEKEGi5tppIszGN0o2uejmeISi5vl0CLcaQsI1cd+uBgK+JYUP1VWvI/MtkWRLVSWtF2FWhu5Nw==",
|
"integrity": "sha512-vCatoWCTnAPquoNifHbqMCMnOElEbLosVUeW0FQDyjCq+8yMABD9E6iY0s14O7iq1wD+qqU7rFAuDIVvJ/AzzA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/runtime": "^7.21.0",
|
"@babel/runtime": "^7.21.0",
|
||||||
"@mui/private-theming": "^5.11.13",
|
"@mui/private-theming": "^5.11.13",
|
||||||
@@ -4007,9 +4056,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@popperjs/core": {
|
"@popperjs/core": {
|
||||||
"version": "2.11.6",
|
"version": "2.11.7",
|
||||||
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz",
|
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.7.tgz",
|
||||||
"integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw=="
|
"integrity": "sha512-Cr4OjIkipTtcXKjAsm8agyleBuDHvxzeBoa1v543lbv1YaIwQjESsVcmjiWiPEbC1FIeHOG/Op9kdCmAmiS3Kw=="
|
||||||
},
|
},
|
||||||
"@reduxjs/toolkit": {
|
"@reduxjs/toolkit": {
|
||||||
"version": "1.9.3",
|
"version": "1.9.3",
|
||||||
@@ -4023,9 +4072,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@remix-run/router": {
|
"@remix-run/router": {
|
||||||
"version": "1.4.0",
|
"version": "1.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.5.0.tgz",
|
||||||
"integrity": "sha512-BJ9SxXux8zAg991UmT8slpwpsd31K1dHHbD3Ba4VzD+liLQ4WAMSxQp2d2ZPRPfN0jN2NPRowcSSoM7lCaF08Q=="
|
"integrity": "sha512-bkUDCp8o1MvFO+qxkODcbhSqRa6P2GXgrGZVpt0dCXNW2HCSCqYI0ZoAqEOSAjRWmmlKcYgFvN4B4S+zo/f8kg=="
|
||||||
},
|
},
|
||||||
"@rollup/pluginutils": {
|
"@rollup/pluginutils": {
|
||||||
"version": "5.0.2",
|
"version": "5.0.2",
|
||||||
@@ -4279,9 +4328,9 @@
|
|||||||
"integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w=="
|
"integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w=="
|
||||||
},
|
},
|
||||||
"@types/react": {
|
"@types/react": {
|
||||||
"version": "18.0.28",
|
"version": "18.0.32",
|
||||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.28.tgz",
|
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.32.tgz",
|
||||||
"integrity": "sha512-RD0ivG1kEztNBdoAK7lekI9M+azSnitIn85h4iOiaLjaTrMjzslhaqCGaI4IyCJ1RljWiLCEu4jyrLLgqxBTew==",
|
"integrity": "sha512-gYGXdtPQ9Cj0w2Fwqg5/ak6BcK3Z15YgjSqtyDizWUfx7mQ8drs0NBUzRRsAdoFVTO8kJ8L2TL8Skm7OFPnLUw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/prop-types": "*",
|
"@types/prop-types": "*",
|
||||||
"@types/scheduler": "*",
|
"@types/scheduler": "*",
|
||||||
@@ -5104,9 +5153,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-multi-carousel": {
|
"react-multi-carousel": {
|
||||||
"version": "2.8.2",
|
"version": "2.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/react-multi-carousel/-/react-multi-carousel-2.8.2.tgz",
|
"resolved": "https://registry.npmjs.org/react-multi-carousel/-/react-multi-carousel-2.8.3.tgz",
|
||||||
"integrity": "sha512-M9Y7DfAp8bA/r6yexttU6RLA7uyppje4c0ELRuCHZWswH+u7nr0uVP6qHNPjc4XGOEY1MYFOb5nBg7JvoKutuQ=="
|
"integrity": "sha512-wpHwq9Y/ydX+5yxpW8250jMOtg8NuBVlFrDTuS5/MdN0uD0zFIHxVbXhzzc4WFeQl6bn9ZLo8Fef2Ik5aBRgmw=="
|
||||||
},
|
},
|
||||||
"react-parallax": {
|
"react-parallax": {
|
||||||
"version": "3.5.1",
|
"version": "3.5.1",
|
||||||
@@ -5134,20 +5183,20 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"react-router": {
|
"react-router": {
|
||||||
"version": "6.9.0",
|
"version": "6.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.10.0.tgz",
|
||||||
"integrity": "sha512-51lKevGNUHrt6kLuX3e/ihrXoXCa9ixY/nVWRLlob4r/l0f45x3SzBvYJe3ctleLUQQ5fVa4RGgJOTH7D9Umhw==",
|
"integrity": "sha512-Nrg0BWpQqrC3ZFFkyewrflCud9dio9ME3ojHCF/WLsprJVzkq3q3UeEhMCAW1dobjeGbWgjNn/PVF6m46ANxXQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@remix-run/router": "1.4.0"
|
"@remix-run/router": "1.5.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-router-dom": {
|
"react-router-dom": {
|
||||||
"version": "6.9.0",
|
"version": "6.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.10.0.tgz",
|
||||||
"integrity": "sha512-/seUAPY01VAuwkGyVBPCn1OXfVbaWGGu4QN9uj0kCPcTyNYgL1ldZpxZUpRU7BLheKQI4Twtl/OW2nHRF1u26Q==",
|
"integrity": "sha512-E5dfxRPuXKJqzwSe/qGcqdwa18QiWC6f3H3cWXM24qj4N0/beCIf/CWTipop2xm7mR0RCS99NnaqPNjHtrAzCg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@remix-run/router": "1.4.0",
|
"@remix-run/router": "1.5.0",
|
||||||
"react-router": "6.9.0"
|
"react-router": "6.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-transition-group": {
|
"react-transition-group": {
|
||||||
@@ -5223,9 +5272,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sass": {
|
"sass": {
|
||||||
"version": "1.59.3",
|
"version": "1.60.0",
|
||||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.59.3.tgz",
|
"resolved": "https://registry.npmjs.org/sass/-/sass-1.60.0.tgz",
|
||||||
"integrity": "sha512-QCq98N3hX1jfTCoUAsF3eyGuXLsY7BCnCEg9qAact94Yc21npG2/mVOqoDvE0fCbWDqiM4WlcJQla0gWG2YlxQ==",
|
"integrity": "sha512-updbwW6fNb5gGm8qMXzVO7V4sWf7LMXnMly/JEyfbfERbVH46Fn6q02BX7/eHTdKpE7d+oTkMMQpFWNUMfFbgQ==",
|
||||||
"devOptional": true,
|
"devOptional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"chokidar": ">=3.0.0 <4.0.0",
|
"chokidar": ">=3.0.0 <4.0.0",
|
||||||
|
|||||||
+5
-5
@@ -16,7 +16,7 @@
|
|||||||
"@jellyfin/sdk": "^0.7.0",
|
"@jellyfin/sdk": "^0.7.0",
|
||||||
"@mdi/js": "^7.2.96",
|
"@mdi/js": "^7.2.96",
|
||||||
"@mui/lab": "^5.0.0-alpha.124",
|
"@mui/lab": "^5.0.0-alpha.124",
|
||||||
"@mui/material": "^5.11.14",
|
"@mui/material": "^5.11.15",
|
||||||
"@reduxjs/toolkit": "^1.9.3",
|
"@reduxjs/toolkit": "^1.9.3",
|
||||||
"@tanstack/react-query": "^4.26.1",
|
"@tanstack/react-query": "^4.26.1",
|
||||||
"@tanstack/react-query-devtools": "^4.28.0",
|
"@tanstack/react-query-devtools": "^4.28.0",
|
||||||
@@ -31,10 +31,10 @@
|
|||||||
"react-cookie": "^4.1.1",
|
"react-cookie": "^4.1.1",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-material-ui-carousel": "^3.4.2",
|
"react-material-ui-carousel": "^3.4.2",
|
||||||
"react-multi-carousel": "^2.8.2",
|
"react-multi-carousel": "^2.8.3",
|
||||||
"react-parallax": "^3.5.1",
|
"react-parallax": "^3.5.1",
|
||||||
"react-redux": "^8.0.5",
|
"react-redux": "^8.0.5",
|
||||||
"react-router-dom": "^6.9.0",
|
"react-router-dom": "^6.10.0",
|
||||||
"redux": "^4.2.1",
|
"redux": "^4.2.1",
|
||||||
"sort-by": "^1.2.0",
|
"sort-by": "^1.2.0",
|
||||||
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
|
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
|
||||||
@@ -43,10 +43,10 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tauri-apps/cli": "^1.2.2",
|
"@tauri-apps/cli": "^1.2.2",
|
||||||
"@types/react": "^18.0.24",
|
"@types/react": "^18.0.32",
|
||||||
"@types/react-dom": "^18.0.8",
|
"@types/react-dom": "^18.0.8",
|
||||||
"@vitejs/plugin-react": "^3.1.0",
|
"@vitejs/plugin-react": "^3.1.0",
|
||||||
"sass": "^1.59.3",
|
"sass": "^1.60.0",
|
||||||
"vite": "^4.2.1"
|
"vite": "^4.2.1"
|
||||||
},
|
},
|
||||||
"license": "GPL-3.0-only"
|
"license": "GPL-3.0-only"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ tauri-build = { version = "1.2.1", features = [] }
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
tauri = { version = "1.2.2", features = [] }
|
tauri = { version = "1.2.2", features = ["process-exit", "process-relaunch"] }
|
||||||
tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" }
|
tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|||||||
@@ -8,11 +8,17 @@
|
|||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "JellyPlayer",
|
"productName": "JellyPlayer",
|
||||||
"version": "../package.json"
|
"version": "1.0.0"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
"all": false
|
"all": false,
|
||||||
|
"process": {
|
||||||
|
"all": false,
|
||||||
|
"exit": true,
|
||||||
|
"relaunch": true,
|
||||||
|
"relaunchDangerousAllowSymlinkMacos": false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"active": true,
|
"active": true,
|
||||||
|
|||||||
+19
-1
@@ -45,6 +45,8 @@ import {
|
|||||||
UserLoginManual,
|
UserLoginManual,
|
||||||
} from "./routes/login/root";
|
} from "./routes/login/root";
|
||||||
import LibraryView from "./routes/library/root.jsx";
|
import LibraryView from "./routes/library/root.jsx";
|
||||||
|
import ItemMovie from "./routes/item/Movie/root.jsx";
|
||||||
|
import ItemSeries from "./routes/item/Series/root.jsx";
|
||||||
|
|
||||||
import { SideMenu } from "./components/menu/sidemenu.jsx";
|
import { SideMenu } from "./components/menu/sidemenu.jsx";
|
||||||
import { AppBar } from "./components/appBar/appBar.jsx";
|
import { AppBar } from "./components/appBar/appBar.jsx";
|
||||||
@@ -59,6 +61,8 @@ import { v4 as uuidv4 } from "uuid";
|
|||||||
import { delServer, getServer } from "./utils/storage/servers.js";
|
import { delServer, getServer } from "./utils/storage/servers.js";
|
||||||
import { getUser } from "./utils/storage/user.js";
|
import { getUser } from "./utils/storage/user.js";
|
||||||
|
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
|
import { showSidemenu } from "./utils/slice/sidemenu.js";
|
||||||
const jellyfin = new Jellyfin({
|
const jellyfin = new Jellyfin({
|
||||||
clientInfo: {
|
clientInfo: {
|
||||||
name: "JellyPlayer",
|
name: "JellyPlayer",
|
||||||
@@ -120,12 +124,15 @@ const AnimationWrapper = () => {
|
|||||||
function App() {
|
function App() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const [serverReachable, setServerReachable] = useState(true);
|
const [serverReachable, setServerReachable] = useState(true);
|
||||||
const [checkingServer, setChecking] = useState(false);
|
const [checkingServer, setChecking] = useState(false);
|
||||||
|
|
||||||
const createApi = async () => {
|
const createApi = async () => {
|
||||||
const server = await getServer();
|
const server = await getServer();
|
||||||
event.emit("create-jellyfin-api", server.Ip);
|
event.emit("create-jellyfin-api", server.Ip);
|
||||||
|
dispatch(showSidemenu());
|
||||||
};
|
};
|
||||||
|
|
||||||
const serverAvailable = async () => {
|
const serverAvailable = async () => {
|
||||||
@@ -240,11 +247,14 @@ function App() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleRelaunch = async () => {
|
const handleRelaunch = async () => {
|
||||||
await relaunch();
|
let result = await relaunch();
|
||||||
|
console.log(result);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRemoveServer = async () => {
|
const handleRemoveServer = async () => {
|
||||||
await delServer();
|
await delServer();
|
||||||
|
let result = await relaunch();
|
||||||
|
console.log(result);
|
||||||
};
|
};
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
@@ -344,6 +354,14 @@ function App() {
|
|||||||
path="/library/:id"
|
path="/library/:id"
|
||||||
element={<LibraryView />}
|
element={<LibraryView />}
|
||||||
/>
|
/>
|
||||||
|
<Route
|
||||||
|
path="/item/Movie/:id"
|
||||||
|
element={<ItemMovie />}
|
||||||
|
/>
|
||||||
|
<Route
|
||||||
|
path="/item/Series/:id"
|
||||||
|
element={<ItemSeries />}
|
||||||
|
/>
|
||||||
|
|
||||||
{/* Logical Routes */}
|
{/* Logical Routes */}
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,20 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
import { useEffect } from "react";
|
||||||
|
|
||||||
import MuiAppBar from "@mui/material/AppBar";
|
import MuiAppBar from "@mui/material/AppBar";
|
||||||
import TextField from "@mui/material/TextField";
|
import TextField from "@mui/material/TextField";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import InputAdornment from "@mui/material/InputAdornment";
|
|
||||||
import Toolbar from "@mui/material/Toolbar";
|
import Toolbar from "@mui/material/Toolbar";
|
||||||
import Avatar from "@mui/material/Avatar";
|
import Avatar from "@mui/material/Avatar";
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
|
import Zoom from "@mui/material/Zoom";
|
||||||
|
|
||||||
import { MdiMagnify } from "../icons/mdiMagnify";
|
import { MdiMagnify } from "../icons/mdiMagnify";
|
||||||
import { theme } from "../../theme";
|
import { theme } from "../../theme";
|
||||||
|
|
||||||
import { useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
|
import { hideBackButton } from "../../utils/slice/appBar";
|
||||||
|
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
import { useQueryClient, useQuery } from "@tanstack/react-query";
|
import { useQueryClient, useQuery } from "@tanstack/react-query";
|
||||||
@@ -19,25 +22,40 @@ import { useQueryClient, useQuery } from "@tanstack/react-query";
|
|||||||
import "./appBar.module.scss";
|
import "./appBar.module.scss";
|
||||||
import { MdiAccount } from "../icons/mdiAccount";
|
import { MdiAccount } from "../icons/mdiAccount";
|
||||||
import { MdiHeartOutline } from "../icons/mdiHeartOutline";
|
import { MdiHeartOutline } from "../icons/mdiHeartOutline";
|
||||||
|
import { MdiArrowLeft } from "../icons/mdiArrowLeft";
|
||||||
|
|
||||||
export const AppBar = () => {
|
export const AppBar = () => {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const visible = useSelector((state) => state.appBar.visible);
|
const visible = useSelector((state) => state.appBar.visible);
|
||||||
|
const backButtonVisible = useSelector(
|
||||||
|
(state) => state.appBar.backButtonVisible,
|
||||||
|
);
|
||||||
const backdropVisible = useSelector((state) => state.appBar.backdrop);
|
const backdropVisible = useSelector((state) => state.appBar.backdrop);
|
||||||
|
|
||||||
|
const location = useLocation();
|
||||||
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["appBar", "user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(window.api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (location.pathname == "/home") {
|
||||||
|
dispatch(hideBackButton());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
visible && (
|
visible && (
|
||||||
<MuiAppBar
|
<MuiAppBar
|
||||||
sx={{
|
sx={{
|
||||||
width: `calc(100vw - ${theme.spacing(7)} - 20px)`,
|
width: `calc(100vw - ${theme.spacing(7)} - 10px)`,
|
||||||
mr: "10px",
|
// mr: "10px",
|
||||||
background: "transparent",
|
background: "transparent",
|
||||||
}}
|
}}
|
||||||
className={
|
className={
|
||||||
@@ -46,7 +64,26 @@ export const AppBar = () => {
|
|||||||
elevation={backdropVisible ? 6 : 0}
|
elevation={backdropVisible ? 6 : 0}
|
||||||
>
|
>
|
||||||
<Toolbar sx={{ justifyContent: "space-between" }}>
|
<Toolbar sx={{ justifyContent: "space-between" }}>
|
||||||
<Box sx={{ display: "flex", gap: 1 }}>
|
<Box
|
||||||
|
sx={{
|
||||||
|
display: "flex",
|
||||||
|
gap: 1,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<IconButton
|
||||||
|
onClick={() => navigate(-1)}
|
||||||
|
sx={{
|
||||||
|
transition: "transform 0.2s",
|
||||||
|
transform: backButtonVisible
|
||||||
|
? "scale(1)"
|
||||||
|
: "scale(0)",
|
||||||
|
transformOrigin: "left",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MdiArrowLeft />
|
||||||
|
</IconButton>
|
||||||
|
|
||||||
<TextField
|
<TextField
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
placeholder="Search..."
|
placeholder="Search..."
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import React from "react";
|
import React, { useState } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
@@ -9,6 +9,11 @@ import CardMedia from "@mui/material/CardMedia";
|
|||||||
import CardActionArea from "@mui/material/CardActionArea";
|
import CardActionArea from "@mui/material/CardActionArea";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import LinearProgress from "@mui/material/LinearProgress";
|
import 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 {
|
import {
|
||||||
MediaCollectionTypeIconCollectionCard,
|
MediaCollectionTypeIconCollectionCard,
|
||||||
@@ -17,6 +22,12 @@ import {
|
|||||||
|
|
||||||
import { borderRadiusDefault } from "../../palette.module.scss";
|
import { borderRadiusDefault } from "../../palette.module.scss";
|
||||||
import "./card.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";
|
||||||
|
|
||||||
export const Card = ({
|
export const Card = ({
|
||||||
itemName,
|
itemName,
|
||||||
@@ -27,8 +38,88 @@ export const Card = ({
|
|||||||
subText = "",
|
subText = "",
|
||||||
playedPercent,
|
playedPercent,
|
||||||
cardOrientation,
|
cardOrientation,
|
||||||
props,
|
cardProps,
|
||||||
|
onClickEvent,
|
||||||
|
watchedStatus,
|
||||||
|
watchedCount,
|
||||||
|
blurhash,
|
||||||
|
currentUser,
|
||||||
|
favourite,
|
||||||
}) => {
|
}) => {
|
||||||
|
const [imgLoading, setImgLoading] = useState(true);
|
||||||
|
const [isWatched, setIsWatched] = useState(watchedStatus);
|
||||||
|
const [isFavourite, setIsFavourite] = 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,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
console.log(result.data);
|
||||||
|
setIsWatched(result.data.Played);
|
||||||
|
setWatchedCountState(result.data.UnplayedItemCount);
|
||||||
|
};
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
console.log(result.data.IsFavorite);
|
||||||
|
setIsFavourite(result.data.IsFavorite);
|
||||||
|
};
|
||||||
|
|
||||||
|
const availableMarkButtonTypes = [
|
||||||
|
"Audio",
|
||||||
|
"AudioBook",
|
||||||
|
"Book",
|
||||||
|
"BoxSet",
|
||||||
|
"CollectionFolder",
|
||||||
|
"Movie",
|
||||||
|
"MusicAlbum",
|
||||||
|
"MusicVideo",
|
||||||
|
"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 (
|
return (
|
||||||
<MuiCard
|
<MuiCard
|
||||||
className={"card " + cardOrientation}
|
className={"card " + cardOrientation}
|
||||||
@@ -38,9 +129,11 @@ export const Card = ({
|
|||||||
mr: 1,
|
mr: 1,
|
||||||
}}
|
}}
|
||||||
elevation={0}
|
elevation={0}
|
||||||
{...props}
|
{...cardProps}
|
||||||
|
>
|
||||||
|
<CardActionArea
|
||||||
|
onClick={!!onClickEvent ? onClickEvent : () => {}}
|
||||||
>
|
>
|
||||||
<CardActionArea>
|
|
||||||
<Box
|
<Box
|
||||||
className="card-media-container"
|
className="card-media-container"
|
||||||
sx={{
|
sx={{
|
||||||
@@ -53,11 +146,31 @@ export const Card = ({
|
|||||||
? "0.666"
|
? "0.666"
|
||||||
: "1",
|
: "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 }}
|
||||||
>
|
>
|
||||||
{imageTags &&
|
{imageTags &&
|
||||||
(cardType == "thumb" ? (
|
(cardType == "thumb" ? (
|
||||||
<CardMedia
|
<CardMedia
|
||||||
component="div"
|
component="img"
|
||||||
image={
|
image={
|
||||||
window.api.basePath +
|
window.api.basePath +
|
||||||
"/Items/" +
|
"/Items/" +
|
||||||
@@ -68,18 +181,25 @@ export const Card = ({
|
|||||||
sx={{
|
sx={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
aspectRatio:
|
aspectRatio:
|
||||||
cardOrientation == "landscape"
|
cardOrientation ==
|
||||||
|
"landscape"
|
||||||
? "1.777"
|
? "1.777"
|
||||||
: cardOrientation ==
|
: cardOrientation ==
|
||||||
"portait"
|
"portait"
|
||||||
? "0.666"
|
? "0.666"
|
||||||
: "1",
|
: "1",
|
||||||
|
borderRadius:
|
||||||
|
borderRadiusDefault,
|
||||||
|
overflow: "hidden",
|
||||||
}}
|
}}
|
||||||
|
onLoad={() =>
|
||||||
|
setImgLoading(false)
|
||||||
|
}
|
||||||
className="card-image"
|
className="card-image"
|
||||||
></CardMedia>
|
></CardMedia>
|
||||||
) : (
|
) : (
|
||||||
<CardMedia
|
<CardMedia
|
||||||
component="div"
|
component="img"
|
||||||
image={
|
image={
|
||||||
window.api.basePath +
|
window.api.basePath +
|
||||||
"/Items/" +
|
"/Items/" +
|
||||||
@@ -90,7 +210,8 @@ export const Card = ({
|
|||||||
sx={{
|
sx={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
aspectRatio:
|
aspectRatio:
|
||||||
cardOrientation == "landscape"
|
cardOrientation ==
|
||||||
|
"landscape"
|
||||||
? "1.777"
|
? "1.777"
|
||||||
: cardOrientation ==
|
: cardOrientation ==
|
||||||
"portait"
|
"portait"
|
||||||
@@ -98,8 +219,31 @@ export const Card = ({
|
|||||||
: "1",
|
: "1",
|
||||||
}}
|
}}
|
||||||
className="card-image"
|
className="card-image"
|
||||||
|
onLoad={() =>
|
||||||
|
setImgLoading(false)
|
||||||
|
}
|
||||||
></CardMedia>
|
></CardMedia>
|
||||||
))}
|
))}
|
||||||
|
</div>
|
||||||
|
{!!blurhash && (
|
||||||
|
<Blurhash
|
||||||
|
hash={blurhash}
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
resolutionX={64}
|
||||||
|
resolutionY={64}
|
||||||
|
style={{
|
||||||
|
aspectRatio:
|
||||||
|
cardOrientation == "landscape"
|
||||||
|
? "1.777"
|
||||||
|
: cardOrientation ==
|
||||||
|
"portait"
|
||||||
|
? "0.666"
|
||||||
|
: "1",
|
||||||
|
}}
|
||||||
|
className="card-image-blurhash"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<div className="card-image-icon-container">
|
<div className="card-image-icon-container">
|
||||||
{cardType == "lib"
|
{cardType == "lib"
|
||||||
? MediaCollectionTypeIconCollectionCard[
|
? MediaCollectionTypeIconCollectionCard[
|
||||||
@@ -121,6 +265,53 @@ export const Card = ({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
</>
|
||||||
|
<Box
|
||||||
|
className="card-media-overlay"
|
||||||
|
sx={{
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "flex-end",
|
||||||
|
justifyContent: "flex-end",
|
||||||
|
p: 1,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ButtonGroup>
|
||||||
|
{availableMarkButtonTypes.includes(
|
||||||
|
iconType,
|
||||||
|
) && (
|
||||||
|
<IconButton
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
handleMarkAsPlayOrUnMarkAsPlay();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MdiCheck
|
||||||
|
sx={{
|
||||||
|
color: isWatched
|
||||||
|
? green[200]
|
||||||
|
: "white",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</IconButton>
|
||||||
|
)}
|
||||||
|
{allowedLikeButton.includes(iconType) && (
|
||||||
|
<IconButton
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
handleLiking();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{isFavourite ? (
|
||||||
|
<MdiHeart
|
||||||
|
sx={{ color: pink[700] }}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<MdiHeartOutline />
|
||||||
|
)}
|
||||||
|
</IconButton>
|
||||||
|
)}
|
||||||
|
</ButtonGroup>
|
||||||
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<CardContent
|
<CardContent
|
||||||
@@ -172,4 +363,10 @@ Card.propTypes = {
|
|||||||
subText: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
subText: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
playedPercent: PropTypes.number,
|
playedPercent: PropTypes.number,
|
||||||
cardOrientation: PropTypes.string.isRequired,
|
cardOrientation: PropTypes.string.isRequired,
|
||||||
|
onClickEvent: PropTypes.func,
|
||||||
|
watchedStatus: PropTypes.bool,
|
||||||
|
watchedCount: PropTypes.number,
|
||||||
|
blurhash: PropTypes.string,
|
||||||
|
currentUser: PropTypes.object,
|
||||||
|
favourite: PropTypes.bool,
|
||||||
};
|
};
|
||||||
@@ -2,6 +2,30 @@
|
|||||||
|
|
||||||
.card {
|
.card {
|
||||||
border-radius: $border-radius-default;
|
border-radius: $border-radius-default;
|
||||||
|
&-media {
|
||||||
|
&-container {
|
||||||
|
position: relative;
|
||||||
|
border-radius: $border-radius-default;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
&-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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&:hover .card-media-overlay {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
&-image {
|
&-image {
|
||||||
position: relative;
|
position: relative;
|
||||||
border-radius: $border-radius-default;
|
border-radius: $border-radius-default;
|
||||||
@@ -9,6 +33,8 @@
|
|||||||
background-position: center;
|
background-position: center;
|
||||||
&-container {
|
&-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
border-radius: $border-radius-default;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
&-icon {
|
&-icon {
|
||||||
font-size: 4.5em !important;
|
font-size: 4.5em !important;
|
||||||
@@ -27,9 +53,19 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
z-index: -1;
|
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 {
|
&-text-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -37,4 +73,18 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
&-indicator {
|
||||||
|
position: absolute;
|
||||||
|
right: 5px;
|
||||||
|
top: 5px;
|
||||||
|
// padding: 2px 10px;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,12 @@ import ButtonGroup from "@mui/material/ButtonGroup";
|
|||||||
import "./cardScroller.module.scss";
|
import "./cardScroller.module.scss";
|
||||||
export const CardScroller = ({ children, displayCards, title }) => {
|
export const CardScroller = ({ children, displayCards, title }) => {
|
||||||
const responsive = {
|
const responsive = {
|
||||||
|
superLargeDesktop: {
|
||||||
|
// the naming can be any, depends on you.
|
||||||
|
breakpoint: { max: 4000, min: 3000 },
|
||||||
|
items: displayCards + 1,
|
||||||
|
slidesToSlide: displayCards + 1,
|
||||||
|
},
|
||||||
desktop: {
|
desktop: {
|
||||||
breakpoint: { max: 3000, min: 1025 },
|
breakpoint: { max: 3000, min: 1025 },
|
||||||
items: displayCards,
|
items: displayCards,
|
||||||
@@ -25,13 +31,13 @@ export const CardScroller = ({ children, displayCards, title }) => {
|
|||||||
},
|
},
|
||||||
tablet: {
|
tablet: {
|
||||||
breakpoint: { max: 1024, min: 464 },
|
breakpoint: { max: 1024, min: 464 },
|
||||||
items: displayCards - 1,
|
items: displayCards - 2,
|
||||||
slidesToSlide: displayCards - 1, // optional, default to 1.
|
slidesToSlide: displayCards - 2, // optional, default to 1.
|
||||||
},
|
},
|
||||||
mobile: {
|
mobile: {
|
||||||
breakpoint: { max: 464, min: 0 },
|
breakpoint: { max: 464, min: 0 },
|
||||||
items: displayCards - 2,
|
items: displayCards - 3,
|
||||||
slidesToSlide: displayCards - 2, // optional, default to 1.
|
slidesToSlide: displayCards - 3, // optional, default to 1.
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
import Box from "@mui/material/Box";
|
||||||
|
import { MdiEmoticonCryOutline } from "../icons/mdiEmoticonCryOutline";
|
||||||
|
import Typography from "@mui/material/Typography";
|
||||||
|
|
||||||
|
export const EmptyNotice = () => {
|
||||||
|
return (
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
width: "100%",
|
||||||
|
height: "100%",
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
flexFlow: "column",
|
||||||
|
opacity: 0.2,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MdiEmoticonCryOutline sx={{ fontSize: 200 }} />
|
||||||
|
<Typography variant="h3">Nothing found</Typography>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -65,6 +65,25 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
|||||||
? "sqaure"
|
? "sqaure"
|
||||||
: "portait"
|
: "portait"
|
||||||
}
|
}
|
||||||
|
watchedStatus={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>
|
></Card>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
import SvgIcon from "@mui/material/SvgIcon";
|
||||||
|
|
||||||
|
import { mdiCheck } from "@mdi/js";
|
||||||
|
|
||||||
|
export const MdiCheck = (props) => {
|
||||||
|
return (
|
||||||
|
<SvgIcon color="red" {...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 { mdiEmoticonCryOutline } from "@mdi/js";
|
||||||
|
|
||||||
|
export const MdiEmoticonCryOutline = (props) => {
|
||||||
|
return (
|
||||||
|
<SvgIcon {...props}>
|
||||||
|
<path d={mdiEmoticonCryOutline}></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 { mdiHeart } from "@mdi/js";
|
||||||
|
|
||||||
|
export const MdiHeart = (props) => {
|
||||||
|
return (
|
||||||
|
<SvgIcon {...props}>
|
||||||
|
<path d={mdiHeart}></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>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
import { delUser } from "../../utils/storage/user";
|
import { delUser } from "../../utils/storage/user";
|
||||||
|
|
||||||
import { useQueryClient, useQuery, QueryClient } from "@tanstack/react-query";
|
import { useQueryClient, useQuery, QueryClient } from "@tanstack/react-query";
|
||||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
|
|
||||||
import { useNavigate, NavLink } from "react-router-dom";
|
import { useNavigate, NavLink, useLocation } from "react-router-dom";
|
||||||
|
|
||||||
import { theme } from "../../theme";
|
import { theme } from "../../theme";
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ import { MdiLogoutVariant } from "../icons/mdiLogoutVariant";
|
|||||||
import { MediaCollectionTypeIconCollection } from "../../components/utils/iconsCollection.jsx";
|
import { MediaCollectionTypeIconCollection } from "../../components/utils/iconsCollection.jsx";
|
||||||
|
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import { hideSidemenu } from "../../utils/slice/sidemenu";
|
import { hideSidemenu, setBackdrop } from "../../utils/slice/sidemenu";
|
||||||
|
|
||||||
import { MdiHomeVariantOutline } from "../icons/mdiHomeVariantOutline";
|
import { MdiHomeVariantOutline } from "../icons/mdiHomeVariantOutline";
|
||||||
|
|
||||||
@@ -56,20 +57,23 @@ const MiniDrawer = styled(MuiDrawer, {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
export const SideMenu = ({}) => {
|
export const SideMenu = ({}) => {
|
||||||
const queryClient = useQueryClient();
|
const location = useLocation();
|
||||||
|
|
||||||
|
const [display, setDisplay] = useState(false);
|
||||||
|
|
||||||
const visible = useSelector((state) => state.sidebar.visible);
|
const visible = useSelector((state) => state.sidebar.visible);
|
||||||
|
const backdrop = useSelector((state) => state.sidebar.backdrop);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["home", "user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(window.api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
},
|
},
|
||||||
enabled: visible,
|
enabled: false,
|
||||||
});
|
});
|
||||||
let libraries = useQuery({
|
let libraries = useQuery({
|
||||||
queryKey: ["sidemenu", "libraries"],
|
queryKey: ["libraries"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let libs = await getUserViewsApi(window.api).getUserViews({
|
let libs = await getUserViewsApi(window.api).getUserViews({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
@@ -89,6 +93,24 @@ export const SideMenu = ({}) => {
|
|||||||
navigate("/login");
|
navigate("/login");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getCurrentPathWithoutParam = () => {
|
||||||
|
return location.pathname.slice(0, location.pathname.lastIndexOf("/"));
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (
|
||||||
|
getCurrentPathWithoutParam() != "/login" &&
|
||||||
|
getCurrentPathWithoutParam() != "/setup/server"
|
||||||
|
) {
|
||||||
|
setDisplay(true);
|
||||||
|
}
|
||||||
|
}, [location]);
|
||||||
|
|
||||||
|
if (!display) {
|
||||||
|
return <></>;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (display) {
|
||||||
return (
|
return (
|
||||||
<MiniDrawer
|
<MiniDrawer
|
||||||
variant="permanent"
|
variant="permanent"
|
||||||
@@ -105,7 +127,13 @@ export const SideMenu = ({}) => {
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
width: visible ? `calc(${theme.spacing(7)} + 10px)` : 0,
|
width: visible
|
||||||
|
? `calc(${theme.spacing(7)} + 10px)`
|
||||||
|
: 0,
|
||||||
|
background: backdrop
|
||||||
|
? theme.palette.background.paper
|
||||||
|
: "transparent",
|
||||||
|
borderLeft: "1px solid white",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DrawerHeader
|
<DrawerHeader
|
||||||
@@ -141,7 +169,8 @@ export const SideMenu = ({}) => {
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<List sx={{ border: "none" }}>
|
<List sx={{ border: "none" }}>
|
||||||
{libraries.data.Items.map((library, index) => {
|
{libraries.data.Items.map(
|
||||||
|
(library, index) => {
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
title={library.Name}
|
title={library.Name}
|
||||||
@@ -198,7 +227,8 @@ export const SideMenu = ({}) => {
|
|||||||
</ListItem>
|
</ListItem>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
})}
|
},
|
||||||
|
)}
|
||||||
</List>
|
</List>
|
||||||
<List sx={{ marginTop: "auto" }}>
|
<List sx={{ marginTop: "auto" }}>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@@ -227,7 +257,8 @@ export const SideMenu = ({}) => {
|
|||||||
<ListItemButton
|
<ListItemButton
|
||||||
sx={{
|
sx={{
|
||||||
minHeight: 48,
|
minHeight: 48,
|
||||||
justifyContent: "center",
|
justifyContent:
|
||||||
|
"center",
|
||||||
px: 2.5,
|
px: 2.5,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -262,7 +293,8 @@ export const SideMenu = ({}) => {
|
|||||||
<ListItemIcon
|
<ListItemIcon
|
||||||
sx={{
|
sx={{
|
||||||
minWidth: 0,
|
minWidth: 0,
|
||||||
justifyContent: "center",
|
justifyContent:
|
||||||
|
"center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<MdiLogoutVariant></MdiLogoutVariant>
|
<MdiLogoutVariant></MdiLogoutVariant>
|
||||||
@@ -275,6 +307,7 @@ export const SideMenu = ({}) => {
|
|||||||
)}
|
)}
|
||||||
</MiniDrawer>
|
</MiniDrawer>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// SideMenu.propTypes = {
|
// SideMenu.propTypes = {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { MdiTelevision } from "../icons/mdiTelevision";
|
|||||||
import { MdiFolderOutline } from "../icons/mdiFolderOutline";
|
import { MdiFolderOutline } from "../icons/mdiFolderOutline";
|
||||||
import { MdiFolderMusicOutline } from "../icons/mdiFolderMusicOutline";
|
import { MdiFolderMusicOutline } from "../icons/mdiFolderMusicOutline";
|
||||||
import { MdiYoutube } from "../icons/mdiYoutube";
|
import { MdiYoutube } from "../icons/mdiYoutube";
|
||||||
import { MdiMultimedia } from "../icons/mdiMultiMedia";
|
import { MdiMultimedia } from "../icons/mdiMultimedia";
|
||||||
import { MdiBookMultiple } from "../icons/mdiBookMultiple";
|
import { MdiBookMultiple } from "../icons/mdiBookMultiple";
|
||||||
import { MdiImageMultiple } from "../icons/mdiImageMultiple";
|
import { MdiImageMultiple } from "../icons/mdiImageMultiple";
|
||||||
import { MdiTelevisionClassic } from "../icons/mdiTelevisionClassic";
|
import { MdiTelevisionClassic } from "../icons/mdiTelevisionClassic";
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
}
|
}
|
||||||
&-icon {
|
&-icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
font-size: 10em !important;
|
font-size: 15em !important;
|
||||||
left: 70%;
|
left: 70%;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
|
|||||||
+112
-41
@@ -49,7 +49,7 @@ import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api"
|
|||||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||||
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||||
|
|
||||||
import { useNavigate, useLocation } from "react-router-dom";
|
import { useNavigate, useLocation, Link } from "react-router-dom";
|
||||||
|
|
||||||
import { formateDate } from "../../utils/date/formateDate";
|
import { formateDate } from "../../utils/date/formateDate";
|
||||||
import { getRuntime } from "../../utils/date/time";
|
import { getRuntime } from "../../utils/date/time";
|
||||||
@@ -75,7 +75,7 @@ const Home = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["home", "user"],
|
queryKey: ["user"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
let usr = await getUserApi(window.api).getCurrentUser();
|
let usr = await getUserApi(window.api).getCurrentUser();
|
||||||
return usr.data;
|
return usr.data;
|
||||||
@@ -83,9 +83,8 @@ const Home = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const libraries = useQuery({
|
const libraries = useQuery({
|
||||||
queryKey: ["home", "libraries"],
|
queryKey: ["libraries"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
dispatch(showSidemenu());
|
|
||||||
let libs = await getUserViewsApi(window.api).getUserViews({
|
let libs = await getUserViewsApi(window.api).getUserViews({
|
||||||
userId: user.data.Id,
|
userId: user.data.Id,
|
||||||
});
|
});
|
||||||
@@ -208,11 +207,6 @@ const Home = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
display: "flex",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Box
|
<Box
|
||||||
component="main"
|
component="main"
|
||||||
className="scrollY"
|
className="scrollY"
|
||||||
@@ -273,10 +267,8 @@ const Home = () => {
|
|||||||
className="hero-carousel-slide"
|
className="hero-carousel-slide"
|
||||||
sx={{
|
sx={{
|
||||||
background:
|
background:
|
||||||
theme.palette
|
theme.palette.primary
|
||||||
.primary
|
.background.dark,
|
||||||
.background
|
|
||||||
.dark,
|
|
||||||
}}
|
}}
|
||||||
key={index}
|
key={index}
|
||||||
>
|
>
|
||||||
@@ -324,8 +316,7 @@ const Home = () => {
|
|||||||
<div className="hero-carousel-background-icon-container">
|
<div className="hero-carousel-background-icon-container">
|
||||||
{
|
{
|
||||||
MediaTypeIconCollection[
|
MediaTypeIconCollection[
|
||||||
item
|
item.MediaType
|
||||||
.MediaType
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -338,15 +329,13 @@ const Home = () => {
|
|||||||
mb: 2.5,
|
mb: 2.5,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{!item.ImageTags
|
{!item.ImageTags.Logo ? (
|
||||||
.Logo ? (
|
|
||||||
item.Name
|
item.Name
|
||||||
) : (
|
) : (
|
||||||
<img
|
<img
|
||||||
className="hero-carousel-text-logo"
|
className="hero-carousel-text-logo"
|
||||||
src={
|
src={
|
||||||
window
|
window.api
|
||||||
.api
|
|
||||||
.basePath +
|
.basePath +
|
||||||
"/Items/" +
|
"/Items/" +
|
||||||
item.Id +
|
item.Id +
|
||||||
@@ -446,14 +435,11 @@ const Home = () => {
|
|||||||
className="hero-carousel-text"
|
className="hero-carousel-text"
|
||||||
sx={{
|
sx={{
|
||||||
display: "-webkit-box",
|
display: "-webkit-box",
|
||||||
maxWidth:
|
maxWidth: "70%",
|
||||||
"70%",
|
maxHeight: "30%",
|
||||||
maxHeight:
|
|
||||||
"30%",
|
|
||||||
textOverflow:
|
textOverflow:
|
||||||
"ellipsis",
|
"ellipsis",
|
||||||
overflow:
|
overflow: "hidden",
|
||||||
"hidden",
|
|
||||||
WebkitLineClamp:
|
WebkitLineClamp:
|
||||||
"3",
|
"3",
|
||||||
WebkitBoxOrient:
|
WebkitBoxOrient:
|
||||||
@@ -498,11 +484,11 @@ const Home = () => {
|
|||||||
})
|
})
|
||||||
)}
|
)}
|
||||||
</Carousel>
|
</Carousel>
|
||||||
<CardScroller displayCards={4} title="Libraries">
|
|
||||||
{libraries.isLoading ? (
|
{libraries.isLoading ? (
|
||||||
<CardsSkeleton />
|
<CardsSkeleton />
|
||||||
) : (
|
) : (
|
||||||
libraries.status == "success" &&
|
<CardScroller displayCards={4} title="Libraries">
|
||||||
|
{libraries.status == "success" &&
|
||||||
libraries.data.Items.map((item, index) => {
|
libraries.data.Items.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
@@ -516,11 +502,36 @@ const Home = () => {
|
|||||||
cardType="lib"
|
cardType="lib"
|
||||||
cardOrientation="landscape"
|
cardOrientation="landscape"
|
||||||
iconType={item.CollectionType}
|
iconType={item.CollectionType}
|
||||||
|
onClickEvent={() => {
|
||||||
|
navigate(
|
||||||
|
`/library/${item.Id}`,
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
blurhash={
|
||||||
|
item.ImageBlurHashes ==
|
||||||
|
{}
|
||||||
|
? ""
|
||||||
|
: !!item.ImageTags
|
||||||
|
.Primary
|
||||||
|
? !!item
|
||||||
|
.ImageBlurHashes
|
||||||
|
.Primary
|
||||||
|
? item
|
||||||
|
.ImageBlurHashes
|
||||||
|
.Primary[
|
||||||
|
item
|
||||||
|
.ImageTags
|
||||||
|
.Primary
|
||||||
|
]
|
||||||
|
: ""
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
currentUser={user.data}
|
||||||
></Card>
|
></Card>
|
||||||
);
|
);
|
||||||
})
|
})}
|
||||||
)}
|
|
||||||
</CardScroller>
|
</CardScroller>
|
||||||
|
)}
|
||||||
{upNextItems.isLoading ? (
|
{upNextItems.isLoading ? (
|
||||||
<CardsSkeleton />
|
<CardsSkeleton />
|
||||||
) : upNextItems.isSuccess &&
|
) : upNextItems.isSuccess &&
|
||||||
@@ -528,8 +539,7 @@ const Home = () => {
|
|||||||
<></>
|
<></>
|
||||||
) : (
|
) : (
|
||||||
<CardScroller displayCards={4} title="Up Next">
|
<CardScroller displayCards={4} title="Up Next">
|
||||||
{upNextItems.data.Items.map(
|
{upNextItems.data.Items.map((item, index) => {
|
||||||
(item, index) => {
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
key={index}
|
key={index}
|
||||||
@@ -545,8 +555,7 @@ const Home = () => {
|
|||||||
}
|
}
|
||||||
// imageTags={false}
|
// imageTags={false}
|
||||||
imageTags={
|
imageTags={
|
||||||
!!item.ImageTags
|
!!item.ImageTags.Primary
|
||||||
.Primary
|
|
||||||
}
|
}
|
||||||
cardType="thumb"
|
cardType="thumb"
|
||||||
iconType={item.Type}
|
iconType={item.Type}
|
||||||
@@ -561,10 +570,30 @@ const Home = () => {
|
|||||||
: item.ProductionYear
|
: item.ProductionYear
|
||||||
}
|
}
|
||||||
cardOrientation="landscape"
|
cardOrientation="landscape"
|
||||||
|
blurhash={
|
||||||
|
item.ImageBlurHashes == {}
|
||||||
|
? ""
|
||||||
|
: !!item.ImageTags
|
||||||
|
.Primary
|
||||||
|
? !!item.ImageBlurHashes
|
||||||
|
.Primary
|
||||||
|
? item
|
||||||
|
.ImageBlurHashes
|
||||||
|
.Primary[
|
||||||
|
item
|
||||||
|
.ImageTags
|
||||||
|
.Primary
|
||||||
|
]
|
||||||
|
: ""
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
currentUser={user.data}
|
||||||
|
favourite={
|
||||||
|
item.UserData.IsFavorite
|
||||||
|
}
|
||||||
></Card>
|
></Card>
|
||||||
);
|
);
|
||||||
},
|
})}
|
||||||
)}
|
|
||||||
</CardScroller>
|
</CardScroller>
|
||||||
)}
|
)}
|
||||||
{resumeItemsVideo.isLoading ? (
|
{resumeItemsVideo.isLoading ? (
|
||||||
@@ -620,6 +649,29 @@ const Home = () => {
|
|||||||
.PlayedPercentage
|
.PlayedPercentage
|
||||||
}
|
}
|
||||||
cardOrientation="landscape"
|
cardOrientation="landscape"
|
||||||
|
blurhash={
|
||||||
|
item.ImageBlurHashes ==
|
||||||
|
{}
|
||||||
|
? ""
|
||||||
|
: !!item.ImageTags
|
||||||
|
.Backdrop
|
||||||
|
? !!item
|
||||||
|
.ImageBlurHashes
|
||||||
|
.Backdrop
|
||||||
|
? item
|
||||||
|
.ImageBlurHashes
|
||||||
|
.Backdrop[
|
||||||
|
item
|
||||||
|
.ImageTags
|
||||||
|
.Backdrop
|
||||||
|
]
|
||||||
|
: ""
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
currentUser={user.data}
|
||||||
|
favourite={
|
||||||
|
item.UserData.IsFavorite
|
||||||
|
}
|
||||||
></Card>
|
></Card>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -652,18 +704,38 @@ const Home = () => {
|
|||||||
}
|
}
|
||||||
// imageTags={false}
|
// imageTags={false}
|
||||||
imageTags={
|
imageTags={
|
||||||
!!item.ImageTags
|
!!item.ImageTags.Primary
|
||||||
.Primary
|
|
||||||
}
|
}
|
||||||
iconType={item.Type}
|
iconType={item.Type}
|
||||||
subText={
|
subText={item.ProductionYear}
|
||||||
item.ProductionYear
|
|
||||||
}
|
|
||||||
playedPercent={
|
playedPercent={
|
||||||
item.UserData
|
item.UserData
|
||||||
.PlayedPercentage
|
.PlayedPercentage
|
||||||
}
|
}
|
||||||
cardOrientation="sqaure"
|
cardOrientation="sqaure"
|
||||||
|
blurhash={
|
||||||
|
item.ImageBlurHashes ==
|
||||||
|
{}
|
||||||
|
? ""
|
||||||
|
: !!item.ImageTags
|
||||||
|
.Primary
|
||||||
|
? !!item
|
||||||
|
.ImageBlurHashes
|
||||||
|
.Primary
|
||||||
|
? item
|
||||||
|
.ImageBlurHashes
|
||||||
|
.Primary[
|
||||||
|
item
|
||||||
|
.ImageTags
|
||||||
|
.Primary
|
||||||
|
]
|
||||||
|
: ""
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
currentUser={user.data}
|
||||||
|
favourite={
|
||||||
|
item.UserData.IsFavorite
|
||||||
|
}
|
||||||
></Card>
|
></Card>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -683,7 +755,6 @@ const Home = () => {
|
|||||||
Logout
|
Logout
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
.item-detail {
|
||||||
|
&-backdrop {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: inherit;
|
||||||
|
height: 100%;
|
||||||
|
z-index: -2;
|
||||||
|
opacity: 0.1;
|
||||||
|
}
|
||||||
|
&-header {
|
||||||
|
display: flex;
|
||||||
|
gap: 2em;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: flex-end;
|
||||||
|
position: relative;
|
||||||
|
&-backdrop {
|
||||||
|
position: absolute;
|
||||||
|
width: 100vw;
|
||||||
|
height: 150%;
|
||||||
|
top: -88px;
|
||||||
|
width: 100vw;
|
||||||
|
right: 0;
|
||||||
|
left: -24px;
|
||||||
|
z-index: -1;
|
||||||
|
filter: brightness(0.5);
|
||||||
|
mask-image: linear-gradient(0deg, transparent, black);
|
||||||
|
-webkit-mask-image: linear-gradient(0deg, transparent, black);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
position: absolute;
|
||||||
|
transition: opacity $transition-time-default;
|
||||||
|
&-blurhash {
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
&-container {
|
||||||
|
width: 15%;
|
||||||
|
position: relative;
|
||||||
|
aspect-ratio: 0.666;
|
||||||
|
border-radius: $border-radius-default;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: 0 0 15px rgb(0 0 0 / 0.4);
|
||||||
|
}
|
||||||
|
&-icon-container {
|
||||||
|
background: $clr-gradient-dark;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: -2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,362 @@
|
|||||||
|
/** @format */
|
||||||
|
import { useState, useEffect } from "react";
|
||||||
|
|
||||||
|
import Box from "@mui/material/Box";
|
||||||
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
|
import Typography from "@mui/material/Typography";
|
||||||
|
import Stack from "@mui/material/Stack";
|
||||||
|
import Chip from "@mui/material/Chip";
|
||||||
|
import useScrollTrigger from "@mui/material/useScrollTrigger";
|
||||||
|
import Divider from "@mui/material/Divider";
|
||||||
|
import LinearProgress from "@mui/material/LinearProgress";
|
||||||
|
import MenuItem from "@mui/material/MenuItem";
|
||||||
|
|
||||||
|
import { Blurhash } from "react-blurhash";
|
||||||
|
import {
|
||||||
|
setBackdrop,
|
||||||
|
showAppBar,
|
||||||
|
showBackButton,
|
||||||
|
} from "../../../utils/slice/appBar";
|
||||||
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
|
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
import { MdiStarHalfFull } from "../../../components/icons/mdiStarHalfFull";
|
||||||
|
import { getRuntimeFull } from "../../../utils/date/time";
|
||||||
|
import { TypeIconCollectionCard } from "../../../components/utils/iconsCollection";
|
||||||
|
|
||||||
|
import { Card } from "../../../components/card/card";
|
||||||
|
import { CardScroller } from "../../../components/cardScroller/cardScroller";
|
||||||
|
|
||||||
|
import "./Movie.module.scss";
|
||||||
|
|
||||||
|
const ItemMovie = () => {
|
||||||
|
const { id } = useParams();
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const appBarVisiblity = useSelector((state) => state.appBar.visible);
|
||||||
|
const [scrollTarget, setScrollTarget] = useState(undefined);
|
||||||
|
const [primageImageLoaded, setPrimaryImageLoaded] = useState(false);
|
||||||
|
const [backdropImageLoaded, setBackdropImageLoaded] = useState(false);
|
||||||
|
|
||||||
|
const trigger = useScrollTrigger({
|
||||||
|
disableHysteresis: true,
|
||||||
|
threshold: 0,
|
||||||
|
target: scrollTarget,
|
||||||
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!appBarVisiblity) {
|
||||||
|
dispatch(showAppBar());
|
||||||
|
}
|
||||||
|
dispatch(setBackdrop(trigger));
|
||||||
|
dispatch(showBackButton());
|
||||||
|
}, [trigger]);
|
||||||
|
|
||||||
|
const user = useQuery({
|
||||||
|
queryKey: ["user"],
|
||||||
|
queryFn: async () => {
|
||||||
|
let usr = await getUserApi(window.api).getCurrentUser();
|
||||||
|
return usr.data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const item = useQuery({
|
||||||
|
queryKey: ["item,Movie", id],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getUserLibraryApi(window.api).getItem({
|
||||||
|
userId: user.data.Id,
|
||||||
|
itemId: id,
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
enabled: !!user.data,
|
||||||
|
});
|
||||||
|
if (item.isLoading) {
|
||||||
|
return (
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
width: "100%",
|
||||||
|
height: "100%",
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<CircularProgress />
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (item.isSuccess) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Box className="item-detail-backdrop">
|
||||||
|
{item.data.BackdropImageTags.length != 0 && (
|
||||||
|
<Blurhash
|
||||||
|
hash={
|
||||||
|
item.data.ImageBlurHashes.Backdrop[
|
||||||
|
item.data.BackdropImageTags[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
resolutionX={64}
|
||||||
|
resolutionY={96}
|
||||||
|
style={{
|
||||||
|
aspectRatio: "0.666",
|
||||||
|
}}
|
||||||
|
className="item-detail-image-blurhash"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
<Box
|
||||||
|
recomponent="main"
|
||||||
|
className="scrollY"
|
||||||
|
sx={{
|
||||||
|
display: "flex",
|
||||||
|
pt: 11,
|
||||||
|
px: 3,
|
||||||
|
pb: 3,
|
||||||
|
position: "relative",
|
||||||
|
flexFlow: "column",
|
||||||
|
gap: 5,
|
||||||
|
}}
|
||||||
|
ref={(node) => {
|
||||||
|
if (node) {
|
||||||
|
setScrollTarget(node);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Box className="item-detail-header">
|
||||||
|
<Box className="item-detail-header-backdrop">
|
||||||
|
{item.data.BackdropImageTags.length != 0 && (
|
||||||
|
<img
|
||||||
|
src={
|
||||||
|
window.api.basePath +
|
||||||
|
"/Items/" +
|
||||||
|
item.data.Id +
|
||||||
|
"/Images/Backdrop"
|
||||||
|
}
|
||||||
|
style={{
|
||||||
|
opacity: backdropImageLoaded
|
||||||
|
? 1
|
||||||
|
: 0,
|
||||||
|
}}
|
||||||
|
className="item-detail-image"
|
||||||
|
onLoad={() =>
|
||||||
|
setBackdropImageLoaded(true)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{item.data.BackdropImageTags.length != 0 && (
|
||||||
|
<Blurhash
|
||||||
|
hash={
|
||||||
|
item.data.ImageBlurHashes
|
||||||
|
.Backdrop[
|
||||||
|
item.data
|
||||||
|
.BackdropImageTags[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
resolutionX={64}
|
||||||
|
resolutionY={96}
|
||||||
|
style={{
|
||||||
|
aspectRatio: "0.666",
|
||||||
|
}}
|
||||||
|
className="item-detail-image-blurhash"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<Box
|
||||||
|
sx={{ fontSize: "4em" }}
|
||||||
|
className="item-detail-image-icon-container"
|
||||||
|
>
|
||||||
|
{TypeIconCollectionCard[item.data.Type]}
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
<Box className="item-detail-image-container">
|
||||||
|
{!!item.data.ImageTags.Primary && (
|
||||||
|
<img
|
||||||
|
src={
|
||||||
|
window.api.basePath +
|
||||||
|
"/Items/" +
|
||||||
|
item.data.Id +
|
||||||
|
"/Images/Primary"
|
||||||
|
}
|
||||||
|
style={{
|
||||||
|
opacity: primageImageLoaded
|
||||||
|
? 1
|
||||||
|
: 0,
|
||||||
|
}}
|
||||||
|
className="item-detail-image"
|
||||||
|
onLoad={() =>
|
||||||
|
setPrimaryImageLoaded(true)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!!item.data.ImageBlurHashes.Primary && (
|
||||||
|
<Blurhash
|
||||||
|
hash={
|
||||||
|
item.data.ImageBlurHashes
|
||||||
|
.Primary[
|
||||||
|
item.data.ImageTags
|
||||||
|
.Primary
|
||||||
|
]
|
||||||
|
}
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
resolutionX={64}
|
||||||
|
resolutionY={96}
|
||||||
|
style={{
|
||||||
|
aspectRatio: 0.666,
|
||||||
|
}}
|
||||||
|
className="item-detail-image-blurhash"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<div className="item-detail-image-icon-container">
|
||||||
|
{TypeIconCollectionCard[item.data.Type]}
|
||||||
|
</div>
|
||||||
|
</Box>
|
||||||
|
<Box className="item-detail-info-container">
|
||||||
|
<Box
|
||||||
|
className="item-detail-title-name"
|
||||||
|
sx={{ mb: 2 }}
|
||||||
|
>
|
||||||
|
<Typography variant="h3">
|
||||||
|
{item.data.Name}
|
||||||
|
</Typography>
|
||||||
|
{!!item.data.UserData
|
||||||
|
.PlayedPercentage && (
|
||||||
|
<LinearProgress
|
||||||
|
variant="determinate"
|
||||||
|
value={
|
||||||
|
item.data.UserData
|
||||||
|
.PlayedPercentage
|
||||||
|
}
|
||||||
|
sx={{
|
||||||
|
borderRadius: 1000,
|
||||||
|
width: "75%",
|
||||||
|
mt: 1,
|
||||||
|
mb: 1,
|
||||||
|
}}
|
||||||
|
color="primary"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<Typography
|
||||||
|
variant="subtitle1"
|
||||||
|
color="gray"
|
||||||
|
>
|
||||||
|
{item.data.OriginalTitle}
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
|
<Stack
|
||||||
|
direction="row"
|
||||||
|
gap={2}
|
||||||
|
divider={
|
||||||
|
<Divider
|
||||||
|
variant="middle"
|
||||||
|
flexItem
|
||||||
|
orientation="vertical"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
ex={{ alignItems: "center" }}
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
sx={{ flexGrow: 0 }}
|
||||||
|
variant="subtitle1"
|
||||||
|
>
|
||||||
|
{item.data.ProductionYear}
|
||||||
|
</Typography>
|
||||||
|
<Chip
|
||||||
|
variant="outlined"
|
||||||
|
label={
|
||||||
|
!!item.data.OfficialRating
|
||||||
|
? item.data
|
||||||
|
.OfficialRating
|
||||||
|
: "Not Rated"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
display: "flex",
|
||||||
|
gap: "0.25em",
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
className="item-detail-info-rating"
|
||||||
|
>
|
||||||
|
{!!item.data.CommunityRating ? (
|
||||||
|
<>
|
||||||
|
<MdiStarHalfFull />
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
{Math.round(
|
||||||
|
item.data
|
||||||
|
.CommunityRating *
|
||||||
|
10,
|
||||||
|
) / 10}
|
||||||
|
</Typography>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
No Community Rating
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
{getRuntimeFull(
|
||||||
|
item.data.RunTimeTicks,
|
||||||
|
)}
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
<Box className="item-media-container">
|
||||||
|
<Stack
|
||||||
|
direction="row"
|
||||||
|
gap={1}
|
||||||
|
alignItems="center"
|
||||||
|
>
|
||||||
|
<Typography variant="h5">Genre</Typography>
|
||||||
|
{item.data.Genres.map((genre, index) => {
|
||||||
|
return (
|
||||||
|
<Chip
|
||||||
|
key={index}
|
||||||
|
variant="filled"
|
||||||
|
label={genre}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
|
<Typography variant="body1">
|
||||||
|
{item.data.Overview}
|
||||||
|
</Typography>
|
||||||
|
<CardScroller displayCards={8} title="Cast">
|
||||||
|
{item.data.People.map((person, index) => {
|
||||||
|
return (
|
||||||
|
<Card
|
||||||
|
key={index}
|
||||||
|
itemName={person.Name}
|
||||||
|
itemId={person.Id}
|
||||||
|
// imageTags={false}
|
||||||
|
imageTags={
|
||||||
|
!!person.PrimaryImageTag
|
||||||
|
}
|
||||||
|
iconType="Person"
|
||||||
|
subText={person.Role}
|
||||||
|
cardOrientation="sqaure"
|
||||||
|
currentUser={user.data}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</CardScroller>
|
||||||
|
</Box>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (item.isError) {
|
||||||
|
return <h1>{"Something went wrong :("}</h1>;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ItemMovie;
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/** @format */
|
||||||
|
|
||||||
|
.item-detail {
|
||||||
|
&-backdrop {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: inherit;
|
||||||
|
height: 100%;
|
||||||
|
z-index: -2;
|
||||||
|
opacity: 0.1;
|
||||||
|
}
|
||||||
|
&-header {
|
||||||
|
display: flex;
|
||||||
|
gap: 2em;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: flex-end;
|
||||||
|
position: relative;
|
||||||
|
&-backdrop {
|
||||||
|
position: absolute;
|
||||||
|
width: 100vw;
|
||||||
|
height: 150%;
|
||||||
|
top: -88px;
|
||||||
|
width: 100vw;
|
||||||
|
right: 0;
|
||||||
|
left: -24px;
|
||||||
|
z-index: -1;
|
||||||
|
filter: brightness(0.5);
|
||||||
|
mask-image: linear-gradient(0deg, transparent, black);
|
||||||
|
-webkit-mask-image: linear-gradient(0deg, transparent, black);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
position: absolute;
|
||||||
|
transition: opacity $transition-time-default;
|
||||||
|
&-blurhash {
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
&-container {
|
||||||
|
width: 15%;
|
||||||
|
position: relative;
|
||||||
|
aspect-ratio: 0.666;
|
||||||
|
border-radius: $border-radius-default;
|
||||||
|
overflow: hidden;
|
||||||
|
box-shadow: 0 0 15px rgb(0 0 0 / 0.4);
|
||||||
|
}
|
||||||
|
&-icon-container {
|
||||||
|
background: $clr-gradient-dark;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: -2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,362 @@
|
|||||||
|
/** @format */
|
||||||
|
import { useState, useEffect } from "react";
|
||||||
|
|
||||||
|
import Box from "@mui/material/Box";
|
||||||
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
|
import Typography from "@mui/material/Typography";
|
||||||
|
import Stack from "@mui/material/Stack";
|
||||||
|
import Chip from "@mui/material/Chip";
|
||||||
|
import useScrollTrigger from "@mui/material/useScrollTrigger";
|
||||||
|
import Divider from "@mui/material/Divider";
|
||||||
|
import LinearProgress from "@mui/material/LinearProgress";
|
||||||
|
import MenuItem from "@mui/material/MenuItem";
|
||||||
|
|
||||||
|
import { Blurhash } from "react-blurhash";
|
||||||
|
import {
|
||||||
|
setBackdrop,
|
||||||
|
showAppBar,
|
||||||
|
showBackButton,
|
||||||
|
} from "../../../utils/slice/appBar";
|
||||||
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
|
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
import { MdiStarHalfFull } from "../../../components/icons/mdiStarHalfFull";
|
||||||
|
import { getRuntimeFull } from "../../../utils/date/time";
|
||||||
|
import { TypeIconCollectionCard } from "../../../components/utils/iconsCollection";
|
||||||
|
|
||||||
|
import { Card } from "../../../components/card/card";
|
||||||
|
import { CardScroller } from "../../../components/cardScroller/cardScroller";
|
||||||
|
|
||||||
|
import "./Series.module.scss";
|
||||||
|
|
||||||
|
const ItemSeries = () => {
|
||||||
|
const { id } = useParams();
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const appBarVisiblity = useSelector((state) => state.appBar.visible);
|
||||||
|
const [scrollTarget, setScrollTarget] = useState(undefined);
|
||||||
|
const [primageImageLoaded, setPrimaryImageLoaded] = useState(false);
|
||||||
|
const [backdropImageLoaded, setBackdropImageLoaded] = useState(false);
|
||||||
|
|
||||||
|
const trigger = useScrollTrigger({
|
||||||
|
disableHysteresis: true,
|
||||||
|
threshold: 0,
|
||||||
|
target: scrollTarget,
|
||||||
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!appBarVisiblity) {
|
||||||
|
dispatch(showAppBar());
|
||||||
|
}
|
||||||
|
dispatch(setBackdrop(trigger));
|
||||||
|
dispatch(showBackButton());
|
||||||
|
}, [trigger]);
|
||||||
|
|
||||||
|
const user = useQuery({
|
||||||
|
queryKey: ["user"],
|
||||||
|
queryFn: async () => {
|
||||||
|
let usr = await getUserApi(window.api).getCurrentUser();
|
||||||
|
return usr.data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const item = useQuery({
|
||||||
|
queryKey: ["item, Series", id],
|
||||||
|
queryFn: async () => {
|
||||||
|
const result = await getUserLibraryApi(window.api).getItem({
|
||||||
|
userId: user.data.Id,
|
||||||
|
itemId: id,
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
enabled: !!user.data,
|
||||||
|
});
|
||||||
|
if (item.isLoading) {
|
||||||
|
return (
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
width: "100%",
|
||||||
|
height: "100%",
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<CircularProgress />
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (item.isSuccess) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Box className="item-detail-backdrop">
|
||||||
|
{item.data.BackdropImageTags.length != 0 && (
|
||||||
|
<Blurhash
|
||||||
|
hash={
|
||||||
|
item.data.ImageBlurHashes.Backdrop[
|
||||||
|
item.data.BackdropImageTags[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
resolutionX={64}
|
||||||
|
resolutionY={96}
|
||||||
|
style={{
|
||||||
|
aspectRatio: "0.666",
|
||||||
|
}}
|
||||||
|
className="item-detail-image-blurhash"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
<Box
|
||||||
|
recomponent="main"
|
||||||
|
className="scrollY"
|
||||||
|
sx={{
|
||||||
|
display: "flex",
|
||||||
|
pt: 11,
|
||||||
|
px: 3,
|
||||||
|
pb: 3,
|
||||||
|
position: "relative",
|
||||||
|
flexFlow: "column",
|
||||||
|
gap: 5,
|
||||||
|
}}
|
||||||
|
ref={(node) => {
|
||||||
|
if (node) {
|
||||||
|
setScrollTarget(node);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Box className="item-detail-header">
|
||||||
|
<Box className="item-detail-header-backdrop">
|
||||||
|
{item.data.BackdropImageTags.length != 0 && (
|
||||||
|
<img
|
||||||
|
src={
|
||||||
|
window.api.basePath +
|
||||||
|
"/Items/" +
|
||||||
|
item.data.Id +
|
||||||
|
"/Images/Backdrop"
|
||||||
|
}
|
||||||
|
style={{
|
||||||
|
opacity: backdropImageLoaded
|
||||||
|
? 1
|
||||||
|
: 0,
|
||||||
|
}}
|
||||||
|
className="item-detail-image"
|
||||||
|
onLoad={() =>
|
||||||
|
setBackdropImageLoaded(true)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{item.data.BackdropImageTags.length != 0 && (
|
||||||
|
<Blurhash
|
||||||
|
hash={
|
||||||
|
item.data.ImageBlurHashes
|
||||||
|
.Backdrop[
|
||||||
|
item.data
|
||||||
|
.BackdropImageTags[0]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
resolutionX={64}
|
||||||
|
resolutionY={96}
|
||||||
|
style={{
|
||||||
|
aspectRatio: "0.666",
|
||||||
|
}}
|
||||||
|
className="item-detail-image-blurhash"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<Box
|
||||||
|
sx={{ fontSize: "4em" }}
|
||||||
|
className="item-detail-image-icon-container"
|
||||||
|
>
|
||||||
|
{TypeIconCollectionCard[item.data.Type]}
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
<Box className="item-detail-image-container">
|
||||||
|
{!!item.data.ImageTags.Primary && (
|
||||||
|
<img
|
||||||
|
src={
|
||||||
|
window.api.basePath +
|
||||||
|
"/Items/" +
|
||||||
|
item.data.Id +
|
||||||
|
"/Images/Primary"
|
||||||
|
}
|
||||||
|
style={{
|
||||||
|
opacity: primageImageLoaded
|
||||||
|
? 1
|
||||||
|
: 0,
|
||||||
|
}}
|
||||||
|
className="item-detail-image"
|
||||||
|
onLoad={() =>
|
||||||
|
setPrimaryImageLoaded(true)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!!item.data.ImageBlurHashes.Primary && (
|
||||||
|
<Blurhash
|
||||||
|
hash={
|
||||||
|
item.data.ImageBlurHashes
|
||||||
|
.Primary[
|
||||||
|
item.data.ImageTags
|
||||||
|
.Primary
|
||||||
|
]
|
||||||
|
}
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
resolutionX={64}
|
||||||
|
resolutionY={96}
|
||||||
|
style={{
|
||||||
|
aspectRatio: 0.666,
|
||||||
|
}}
|
||||||
|
className="item-detail-image-blurhash"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<div className="item-detail-image-icon-container">
|
||||||
|
{TypeIconCollectionCard[item.data.Type]}
|
||||||
|
</div>
|
||||||
|
</Box>
|
||||||
|
<Box className="item-detail-info-container">
|
||||||
|
<Box
|
||||||
|
className="item-detail-title-name"
|
||||||
|
sx={{ mb: 2 }}
|
||||||
|
>
|
||||||
|
<Typography variant="h3">
|
||||||
|
{item.data.Name}
|
||||||
|
</Typography>
|
||||||
|
{!!item.data.UserData
|
||||||
|
.PlayedPercentage && (
|
||||||
|
<LinearProgress
|
||||||
|
variant="determinate"
|
||||||
|
value={
|
||||||
|
item.data.UserData
|
||||||
|
.PlayedPercentage
|
||||||
|
}
|
||||||
|
sx={{
|
||||||
|
borderRadius: 1000,
|
||||||
|
width: "75%",
|
||||||
|
mt: 1,
|
||||||
|
mb: 1,
|
||||||
|
}}
|
||||||
|
color="primary"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<Typography
|
||||||
|
variant="subtitle1"
|
||||||
|
color="gray"
|
||||||
|
>
|
||||||
|
{item.data.OriginalTitle}
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
|
<Stack
|
||||||
|
direction="row"
|
||||||
|
gap={2}
|
||||||
|
divider={
|
||||||
|
<Divider
|
||||||
|
variant="middle"
|
||||||
|
flexItem
|
||||||
|
orientation="vertical"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
ex={{ alignItems: "center" }}
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
sx={{ flexGrow: 0 }}
|
||||||
|
variant="subtitle1"
|
||||||
|
>
|
||||||
|
{item.data.ProductionYear}
|
||||||
|
</Typography>
|
||||||
|
<Chip
|
||||||
|
variant="outlined"
|
||||||
|
label={
|
||||||
|
!!item.data.OfficialRating
|
||||||
|
? item.data
|
||||||
|
.OfficialRating
|
||||||
|
: "Not Rated"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
display: "flex",
|
||||||
|
gap: "0.25em",
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
className="item-detail-info-rating"
|
||||||
|
>
|
||||||
|
{!!item.data.CommunityRating ? (
|
||||||
|
<>
|
||||||
|
<MdiStarHalfFull />
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
{Math.round(
|
||||||
|
item.data
|
||||||
|
.CommunityRating *
|
||||||
|
10,
|
||||||
|
) / 10}
|
||||||
|
</Typography>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
No Community Rating
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
<Typography variant="subtitle1">
|
||||||
|
{getRuntimeFull(
|
||||||
|
item.data.RunTimeTicks,
|
||||||
|
)}
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
<Box className="item-media-container">
|
||||||
|
<Stack
|
||||||
|
direction="row"
|
||||||
|
gap={1}
|
||||||
|
alignItems="center"
|
||||||
|
>
|
||||||
|
<Typography variant="h5">Genre</Typography>
|
||||||
|
{item.data.Genres.map((genre, index) => {
|
||||||
|
return (
|
||||||
|
<Chip
|
||||||
|
key={index}
|
||||||
|
variant="filled"
|
||||||
|
label={genre}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
|
<Typography variant="body1">
|
||||||
|
{item.data.Overview}
|
||||||
|
</Typography>
|
||||||
|
<CardScroller displayCards={8} title="Cast">
|
||||||
|
{item.data.People.map((person, index) => {
|
||||||
|
return (
|
||||||
|
<Card
|
||||||
|
key={index}
|
||||||
|
itemName={person.Name}
|
||||||
|
itemId={person.Id}
|
||||||
|
// imageTags={false}
|
||||||
|
imageTags={
|
||||||
|
!!person.PrimaryImageTag
|
||||||
|
}
|
||||||
|
iconType="Person"
|
||||||
|
subText={person.Role}
|
||||||
|
cardOrientation="sqaure"
|
||||||
|
currentUser={user.data}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</CardScroller>
|
||||||
|
</Box>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (item.isError) {
|
||||||
|
return <h1>{"Something went wrong :("}</h1>;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ItemSeries;
|
||||||
+822
-2
@@ -1,9 +1,829 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useParams } from "react-router-dom";
|
import { useState, useEffect } from "react";
|
||||||
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
import {
|
||||||
|
showAppBar,
|
||||||
|
setBackdrop,
|
||||||
|
showBackButton,
|
||||||
|
} from "../../utils/slice/appBar";
|
||||||
|
import { useParams, useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
|
import Box from "@mui/material/Box";
|
||||||
|
import Grid2 from "@mui/material/Unstable_Grid2";
|
||||||
|
import Stack from "@mui/material/Stack";
|
||||||
|
import AppBar from "@mui/material/AppBar";
|
||||||
|
import Toolbar from "@mui/material/Toolbar";
|
||||||
|
import Typography from "@mui/material/Typography";
|
||||||
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
|
import Divider from "@mui/material/Divider";
|
||||||
|
import Chip from "@mui/material/Chip";
|
||||||
|
import TextField from "@mui/material/TextField";
|
||||||
|
import Checkbox from "@mui/material/Checkbox";
|
||||||
|
import Menu from "@mui/material/Menu";
|
||||||
|
import MenuItem from "@mui/material/MenuItem";
|
||||||
|
import Accordion from "@mui/material/Accordion";
|
||||||
|
import AccordionSummary from "@mui/material/AccordionSummary";
|
||||||
|
import AccordionDetails from "@mui/material/AccordionDetails";
|
||||||
|
import Button from "@mui/material/Button";
|
||||||
|
|
||||||
|
import { theme } from "../../theme";
|
||||||
|
|
||||||
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
|
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||||
|
import { getArtistsApi } from "@jellyfin/sdk/lib/utils/api/artists-api";
|
||||||
|
import { getGenresApi } from "@jellyfin/sdk/lib/utils/api/genres-api";
|
||||||
|
import { getMusicGenresApi } from "@jellyfin/sdk/lib/utils/api/music-genres-api";
|
||||||
|
import { getStudiosApi } from "@jellyfin/sdk/lib/utils/api/studios-api";
|
||||||
|
import { getPersonsApi } from "@jellyfin/sdk/lib/utils/api/persons-api";
|
||||||
|
|
||||||
|
import { Card } from "../../components/card/card";
|
||||||
|
import { EmptyNotice } from "../../components/emptyNotice/emptyNotice";
|
||||||
|
|
||||||
|
import { MdiSortDescending } from "../../components/icons/mdiSortDescending";
|
||||||
|
import { MdiSortAscending } from "../../components/icons/mdiSortAscending";
|
||||||
|
import { MdiChevronDown } from "../../components/icons/mdiChevronDown";
|
||||||
|
import { MdiFilterOutline } from "../../components/icons/mdiFilterOutline";
|
||||||
|
|
||||||
const LibraryView = () => {
|
const LibraryView = () => {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const appBarVisiblity = useSelector((state) => state.appBar.visible);
|
||||||
|
|
||||||
|
if (!appBarVisiblity) {
|
||||||
|
dispatch(showAppBar());
|
||||||
|
}
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
return <h1>{id}</h1>;
|
|
||||||
|
const user = useQuery({
|
||||||
|
queryKey: ["libraryView", "user"],
|
||||||
|
queryFn: async () => {
|
||||||
|
let usr = await getUserApi(window.api).getCurrentUser();
|
||||||
|
return usr.data;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const [sortAscending, setSortAscending] = useState(false);
|
||||||
|
const [sortBy, setSortBy] = useState("SortName");
|
||||||
|
const [sortByData, setSortByData] = useState([
|
||||||
|
{ title: "Name", value: "SortName" },
|
||||||
|
{ title: "Rating", value: "CommunityRating" },
|
||||||
|
{ title: "Release Date", value: "PremiereDate" },
|
||||||
|
]);
|
||||||
|
const handleSortChange = (e) => {
|
||||||
|
setSortAscending(e.target.checked);
|
||||||
|
};
|
||||||
|
const handleSortBy = (e) => {
|
||||||
|
setSortBy(e.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const fetchLib = async (libraryId) => {
|
||||||
|
const result = await getItemsApi(window.api).getItems({
|
||||||
|
userId: user.data.Id,
|
||||||
|
ids: [libraryId],
|
||||||
|
});
|
||||||
|
return result.data;
|
||||||
|
};
|
||||||
|
const currentLib = useQuery({
|
||||||
|
queryKey: ["libraryView", "currentLib", id],
|
||||||
|
queryFn: () => fetchLib(id),
|
||||||
|
enabled: !!user.data,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (currentLib.isSuccess) {
|
||||||
|
dispatch(showBackButton());
|
||||||
|
}
|
||||||
|
|
||||||
|
const [isPlayed, setIsPlayed] = useState(false);
|
||||||
|
const [isUnPlayed, setIsUnPlayed] = useState(false);
|
||||||
|
const [isResumable, setIsResumable] = useState(false);
|
||||||
|
const [isFavourite, setIsFavourite] = useState(false);
|
||||||
|
const [isLiked, setIsLiked] = useState(false);
|
||||||
|
const [isUnliked, setIsUnliked] = useState(false);
|
||||||
|
const availableWatchStatus = [
|
||||||
|
{
|
||||||
|
title: "Played",
|
||||||
|
value: false,
|
||||||
|
state: (val) => setIsPlayed(val),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Unplayed",
|
||||||
|
value: false,
|
||||||
|
state: (val) => setIsUnPlayed(val),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Resumable",
|
||||||
|
value: false,
|
||||||
|
state: (val) => setIsResumable(val),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Favourite",
|
||||||
|
value: false,
|
||||||
|
state: (val) => setIsFavourite(val),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Liked",
|
||||||
|
value: false,
|
||||||
|
state: (val) => setIsLiked(val),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "UnLiked",
|
||||||
|
value: false,
|
||||||
|
state: (val) => setIsUnliked(val),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const [hasSubtitles, setHasSubtitles] = useState(false);
|
||||||
|
const [hasTrailer, setHasTrailer] = useState(false);
|
||||||
|
const [hasSpecialFeature, setHasSpecialFeature] = useState(false);
|
||||||
|
const [hasThemeSong, setHasThemeSong] = useState(false);
|
||||||
|
const [hasThemeVideo, setHasThemeVideo] = useState(false);
|
||||||
|
const availableFeatureFilters = [
|
||||||
|
{
|
||||||
|
title: "Subtitles",
|
||||||
|
value: false,
|
||||||
|
state: (val) => setHasSubtitles(val),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Trailer",
|
||||||
|
value: false,
|
||||||
|
state: (val) => setHasTrailer(val),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Special Feature",
|
||||||
|
value: false,
|
||||||
|
state: (val) => setHasSpecialFeature(val),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Theme Song",
|
||||||
|
value: false,
|
||||||
|
state: (val) => setHasThemeSong(val),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Theme Video",
|
||||||
|
vslue: false,
|
||||||
|
state: (val) => setHasThemeVideo(val),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const [isBluRay, setIsBluRay] = useState(false);
|
||||||
|
const [isDVD, setIsDVD] = useState(false);
|
||||||
|
const [isHD, setIsHD] = useState(false);
|
||||||
|
const [is4K, setIs4K] = useState(false);
|
||||||
|
const [is3D, setIs3D] = useState(false);
|
||||||
|
const availableVideoTypeFilters = [
|
||||||
|
{ title: "Blu-Ray", value: false, state: (val) => setIsBluRay(val) },
|
||||||
|
{ title: "DVD", value: false, state: (val) => setIsDVD(val) },
|
||||||
|
{ title: "HD", value: false, state: (val) => setIsHD(val) },
|
||||||
|
{ title: "4K", value: false, state: (val) => setIs4K(val) },
|
||||||
|
{ title: "3D", value: false, state: (val) => setIs3D(val) },
|
||||||
|
];
|
||||||
|
|
||||||
|
const [currentViewType, setCurrentViewType] = useState(undefined);
|
||||||
|
const [viewType, setViewType] = useState([]);
|
||||||
|
useEffect(() => {
|
||||||
|
if (currentLib.isSuccess) {
|
||||||
|
if (currentLib.data.Items[0].CollectionType == "movies") {
|
||||||
|
setViewType([
|
||||||
|
{ title: "Movies", value: "Movie" },
|
||||||
|
{ title: "Collections", value: "BoxSet" },
|
||||||
|
{ title: "Actors", value: "Person" },
|
||||||
|
{ title: "Genres", value: "Genre" },
|
||||||
|
{ title: "Studios", value: "Studio" },
|
||||||
|
]);
|
||||||
|
} else if (currentLib.data.Items[0].CollectionType == "music") {
|
||||||
|
setViewType([
|
||||||
|
{ title: "Albums", value: "MusicAlbum" },
|
||||||
|
{ title: "Artists", value: "MusicArtist" },
|
||||||
|
{ title: "Genres", value: "MusicGenre" },
|
||||||
|
]);
|
||||||
|
} else if (
|
||||||
|
currentLib.data.Items[0].CollectionType == "tvshows"
|
||||||
|
) {
|
||||||
|
setViewType([
|
||||||
|
{ title: "Series", value: "Series" },
|
||||||
|
{ title: "Actors", value: "Person" },
|
||||||
|
{ title: "Genres", value: "Genre" },
|
||||||
|
{ title: "Networks", value: "Studio" },
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
setViewType([]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [currentLib.isSuccess]);
|
||||||
|
|
||||||
|
const fetchLibItems = async (libraryId) => {
|
||||||
|
let result;
|
||||||
|
if (currentViewType == "MusicArtist") {
|
||||||
|
result = await getArtistsApi(window.api).getAlbumArtists({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: libraryId,
|
||||||
|
});
|
||||||
|
} else if (currentViewType == "Person") {
|
||||||
|
result = await getPersonsApi(window.api).getPersons({
|
||||||
|
userId: user.data.Id,
|
||||||
|
personTypes: ["Actor"],
|
||||||
|
});
|
||||||
|
} else if (currentViewType == "Genre") {
|
||||||
|
result = await getGenresApi(window.api).getGenres({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: libraryId,
|
||||||
|
});
|
||||||
|
} else if (currentViewType == "MusicGenre") {
|
||||||
|
result = await getMusicGenresApi(window.api).getMusicGenres({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: libraryId,
|
||||||
|
});
|
||||||
|
} else if (currentViewType == "Studio") {
|
||||||
|
result = await getStudiosApi(window.api).getStudios({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: libraryId,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
result = await getItemsApi(window.api).getItems({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: libraryId,
|
||||||
|
recursive: true,
|
||||||
|
includeItemTypes: [currentViewType],
|
||||||
|
sortOrder: [sortAscending ? "Ascending" : "Descending"],
|
||||||
|
sortBy: sortBy,
|
||||||
|
filters: [
|
||||||
|
isPlayed && "IsPlayed",
|
||||||
|
isUnPlayed && "IsUnplayed",
|
||||||
|
isResumable && "IsResumable",
|
||||||
|
isFavourite && "IsFavorite",
|
||||||
|
isLiked && "IsFavoriteOrLikes",
|
||||||
|
isUnliked && "Dislikes",
|
||||||
|
],
|
||||||
|
hasSubtitles: hasSubtitles ? true : undefined,
|
||||||
|
hasTrailer: hasTrailer ? true : undefined,
|
||||||
|
hasSpecialFeature: hasSpecialFeature ? true : undefined,
|
||||||
|
hasThemeSong: hasThemeSong ? true : undefined,
|
||||||
|
hasThemeVideo: hasThemeVideo ? true : undefined,
|
||||||
|
videoTypes: [isBluRay && "BluRay", isDVD && "Dvd"],
|
||||||
|
isHd: isHD ? true : undefined,
|
||||||
|
is4K: is4K ? true : undefined,
|
||||||
|
is3D: is3D ? true : undefined,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return result.data;
|
||||||
|
};
|
||||||
|
|
||||||
|
const items = useQuery({
|
||||||
|
queryKey: [
|
||||||
|
"libraryView",
|
||||||
|
"currentLibItems",
|
||||||
|
id,
|
||||||
|
[
|
||||||
|
currentViewType,
|
||||||
|
sortAscending,
|
||||||
|
sortBy,
|
||||||
|
[
|
||||||
|
isPlayed,
|
||||||
|
isUnPlayed,
|
||||||
|
isResumable,
|
||||||
|
isFavourite,
|
||||||
|
isLiked,
|
||||||
|
isUnliked,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
hasSubtitles,
|
||||||
|
hasTrailer,
|
||||||
|
hasSpecialFeature,
|
||||||
|
hasThemeSong,
|
||||||
|
hasThemeVideo,
|
||||||
|
],
|
||||||
|
[isBluRay, isDVD, isHD, is4K, is3D],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
queryFn: () => fetchLibItems(id),
|
||||||
|
enabled: !!user.data,
|
||||||
|
});
|
||||||
|
|
||||||
|
dispatch(setBackdrop(true));
|
||||||
|
|
||||||
|
const handleCurrentViewType = (e) => {
|
||||||
|
setCurrentViewType(e.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (viewType.length != 0) setCurrentViewType(viewType[0].value);
|
||||||
|
}, [viewType]);
|
||||||
|
|
||||||
|
const allowedSortViews = ["Movie", "Series", "MusicAlbum"];
|
||||||
|
const allowedFilterViews = ["movies", "tvshows", "music", "books"];
|
||||||
|
const onlyStatusFilterViews = ["books", "music"];
|
||||||
|
|
||||||
|
const [filterButtonAnchorEl, setFilterButtonAnchorEl] = useState(null);
|
||||||
|
const filterMenuOpen = Boolean(filterButtonAnchorEl);
|
||||||
|
const openFiltersMenu = (event) => {
|
||||||
|
setFilterButtonAnchorEl(event.currentTarget);
|
||||||
|
};
|
||||||
|
const closeFiltersMenu = () => {
|
||||||
|
setFilterButtonAnchorEl(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
display: "flex",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Box
|
||||||
|
component="main"
|
||||||
|
className="scrollY"
|
||||||
|
sx={{
|
||||||
|
flexGrow: 1,
|
||||||
|
pt: 19,
|
||||||
|
px: 3,
|
||||||
|
pb: 3,
|
||||||
|
position: "relative",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<AppBar
|
||||||
|
position="fixed"
|
||||||
|
elevation={0}
|
||||||
|
sx={{
|
||||||
|
width: `calc(100vw - ${theme.spacing(7)} - 10px)`,
|
||||||
|
mt: 8,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Divider />
|
||||||
|
<Toolbar sx={{ justifyContent: "space-between" }}>
|
||||||
|
<Stack alignItems="center" direction="row">
|
||||||
|
<Typography
|
||||||
|
variant="h5"
|
||||||
|
sx={{ mr: 2, flexShrink: 0 }}
|
||||||
|
noWrap
|
||||||
|
>
|
||||||
|
{currentLib.isLoading ? (
|
||||||
|
<CircularProgress sx={{ p: 1 }} />
|
||||||
|
) : (
|
||||||
|
currentLib.data.Items[0].Name
|
||||||
|
)}
|
||||||
|
</Typography>
|
||||||
|
<Chip
|
||||||
|
label={
|
||||||
|
items.isLoading ? (
|
||||||
|
<CircularProgress
|
||||||
|
sx={{ p: 1.5 }}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
items.data.TotalRecordCount
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
{/* <InputLabel id="demo-simple-select-label">
|
||||||
|
Age
|
||||||
|
</InputLabel> */}
|
||||||
|
<Stack
|
||||||
|
direction="row"
|
||||||
|
spacing={2}
|
||||||
|
divider={
|
||||||
|
<Divider
|
||||||
|
orientation="vertical"
|
||||||
|
flexItem
|
||||||
|
variant="inset"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{currentLib.isSuccess &&
|
||||||
|
allowedFilterViews.includes(
|
||||||
|
currentLib.data.Items[0]
|
||||||
|
.CollectionType,
|
||||||
|
) && (
|
||||||
|
<>
|
||||||
|
<Button
|
||||||
|
id="basic-button"
|
||||||
|
aria-controls={
|
||||||
|
open
|
||||||
|
? "basic-menu"
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
|
aria-haspopup="true"
|
||||||
|
aria-expanded={
|
||||||
|
open
|
||||||
|
? "true"
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
|
startIcon={
|
||||||
|
<MdiFilterOutline />
|
||||||
|
}
|
||||||
|
endIcon={
|
||||||
|
<MdiChevronDown />
|
||||||
|
}
|
||||||
|
onClick={openFiltersMenu}
|
||||||
|
color="white"
|
||||||
|
// sx={{ p: 1 }}
|
||||||
|
// size="small"
|
||||||
|
>
|
||||||
|
Filter
|
||||||
|
</Button>
|
||||||
|
<Menu
|
||||||
|
id="basic-menu"
|
||||||
|
anchorEl={
|
||||||
|
filterButtonAnchorEl
|
||||||
|
}
|
||||||
|
open={filterMenuOpen}
|
||||||
|
onClose={
|
||||||
|
closeFiltersMenu
|
||||||
|
}
|
||||||
|
MenuListProps={{
|
||||||
|
"aria-labelledby":
|
||||||
|
"basic-button",
|
||||||
|
sx: { p: 1 },
|
||||||
|
}}
|
||||||
|
anchorOrigin={{
|
||||||
|
vertical: "bottom",
|
||||||
|
horizontal:
|
||||||
|
"center",
|
||||||
|
}}
|
||||||
|
transformOrigin={{
|
||||||
|
vertical: "top",
|
||||||
|
horizontal:
|
||||||
|
"center",
|
||||||
|
}}
|
||||||
|
sx={{
|
||||||
|
maxHeight: "55%",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Accordion>
|
||||||
|
<AccordionSummary
|
||||||
|
expandIcon={
|
||||||
|
<MdiChevronDown />
|
||||||
|
}
|
||||||
|
aria-controls="panel1bh-content"
|
||||||
|
id="panel1bh-header"
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
sx={{
|
||||||
|
width: "33%",
|
||||||
|
flexShrink: 0,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Status
|
||||||
|
</Typography>
|
||||||
|
</AccordionSummary>
|
||||||
|
<Divider />
|
||||||
|
<AccordionDetails
|
||||||
|
sx={{
|
||||||
|
maxHeight:
|
||||||
|
"15em",
|
||||||
|
overflow:
|
||||||
|
"auto",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Stack>
|
||||||
|
{availableWatchStatus.map(
|
||||||
|
(
|
||||||
|
item,
|
||||||
|
index,
|
||||||
|
) => {
|
||||||
|
return (
|
||||||
|
<MenuItem
|
||||||
|
sx={{
|
||||||
|
justifyContent:
|
||||||
|
"space-between",
|
||||||
|
}}
|
||||||
|
key={
|
||||||
|
index
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{
|
||||||
|
item.title
|
||||||
|
}
|
||||||
|
<Checkbox
|
||||||
|
value={
|
||||||
|
item.value
|
||||||
|
}
|
||||||
|
onChange={(
|
||||||
|
e,
|
||||||
|
) =>
|
||||||
|
item.state(
|
||||||
|
e
|
||||||
|
.target
|
||||||
|
.checked,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</MenuItem>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
</AccordionDetails>
|
||||||
|
</Accordion>
|
||||||
|
{!onlyStatusFilterViews.includes(
|
||||||
|
currentLib.data
|
||||||
|
.Items[0]
|
||||||
|
.CollectionType,
|
||||||
|
) && (
|
||||||
|
<Accordion>
|
||||||
|
<AccordionSummary
|
||||||
|
expandIcon={
|
||||||
|
<MdiChevronDown />
|
||||||
|
}
|
||||||
|
aria-controls="panel1bh-content"
|
||||||
|
id="panel1bh-header"
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
sx={{
|
||||||
|
width: "33%",
|
||||||
|
flexShrink: 0,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Features
|
||||||
|
</Typography>
|
||||||
|
</AccordionSummary>
|
||||||
|
<Divider />
|
||||||
|
<AccordionDetails
|
||||||
|
sx={{
|
||||||
|
maxHeight:
|
||||||
|
"15em",
|
||||||
|
overflow:
|
||||||
|
"auto",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Stack>
|
||||||
|
{availableFeatureFilters.map(
|
||||||
|
(
|
||||||
|
item,
|
||||||
|
index,
|
||||||
|
) => {
|
||||||
|
return (
|
||||||
|
<MenuItem
|
||||||
|
sx={{
|
||||||
|
justifyContent:
|
||||||
|
"space-between",
|
||||||
|
}}
|
||||||
|
key={
|
||||||
|
index
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{
|
||||||
|
item.title
|
||||||
|
}
|
||||||
|
<Checkbox
|
||||||
|
value={
|
||||||
|
item.value
|
||||||
|
}
|
||||||
|
onChange={(
|
||||||
|
e,
|
||||||
|
) =>
|
||||||
|
item.state(
|
||||||
|
e
|
||||||
|
.target
|
||||||
|
.checked,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</MenuItem>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
</AccordionDetails>
|
||||||
|
</Accordion>
|
||||||
|
)}
|
||||||
|
{!onlyStatusFilterViews.includes(
|
||||||
|
currentLib.data
|
||||||
|
.Items[0]
|
||||||
|
.CollectionType,
|
||||||
|
) && (
|
||||||
|
<Accordion>
|
||||||
|
<AccordionSummary
|
||||||
|
expandIcon={
|
||||||
|
<MdiChevronDown />
|
||||||
|
}
|
||||||
|
aria-controls="panel1bh-content"
|
||||||
|
id="panel1bh-header"
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
sx={{
|
||||||
|
flexShrink: 0,
|
||||||
|
}}
|
||||||
|
noWrap
|
||||||
|
>
|
||||||
|
Video
|
||||||
|
Type
|
||||||
|
</Typography>
|
||||||
|
</AccordionSummary>
|
||||||
|
<Divider />
|
||||||
|
<AccordionDetails
|
||||||
|
sx={{
|
||||||
|
maxHeight:
|
||||||
|
"15em",
|
||||||
|
overflow:
|
||||||
|
"auto",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Stack>
|
||||||
|
{availableVideoTypeFilters.map(
|
||||||
|
(
|
||||||
|
item,
|
||||||
|
index,
|
||||||
|
) => {
|
||||||
|
return (
|
||||||
|
<MenuItem
|
||||||
|
sx={{
|
||||||
|
justifyContent:
|
||||||
|
"space-between",
|
||||||
|
}}
|
||||||
|
key={
|
||||||
|
index
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{
|
||||||
|
item.title
|
||||||
|
}
|
||||||
|
<Checkbox
|
||||||
|
value={
|
||||||
|
item.value
|
||||||
|
}
|
||||||
|
onChange={(
|
||||||
|
e,
|
||||||
|
) =>
|
||||||
|
item.state(
|
||||||
|
e
|
||||||
|
.target
|
||||||
|
.checked,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</MenuItem>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
</AccordionDetails>
|
||||||
|
</Accordion>
|
||||||
|
)}
|
||||||
|
</Menu>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
{allowedSortViews.includes(
|
||||||
|
currentViewType,
|
||||||
|
) && (
|
||||||
|
<>
|
||||||
|
<Checkbox
|
||||||
|
icon={<MdiSortDescending />}
|
||||||
|
checkedIcon={
|
||||||
|
<MdiSortAscending />
|
||||||
|
}
|
||||||
|
color="white"
|
||||||
|
onChange={handleSortChange}
|
||||||
|
defaultValue={sortAscending}
|
||||||
|
sx={{
|
||||||
|
color: "white !important",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<TextField
|
||||||
|
select
|
||||||
|
hiddenLabel
|
||||||
|
defaultValue={
|
||||||
|
sortByData[0].value
|
||||||
|
}
|
||||||
|
size="small"
|
||||||
|
variant="filled"
|
||||||
|
onChange={handleSortBy}
|
||||||
|
>
|
||||||
|
{sortByData.map(
|
||||||
|
(item, index) => {
|
||||||
|
return (
|
||||||
|
<MenuItem
|
||||||
|
key={
|
||||||
|
item.value
|
||||||
|
}
|
||||||
|
value={
|
||||||
|
item.value
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{`By ${item.title}`}
|
||||||
|
</MenuItem>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)}
|
||||||
|
</TextField>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
{viewType.length != 0 && (
|
||||||
|
<TextField
|
||||||
|
select
|
||||||
|
hiddenLabel
|
||||||
|
defaultValue={viewType[0].value}
|
||||||
|
size="small"
|
||||||
|
variant="filled"
|
||||||
|
onChange={handleCurrentViewType}
|
||||||
|
>
|
||||||
|
{viewType.map((item, index) => {
|
||||||
|
return (
|
||||||
|
<MenuItem
|
||||||
|
key={item.value}
|
||||||
|
value={item.value}
|
||||||
|
>
|
||||||
|
{item.title}
|
||||||
|
</MenuItem>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</TextField>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
</Toolbar>
|
||||||
|
</AppBar>
|
||||||
|
{items.isSuccess &&
|
||||||
|
(items.data.TotalRecordCount == 0 ? (
|
||||||
|
<EmptyNotice />
|
||||||
|
) : (
|
||||||
|
<Grid2
|
||||||
|
container
|
||||||
|
columns={{ xs: 3, sm: 5, md: 8 }}
|
||||||
|
>
|
||||||
|
{items.data.Items.map((item, index) => {
|
||||||
|
return (
|
||||||
|
<Grid2
|
||||||
|
key={index}
|
||||||
|
xs={1}
|
||||||
|
sm={1}
|
||||||
|
md={1}
|
||||||
|
>
|
||||||
|
<Card
|
||||||
|
itemName={item.Name}
|
||||||
|
itemId={item.Id}
|
||||||
|
imageTags={
|
||||||
|
!!item.ImageTags
|
||||||
|
.Primary
|
||||||
|
}
|
||||||
|
subText={
|
||||||
|
item.ProductionYear
|
||||||
|
}
|
||||||
|
iconType={item.Type}
|
||||||
|
playedPercent={
|
||||||
|
!!item.UserData
|
||||||
|
? item.UserData
|
||||||
|
.PlayedPercentage
|
||||||
|
: 0
|
||||||
|
}
|
||||||
|
cardOrientation={
|
||||||
|
item.Type ==
|
||||||
|
"MusicArtist" ||
|
||||||
|
item.Type ==
|
||||||
|
"MusicAlbum" ||
|
||||||
|
item.Type ==
|
||||||
|
"MusicGenre" ||
|
||||||
|
item.Type ==
|
||||||
|
"Playlist"
|
||||||
|
? "square"
|
||||||
|
: "portait"
|
||||||
|
}
|
||||||
|
watchedStatus={
|
||||||
|
!!item.UserData
|
||||||
|
? item.UserData
|
||||||
|
.Played
|
||||||
|
: false
|
||||||
|
}
|
||||||
|
watchedCount={
|
||||||
|
!!item.UserData &&
|
||||||
|
item.UserData
|
||||||
|
.UnplayedItemCount
|
||||||
|
}
|
||||||
|
blurhash={
|
||||||
|
item.ImageBlurHashes ==
|
||||||
|
{}
|
||||||
|
? ""
|
||||||
|
: !!item
|
||||||
|
.ImageTags
|
||||||
|
.Primary
|
||||||
|
? !!item
|
||||||
|
.ImageBlurHashes
|
||||||
|
.Primary
|
||||||
|
? item
|
||||||
|
.ImageBlurHashes
|
||||||
|
.Primary[
|
||||||
|
item
|
||||||
|
.ImageTags
|
||||||
|
.Primary
|
||||||
|
]
|
||||||
|
: ""
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
currentUser={user.data}
|
||||||
|
onClickEvent={() => {
|
||||||
|
navigate(
|
||||||
|
`/item/${item.Type}/${item.Id}`,
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
></Card>
|
||||||
|
</Grid2>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Grid2>
|
||||||
|
))}
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default LibraryView;
|
export default LibraryView;
|
||||||
@@ -1,15 +1,18 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
|
z-index: 10000;
|
||||||
width: 10px;
|
width: 10px;
|
||||||
background: $clr-background-dark;
|
background: $clr-background-dark;
|
||||||
}
|
}
|
||||||
::-webkit-scrollbar-track {
|
::-webkit-scrollbar-track {
|
||||||
|
z-index: 10000;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
&:hover {
|
&:hover {
|
||||||
background: rgb(255 255 255 / 0.25);
|
background: rgb(255 255 255 / 0.25);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
::-webkit-scrollbar-thumb {
|
::-webkit-scrollbar-thumb {
|
||||||
|
z-index: 10000;
|
||||||
background: rgb(255 255 255 / 0.25);
|
background: rgb(255 255 255 / 0.25);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,8 +29,9 @@ body {
|
|||||||
#root,
|
#root,
|
||||||
.root-page {
|
.root-page {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
width: 100vw;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.centered {
|
.centered {
|
||||||
@@ -79,6 +83,7 @@ h1 {
|
|||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
width: inherit;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,3 +22,18 @@ export const getRuntime = (ticks) => {
|
|||||||
}
|
}
|
||||||
return formatedTime;
|
return formatedTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getRuntimeFull = (ticks) => {
|
||||||
|
let time = ticksToMs(ticks);
|
||||||
|
let formatedTime = "";
|
||||||
|
let timeSec = Math.round(time / 1000);
|
||||||
|
let timeMin = Math.round(timeSec / 60);
|
||||||
|
if (timeMin > 60) {
|
||||||
|
let timeHr = Math.floor(timeMin / 60);
|
||||||
|
timeMin -= timeHr * 60;
|
||||||
|
formatedTime = `${timeHr} hour ${timeMin} minutes`;
|
||||||
|
} else {
|
||||||
|
formatedTime = `${timeMin} minutes`;
|
||||||
|
}
|
||||||
|
return formatedTime;
|
||||||
|
};
|
||||||
@@ -6,6 +6,7 @@ export const appBarSlice = createSlice({
|
|||||||
initialState: {
|
initialState: {
|
||||||
visible: false,
|
visible: false,
|
||||||
backdrop: false,
|
backdrop: false,
|
||||||
|
backButtonVisible: false,
|
||||||
},
|
},
|
||||||
reducers: {
|
reducers: {
|
||||||
showAppBar: (state) => {
|
showAppBar: (state) => {
|
||||||
@@ -17,8 +18,20 @@ export const appBarSlice = createSlice({
|
|||||||
setBackdrop: (state, action) => {
|
setBackdrop: (state, action) => {
|
||||||
state.backdrop = action.payload;
|
state.backdrop = action.payload;
|
||||||
},
|
},
|
||||||
|
showBackButton: (state, action) => {
|
||||||
|
state.backButtonVisible = true;
|
||||||
|
},
|
||||||
|
hideBackButton: (state) => {
|
||||||
|
state.backButtonVisible = false;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const { showAppBar, hideAppBar, setBackdrop } = appBarSlice.actions;
|
export const {
|
||||||
|
showAppBar,
|
||||||
|
hideAppBar,
|
||||||
|
setBackdrop,
|
||||||
|
showBackButton,
|
||||||
|
hideBackButton,
|
||||||
|
} = appBarSlice.actions;
|
||||||
export default appBarSlice.reducer;
|
export default appBarSlice.reducer;
|
||||||
@@ -5,6 +5,7 @@ export const sideBarSlice = createSlice({
|
|||||||
name: "sidebar",
|
name: "sidebar",
|
||||||
initialState: {
|
initialState: {
|
||||||
visible: false,
|
visible: false,
|
||||||
|
backdrop: true,
|
||||||
},
|
},
|
||||||
reducers: {
|
reducers: {
|
||||||
showSidemenu: (state) => {
|
showSidemenu: (state) => {
|
||||||
@@ -13,8 +14,11 @@ export const sideBarSlice = createSlice({
|
|||||||
hideSidemenu: (state) => {
|
hideSidemenu: (state) => {
|
||||||
state.visible = false;
|
state.visible = false;
|
||||||
},
|
},
|
||||||
|
setBackdrop: (state, action) => {
|
||||||
|
state.backdrop = action.payload;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const { showSidemenu, hideSidemenu } = sideBarSlice.actions;
|
export const { showSidemenu, hideSidemenu, setBackdrop } = sideBarSlice.actions;
|
||||||
export default sideBarSlice.reducer;
|
export default sideBarSlice.reducer;
|
||||||
Reference in new issue
Block a user