Compare commits

...
Author SHA1 Message Date
prayag17 fd8c6431d5 More updates to titlePage #26 2023-04-09 12:09:35 +05:30
prayag17 b8dc3828e8 Add more details to ItemMovie #26 2023-04-08 19:14:57 +05:30
prayag17 909aead056 Start working on Movie itempage #26 2023-04-08 14:57:02 +05:30
prayag17 88474b494b Add Card button actions #24 2023-04-08 13:23:28 +05:30
prayag17 3833f4d626 Add more filter option to libView #9 2023-04-07 15:09:58 +05:30
prayag17 ef55f13d7b Enable StatusOnly filter for music lib #9 2023-04-06 22:28:52 +05:30
prayag17 3db18e22a4 Show sort options in AudioBooks libView 2023-04-06 22:27:28 +05:30
prayag17 1e93fb1c29 Add more filter options 2023-04-06 18:27:11 +05:30
prayag17 18df836cf4 Start adding filter options in LibraryView #9 2023-04-06 17:26:39 +05:30
prayag17 2bbe846184 Add blurhash to cards 2023-04-05 21:41:37 +05:30
prayag17 50f8e1c0f1 Add Sort functions 2023-04-05 21:01:14 +05:30
Prayag Prajapati fdbe279071 Update README.md (#41) 2023-04-05 17:36:11 +05:30
Prayag Prajapati 90094d9103 Add tha thank you note 2023-04-05 17:34:51 +05:30
prayag17 51647cdd0d Display actors, albums, items, artist etc in libView #9 2023-04-05 17:30:17 +05:30
prayag17 628f90ef57 Add bar to libview #9 2023-04-05 14:24:26 +05:30
prayag17 7cba5a39f6 Update LibraryView #9 2023-04-04 18:23:52 +05:30
prayag17 ee524b57c7 Start displaying lib items 2023-04-04 14:36:07 +05:30
prayag17 9aea2e4750 Fetch data for libraryView #9 2023-04-03 23:12:49 +05:30
prayag17 c49f8d8c76 Add base for LibraryView 2023-04-03 21:02:39 +05:30
prayag17 1158c38575 Fix cardScroller's card scalling 2023-04-03 20:53:11 +05:30
dependabot[bot] f08a3e8337 chore(package-update) NPM: bump @mui/material from 5.11.14 to 5.11.15 (#36)
Bumps [@mui/material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-material) from 5.11.14 to 5.11.15.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.11.15/packages/mui-material)

---
updated-dependencies:
- dependency-name: "@mui/material"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-03 20:45:48 +05:30
dependabot[bot] 64cc9fa7ff chore(package-update) NPM: bump react-router-dom from 6.9.0 to 6.10.0 (#37)
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.9.0 to 6.10.0.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.10.0/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-03 20:45:23 +05:30
dependabot[bot] fd2d8a1efd chore(package-update) NPM: bump sass from 1.59.3 to 1.60.0 (#38)
Bumps [sass](https://github.com/sass/dart-sass) from 1.59.3 to 1.60.0.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.59.3...1.60.0)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-03 20:45:01 +05:30
dependabot[bot] 0febb68047 chore(package-update) NPM: bump react-multi-carousel from 2.8.2 to 2.8.3 (#39)
Bumps [react-multi-carousel](https://github.com/YIZHUANG/react-multi-carousel) from 2.8.2 to 2.8.3.
- [Release notes](https://github.com/YIZHUANG/react-multi-carousel/releases)
- [Changelog](https://github.com/YIZHUANG/react-multi-carousel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/YIZHUANG/react-multi-carousel/commits)

---
updated-dependencies:
- dependency-name: react-multi-carousel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-03 20:44:42 +05:30
dependabot[bot] e51c2261c2 chore(package-update) NPM: bump @types/react from 18.0.28 to 18.0.32 (#40)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.0.28 to 18.0.32.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-03 20:44:11 +05:30
prayag17 537cf61df5 Merge branch 'main' of https://github.com/prayag17/JellyPlayer 2023-04-03 20:42:50 +05:30
prayag17 62f7a6cd48 Fix multimediaicon in iconsCollection 2023-04-03 20:42:31 +05:30
Prayag Prajapati ee48de0f30 Update tauri.conf.json (#35) 2023-04-02 21:43:41 +05:30
prayag17 272f74473a Start working on LibraryView #9 2023-04-02 18:07:10 +05:30
prayag17 b02b3a95d2 Add Avatar, Favourite, search dummy buttons to appbar 2023-04-01 16:34:31 +05:30
prayag17 d6c7c29b46 Start adding NavBar #25 2023-04-01 14:18:47 +05:30
prayag17 f12d92f42c Add sqaure cards #24, fix cards in login page 2023-03-28 11:26:24 +05:30
dependabot[bot] aebea6a3b2 chore(package-update) NPM: bump @mui/lab (#28)
Bumps [@mui/lab](https://github.com/mui/material-ui/tree/HEAD/packages/mui-lab) from 5.0.0-alpha.123 to 5.0.0-alpha.124.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/HEAD/packages/mui-lab)

---
updated-dependencies:
- dependency-name: "@mui/lab"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-27 09:47:51 +05:30
dependabot[bot] 7c19efa448 chore(package-update) NPM: bump vite from 4.1.4 to 4.2.1 (#29)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.1.4 to 4.2.1.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.2.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-27 09:46:51 +05:30
dependabot[bot] cb0fb0eef8 chore(package-update) NPM: bump @tanstack/react-query-devtools (#30)
Bumps [@tanstack/react-query-devtools](https://github.com/tanstack/query) from 4.27.0 to 4.28.0.
- [Release notes](https://github.com/tanstack/query/releases)
- [Commits](https://github.com/tanstack/query/compare/v4.27.0...v4.28.0)

---
updated-dependencies:
- dependency-name: "@tanstack/react-query-devtools"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-27 09:37:23 +05:30
dependabot[bot] e21a12e36f chore(package-update) NPM: bump framer-motion from 10.2.4 to 10.9.1 (#31)
Bumps [framer-motion](https://github.com/framer/motion) from 10.2.4 to 10.9.1.
- [Release notes](https://github.com/framer/motion/releases)
- [Changelog](https://github.com/framer/motion/blob/main/CHANGELOG.md)
- [Commits](https://github.com/framer/motion/compare/v10.2.4...v10.9.1)

---
updated-dependencies:
- dependency-name: framer-motion
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-27 09:37:00 +05:30
dependabot[bot] dbc2243dd4 chore(package-update) NPM: bump @mui/material from 5.11.13 to 5.11.14 (#27)
Bumps [@mui/material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-material) from 5.11.13 to 5.11.14.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.11.14/packages/mui-material)

---
updated-dependencies:
- dependency-name: "@mui/material"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-27 09:36:37 +05:30
prayag17 4372ecbb4e Fix LatestMedia sections showing skeleton evrytime refocusing the app 2023-03-25 23:19:34 +05:30
prayag17 69d0b4558f Show server disclaimer when on login manual route 2023-03-25 21:58:19 +05:30
prayag17 fc685414be Add more icons and fix icons types in cards 2023-03-25 19:42:57 +05:30
prayag17 68a97196d2 Few Bug fixes 2023-03-25 11:43:21 +05:30
prayag17 1c55dd77ef Add Latest Media Sections #7 2023-03-24 18:51:13 +05:30
prayag17 112b2babc1 Add Continue Watching / Listening Section #7 2023-03-24 12:35:48 +05:30
prayag17 3d40912b6f Add UpNext Section and Skeleton for card sections 2023-03-24 09:37:51 +05:30
prayag17 8d00739199 Update Card Colors 2023-03-23 13:58:34 +05:30
prayag17 b66130950b Pass props to Icons, Add more color to card icons 2023-03-23 13:21:55 +05:30
prayag17 5212e2c497 Add sidemenu highlighter animations 2023-03-23 11:09:01 +05:30
prayag17 221cd4722a Show/Highlight current location in navbar #11 2023-03-22 20:27:50 +05:30
prayag17 c851201872 Update hero-carousel 2023-03-22 14:31:14 +05:30
prayag17 12d771c6c7 Merge branch 'main' of https://github.com/prayag17/JellyPlayer 2023-03-20 09:24:15 +05:30
prayag17 275a05a0a3 Update CardLandscape 2023-03-20 09:24:00 +05:30
dependabot[bot] 65205e5c4e chore(package-update) NPM: bump @mui/lab (#21)
Bumps [@mui/lab](https://github.com/mui/material-ui/tree/HEAD/packages/mui-lab) from 5.0.0-alpha.122 to 5.0.0-alpha.123.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/HEAD/packages/mui-lab)

---
updated-dependencies:
- dependency-name: "@mui/lab"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-20 08:37:17 +05:30
dependabot[bot] 1a59605e17 chore(package-update) NPM: bump @tanstack/react-query-devtools (#20)
Bumps [@tanstack/react-query-devtools](https://github.com/tanstack/query) from 4.26.1 to 4.27.0.
- [Release notes](https://github.com/tanstack/query/releases)
- [Commits](https://github.com/tanstack/query/compare/v4.26.1...v4.27.0)

---
updated-dependencies:
- dependency-name: "@tanstack/react-query-devtools"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-20 08:36:43 +05:30
dependabot[bot] 3782c79464 chore(package-update) NPM: bump @mui/material from 5.11.12 to 5.11.13 (#22)
Bumps [@mui/material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-material) from 5.11.12 to 5.11.13.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.11.13/packages/mui-material)

---
updated-dependencies:
- dependency-name: "@mui/material"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-20 08:33:24 +05:30
dependabot[bot] cceb97d0d6 chore(package-update) NPM: bump @mdi/js from 7.1.96 to 7.2.96 (#23)
Bumps [@mdi/js](https://github.com/Templarian/MaterialDesign-JS) from 7.1.96 to 7.2.96.
- [Release notes](https://github.com/Templarian/MaterialDesign-JS/releases)
- [Commits](https://github.com/Templarian/MaterialDesign-JS/compare/v7.1.96...v7.2.96)

---
updated-dependencies:
- dependency-name: "@mdi/js"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-20 08:32:25 +05:30
dependabot[bot] 2df503c48a chore(package-update) NPM: bump sass from 1.59.2 to 1.59.3 (#19)
Bumps [sass](https://github.com/sass/dart-sass) from 1.59.2 to 1.59.3.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.59.2...1.59.3)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-20 08:32:02 +05:30
prayag17 03323d954e Update CardScroller and start using Mui Cards 2023-03-19 22:30:08 +05:30
prayag17 6cb5130b08 Add more details to Hero Carousel, Remove mdi-mui icons, Fix Few bugs 2023-03-18 16:31:47 +05:30
prayag17 b1ab16220c Start Using TanStack Query, add common sidemenu, fix data not being stored 2023-03-17 21:09:31 +05:30
Prayag Prajapati 8ca01ccc2b Update README.md 2023-03-12 11:38:12 +05:30
dependabot[bot] 81afd14b55 Bump @mui/material from 5.11.10 to 5.11.12 (#18)
Bumps [@mui/material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-material) from 5.11.10 to 5.11.12.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.11.12/packages/mui-material)

---
updated-dependencies:
- dependency-name: "@mui/material"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-12 11:35:19 +05:30
Prayag Prajapati 95f5cdd481 Update dependabot.yml 2023-03-11 17:31:35 +05:30
dependabot[bot] e33b8ff266 Bump sass from 1.58.3 to 1.59.2 (#12)
Bumps [sass](https://github.com/sass/dart-sass) from 1.58.3 to 1.59.2.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.58.3...1.59.2)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-11 11:59:58 +05:30
dependabot[bot] 42af75b79d Bump notistack from 2.0.8 to 3.0.1 (#13)
Bumps [notistack](https://github.com/iamhosseindhv/notistack) from 2.0.8 to 3.0.1.
- [Release notes](https://github.com/iamhosseindhv/notistack/releases)
- [Changelog](https://github.com/iamhosseindhv/notistack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/iamhosseindhv/notistack/compare/v2.0.8...v3.0.1)

---
updated-dependencies:
- dependency-name: notistack
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-11 11:59:40 +05:30
dependabot[bot] 4e71297f02 Bump react-router-dom from 6.8.1 to 6.9.0 (#14)
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.8.1 to 6.9.0.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.9.0/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-11 11:56:00 +05:30
dependabot[bot] eca1bcb995 Bump @mui/lab from 5.0.0-alpha.120 to 5.0.0-alpha.122 (#15)
Bumps [@mui/lab](https://github.com/mui/material-ui/tree/HEAD/packages/mui-lab) from 5.0.0-alpha.120 to 5.0.0-alpha.122.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/HEAD/packages/mui-lab)

---
updated-dependencies:
- dependency-name: "@mui/lab"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-11 11:55:31 +05:30
dependabot[bot] 4f7d58fe1d Bump framer-motion from 7.10.3 to 10.2.4 (#16)
Bumps [framer-motion](https://github.com/framer/motion) from 7.10.3 to 10.2.4.
- [Release notes](https://github.com/framer/motion/releases)
- [Changelog](https://github.com/framer/motion/blob/main/CHANGELOG.md)
- [Commits](https://github.com/framer/motion/compare/v7.10.3...v10.2.4)

---
updated-dependencies:
- dependency-name: framer-motion
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-11 11:55:02 +05:30
Prayag Prajapati 23e892f45b Merge pull request #17 from prayag17/dependabot/npm_and_yarn/vite-and-vitejs/plugin-react-4.1.4
Bump vite and @vitejs/plugin-react
2023-03-11 11:54:10 +05:30
Prayag Prajapati 664293d82b Update dependabot.yml 2023-03-11 11:51:59 +05:30
dependabot[bot] 1e9438227c Bump vite and @vitejs/plugin-react
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) and [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react). These dependencies needed to be updated together.

Updates `vite` from 3.2.5 to 4.1.4
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.1.4/packages/vite)

Updates `@vitejs/plugin-react` from 2.2.0 to 3.1.0
- [Release notes](https://github.com/vitejs/vite-plugin-react/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react/commits/plugin-react@3.1.0/packages/plugin-react)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-major
- dependency-name: "@vitejs/plugin-react"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-11 06:20:21 +00:00
Prayag Prajapati 4604b4f103 Create dependabot.yml 2023-03-11 11:49:14 +05:30
Prayag Prajapati e62e9384d8 Update issue templates 2023-03-09 14:54:41 +05:30
Prayag Prajapati 301dc3dcc1 Update README.md 2023-03-08 11:58:29 +05:30
Prayag Prajapati 93b79c5fba Fix page reload breaking stuff and add few other things 2023-02-24 20:49:43 +05:30
Prayag Prajapati 899fcb0479 Auto login user if remember me enabled 2023-02-24 15:43:17 +05:30
Prayag Prajapati 61230c01bb Update cargo.toml 2023-02-23 21:06:18 +05:30
Prayag Prajapati 059f391e52 Allow user password and username to be saved 2023-02-23 10:44:53 +05:30
Prayag Prajapati c73774a3b2 Update splashscreen, fix loading anim not going away 2023-02-22 21:04:02 +05:30
Prayag Prajapati 8170c4a2d8 Use tauri-plugin-store for data storage 2023-02-22 19:50:10 +05:30
Prayag Prajapati 29ab3e96c7 Update splash screen size 2023-02-22 12:06:12 +05:30
Prayag Prajapati 7388876967 Theme Splash screen 2023-02-22 12:04:43 +05:30
Prayag Prajapati e2ae87ef9c Remove unwanted plugin for vite 2023-02-21 22:36:29 +05:30
Prayag Prajapati 355bbcdbe3 Add Splashscreen 2023-02-21 22:33:11 +05:30
Prayag Prajapati 57cc216ae8 fix build.yml 2023-02-14 10:58:03 +05:30
Prayag Prajapati 24c29c8f7e Fix npm &&... 2023-02-14 10:54:56 +05:30
99 changed files with 6600 additions and 2224 deletions

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+19
View File
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
commit-message:
prefix: "chore(package-update) NPM"
- package-ecosystem: "cargo"
directory: "/src-tauri"
schedule:
interval: "weekly"
commit-message:
prefix: "chore(package-update) CARGO"
+1 -1
View File
@@ -41,7 +41,7 @@ jobs:
- name: Install app dependencies and build web
# Remove `&& yarn build` if you build your frontend in `beforeBuildCommand`
run: npm && npm build # Change this to npm, yarn or pnpm.
run: npm install && npm run build # Change this to npm, yarn or pnpm.
- name: Build the app
uses: tauri-apps/tauri-action@v0
+16 -5
View File
@@ -1,17 +1,17 @@
![Banner](https://user-images.githubusercontent.com/55829513/215268063-c7e114c2-0200-42e9-9e38-6dc765fcf6cc.png)
# :memo: Prerequisites:
# 📝 Prerequisites:
- Nodejs (≥19.1.0)
- Rust (≥1.66.1)
# :warning: Getting started:
# ℹ️ Getting started:
- Install Nodejs and Rust.
- install depencies using npm:
```shell
npm install
```
# :information_source: Development:
# 🛠️ Development:
- Running the app:
```shell
npm run tauri dev
@@ -22,5 +22,16 @@
```
- other commands can be found inside the `"scripts"` inside [package.json](https://github.com/prayag17/JellyPlayer/blob/main/package.json)
# :sos: Help Wanted:
- Home sections containing latest media.
# 💻 Contribution:
- Checkout `issues` to see currently worked on features and bugs
- Add features or fix bugs
- Create a pull request
# 📃 Roadmap:
- Checkout [GitHub Project](https://github.com/users/prayag17/projects/3)
> **Note** : There is no current due date for alpha 1 release
# 🎊 Special thanks to:
- [@ferferga](https://github.com/ferferga) for helping in development behind the scenes.
- All contributors of [jellyfin/jellyfin-vue](https://github.com/jellyfin/jellyfin-vue).
- And also [@jellyfin](https://github.com/jellyfin/) for creating the main service
+7 -1
View File
@@ -10,7 +10,13 @@
<body>
<div id="root"></div>
<svg style="width:0;height:0;position:absolute;" aria-hidden="true" focusable="false">
<linearGradient id="clr-gradient-default" x2="1" y2="1">
<stop offset="0%" stop-color="hsl(337, 96%, 56%)" />
<stop offset="100%" stop-color="hsl(273, 100%, 36%)" />
</linearGradient>
</svg>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
</html>
+1329 -1156
View File
File diff suppressed because it is too large. Load diff
+20 -13
View File
@@ -1,7 +1,7 @@
{
"name": "jellyplayer",
"private": true,
"version": "0.0.0",
"version": "1.0.0-alpha0",
"type": "module",
"scripts": {
"dev": "vite",
@@ -14,21 +14,28 @@
"@emotion/styled": "^11.10.5",
"@fontsource/open-sans": "^4.5.13",
"@jellyfin/sdk": "^0.7.0",
"@mdi/js": "^7.1.96",
"@mui/lab": "^5.0.0-alpha.110",
"@mui/material": "^5.10.15",
"@mdi/js": "^7.2.96",
"@mui/lab": "^5.0.0-alpha.124",
"@mui/material": "^5.11.15",
"@reduxjs/toolkit": "^1.9.3",
"@tanstack/react-query": "^4.26.1",
"@tanstack/react-query-devtools": "^4.28.0",
"blurhash": "^2.0.5",
"events": "^3.3.0",
"framer-motion": "^7.10.2",
"framer-motion": "^10.10.0",
"localforage": "^1.10.0",
"match-sorter": "^6.3.1",
"mdi-material-ui": "^7.6.0",
"notistack": "^2.0.8",
"notistack": "^3.0.1",
"react": "^18.2.0",
"react-blurhash": "^0.3.0",
"react-cookie": "^4.1.1",
"react-dom": "^18.2.0",
"react-material-ui-carousel": "^3.4.2",
"react-multi-carousel": "^2.8.2",
"react-router-dom": "^6.4.3",
"react-multi-carousel": "^2.8.3",
"react-parallax": "^3.5.1",
"react-redux": "^8.0.5",
"react-router-dom": "^6.10.0",
"redux": "^4.2.1",
"sort-by": "^1.2.0",
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
"uuid": "^9.0.0",
@@ -36,11 +43,11 @@
},
"devDependencies": {
"@tauri-apps/cli": "^1.2.2",
"@types/react": "^18.0.24",
"@types/react": "^18.0.32",
"@types/react-dom": "^18.0.8",
"@vitejs/plugin-react": "^2.2.0",
"sass": "^1.56.1",
"vite": "^3.2.3"
"@vitejs/plugin-react": "^3.1.0",
"sass": "^1.60.0",
"vite": "^4.2.1"
},
"license": "GPL-3.0-only"
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 289 KiB

After

Width:  |  Height:  |  Size: 289 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

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

After

Width:  |  Height:  |  Size: 4.9 MiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 393 KiB

After

Width:  |  Height:  |  Size: 393 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

+102
View File
@@ -0,0 +1,102 @@
<!-- @format -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<main>
<img src="./assetsStatic/LogoBig.png" alt="" srcset="">
</main>
<div class="loading">
<div class="indicator"></div>
</div>
<div class="background"></div>
<style>
html,
body {
overflow: hidden;
height: 100vh;
width: 100vw;
margin: 0;
padding: 0;
background: black;
}
.background {
position: fixed;
z-index: 0;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: calc(100vw + 5em);
height: calc(100vh + 5em);
background-image: url("./assetsStatic/meshbackground.png");
background-size: cover;
filter: brightness(0.3);
}
main {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 1;
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
img {
width: 100%;
object-fit: contain;
}
.loading {
position: fixed;
bottom: 0;
left: 0;
width: 100vw;
background: hsla(255, 100%, 4%, 0.5);
z-index: 1;
height: 14px;
overflow: hidden;
}
.indicator {
background: hsl(337, 96%, 56%);
width: 100%;
height: 100%;
/* transform: scaleX(0.5); */
transform-origin: left;
animation: loading 1s infinite;
}
@keyframes loading {
0% {
transform: scaleX(0) translateX(-100%);
transform-origin: left;
}
100% {
transform: scaleX(1) translateX(100%);
transform-origin: left;
}
/* 100% {
transform: scaleX(0) translateX(-100%);
transform-origin: left;
} */
}
</style>
</body>
</html>
+8 -8
View File
@@ -1,11 +1,11 @@
[package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
default-run = "app"
name = "jellyplayer"
version = "1.0.0"
description = "A Modern Jellyfin Client"
authors = ["prayag17", "JellyPlayer contributors (https://github.com/prayag17/JellyPlayer/graphs/contributors)"]
license = "GPL-3.0-only"
repository = "https://github.com/prayag17/JellyPlayer/"
default-run = "jellyplayer"
edition = "2021"
rust-version = "1.59"
@@ -17,7 +17,7 @@ tauri-build = { version = "1.2.1", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.2.2", features = [] }
tauri = { version = "1.2.2", features = ["process-exit", "process-relaunch"] }
tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" }
[features]
+14
View File
@@ -3,8 +3,22 @@
windows_subsystem = "windows"
)]
use tauri::Manager;
// Create the command:
// This command must be async so that it doesn't run on the main thread.
#[tauri::command]
async fn close_splashscreen(window: tauri::Window) {
// Close splashscreen
if let Some(splashscreen) = window.get_window("splashscreen") {
splashscreen.close().unwrap();
}
// Show main window
window.get_window("main").unwrap().show().unwrap();
}
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![close_splashscreen])
.plugin(tauri_plugin_store::Builder::default().build())
.run(tauri::generate_context!())
.expect("error while running tauri application");
+20 -3
View File
@@ -8,11 +8,17 @@
},
"package": {
"productName": "JellyPlayer",
"version": "0.1.0"
"version": "1.0.0"
},
"tauri": {
"allowlist": {
"all": false
"all": false,
"process": {
"all": false,
"exit": true,
"relaunch": true,
"relaunchDangerousAllowSymlinkMacos": false
}
},
"bundle": {
"active": true,
@@ -57,9 +63,20 @@
{
"fullscreen": false,
"height": 600,
"width": 800,
"resizable": true,
"title": "JellyPlayer",
"width": 800
"visible": false,
"center": true
},
{
"width": 800,
"height": 300,
"center": true,
"decorations": false,
"resizable": false,
"url": "splash.html",
"label": "splashscreen"
}
]
}
+265 -106
View File
@@ -1,13 +1,11 @@
/** @format */
import { useState, useEffect, useContext } from "react";
import React, { useState } from "react";
import { ThemeProvider } from "@mui/material/styles";
import { SnackbarProvider } from "notistack";
import { useCookies, Cookies } from "react-cookie";
import {
Routes,
Route,
Navigate,
useNavigate,
useLocation,
Outlet,
@@ -16,21 +14,42 @@ import { AnimatePresence, motion } from "framer-motion";
import { EventEmitter as event } from "./eventEmitter.js";
import { relaunch } from "@tauri-apps/api/process";
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
import { useQuery } from "@tanstack/react-query";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
// Theming
import CssBaseline from "@mui/material/CssBaseline";
import { theme } from "./theme";
import "./styles/global.scss";
// MUI
import Dialog from "@mui/material/Dialog";
import DialogActions from "@mui/material/DialogActions";
import DialogContent from "@mui/material/DialogContent";
import DialogContentText from "@mui/material/DialogContentText";
import DialogTitle from "@mui/material/DialogTitle";
import Button from "@mui/material/Button";
import Box from "@mui/material/Box";
import CircularProgress from "@mui/material/CircularProgress";
// Routes
import { ServerSetup, ServerList } from "./routes/setup/server/root";
import { Home } from "./routes/home/root";
import Home from "./routes/home/root";
import {
UserLogin,
LoginWithImage,
UserLoginManual,
} from "./routes/login/root";
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 { AppBar } from "./components/appBar/appBar.jsx";
// Fonts
import "@fontsource/open-sans";
@@ -39,7 +58,11 @@ import "@fontsource/open-sans";
import { Jellyfin } from "@jellyfin/sdk";
import { version as appVer } from "../package.json";
import { v4 as uuidv4 } from "uuid";
import { delServer, getServer } from "./utils/storage/servers.js";
import { getUser } from "./utils/storage/user.js";
import { useDispatch } from "react-redux";
import { showSidemenu } from "./utils/slice/sidemenu.js";
const jellyfin = new Jellyfin({
clientInfo: {
name: "JellyPlayer",
@@ -98,128 +121,264 @@ const AnimationWrapper = () => {
);
};
function App({ hideLoader }) {
const [userCookies] = useCookies(["user"]);
function App() {
const navigate = useNavigate();
const cookies = new Cookies();
const serverAvailable = () => {
try {
const currentServer = cookies.get("currentServer");
const serverList = cookies.get("servers");
let currentServerIp = "";
serverList.map((item, index) => {
currentServerIp = item[currentServer];
});
const dispatch = useDispatch();
if (currentServer == undefined) {
return false;
} else {
if (!window.api) {
event.emit(
"create-jellyfin-api",
currentServerIp.serverAddress,
);
}
return true;
}
} catch (error) {
return false;
}
const [serverReachable, setServerReachable] = useState(true);
const [checkingServer, setChecking] = useState(false);
const createApi = async () => {
const server = await getServer();
event.emit("create-jellyfin-api", server.Ip);
dispatch(showSidemenu());
};
const userSaved = () => {
try {
userCookies.user[0];
return true;
} catch (error) {
return false;
}
};
const serverAvailable = async () => {
const server = await getServer();
const userAvailable = async () => {
const users = await getUserApi(window.api).getPublicUsers();
try {
if (users.data.length >= 1) {
return true;
} else {
return false;
}
} catch (error) {
if (server == null) {
console.log("server not found");
return false;
}
};
const HandleLoginRoutes = () => {
if (userSaved()) {
navigate("/home");
} else {
userAvailable().then((res) => {
if (res) {
navigate("/login/users");
} else if (!res) {
navigate("/login/manual");
}
});
// if (!window.api) {
// console.log("Creating Jf api (without accessToken)");
// event.emit("create-jellyfin-api", server.Ip);
// }
return true;
}
};
const usersAvailable = async () => {
const users = await getUserApi(window.api).getPublicUsers();
if (users.data.length >= 1) {
return true;
} else {
return false;
}
};
const userSaved = async () => {
const user = await getUser();
console.log("User store => ", user);
if (user == null) {
return false;
} else {
return true;
}
};
const pingServer = () => {
setChecking(true);
let data;
fetch(`${window.api.basePath}/System/Ping`, {
body: JSON.stringify(data),
})
.then((res) => res.json())
.then((data) => {
if (data == "Jellyfin Server") {
setServerReachable(true);
setChecking(false);
} else {
enqueueSnackbar(
"The server address does not seem be a jellyfin server",
{ variant: "error" },
);
setServerReachable(false);
setChecking(false);
}
})
.catch((error) => {
setServerReachable(false);
console.error(error);
setChecking(false);
});
};
const userLogin = async () => {
const user = await getUser();
const auth = await api.authenticateUserByName(
user.Name,
user.Password,
);
sessionStorage.setItem("accessToken", auth.data.AccessToken);
event.emit("set-api-accessToken", window.api.basePath);
// navigate("/home");
};
const LogicalRoutes = () => {
serverAvailable().then(async (server) => {
if (server == true) {
pingServer();
if (serverReachable == true) {
userSaved().then((user_available) => {
if (user_available == true) {
navigate("/home");
} else {
usersAvailable().then(
(users_list_available) => {
if (users_list_available == true) {
navigate("/login/users");
} else {
navigate("/login/manual");
}
},
);
}
});
}
} else {
navigate("/setup/server");
setChecking(false);
}
});
};
const LoginLogicalRoutes = () => {
usersAvailable().then((users_list_available) => {
if (users_list_available == true) {
navigate("/login/users");
} else {
navigate("/login/manual");
}
});
};
const handleRelaunch = async () => {
let result = await relaunch();
console.log(result);
};
const handleRemoveServer = async () => {
await delServer();
let result = await relaunch();
console.log(result);
};
const location = useLocation();
if (!window.api) {
console.log("WindowAPi not present");
createApi().then(
userSaved().then((userSavedBool) => {
if (userSavedBool) {
userLogin();
}
}),
);
}
return (
<SnackbarProvider maxSnack={5}>
<ThemeProvider theme={theme}>
{checkingServer && (
<Box
sx={{
display: "flex",
width: "100%",
height: "100%",
justifyContent: "center",
alignItems: "center",
}}
>
<CircularProgress />
</Box>
)}
{/* Show Dialog if server not reachable */}
<Dialog
open={!serverReachable}
onClose={handleRelaunch}
aria-labelledby="alert-dialog-text"
aria-describedby="alert-dialog-desc"
maxWidth="md"
sx={{
padding: "1em",
}}
>
<DialogTitle id="alert-dialog-text">
Unable to reach server
</DialogTitle>
<DialogContent>
<DialogContentText id="alert-dialog-desc">
Unable to connect to the jellyfin server.
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={handleRemoveServer}>
Remove Server
</Button>
<Button onClick={handleRelaunch}>
Restart JellyPlayer
</Button>
</DialogActions>
</Dialog>
<AnimatePresence>
<CssBaseline />
<Routes key={location.pathname} location={location}>
<Route element={<AnimationWrapper />}>
{/* Main Routes */}
<Route path="/home" element={<Home />} />
<Route
path="/setup/server"
element={<ServerSetup />}
/>
<Route
path="/servers/list"
element={<ServerList />}
/>
<Route
exact
path="/login/withImg/:userName/:userId/"
element={<LoginWithImage />}
/>
<Route
exact
path="/login/users"
element={<UserLogin />}
/>
<Route
path="/login/manual"
element={<UserLoginManual />}
/>
<div style={{ display: "flex" }}>
<CssBaseline />
<SideMenu />
<AppBar />
<Routes
key={location.pathname}
location={location}
>
<Route element={<AnimationWrapper />}>
{/* Main Routes */}
<Route
path="/home"
element={<Home />}
/>
<Route
path="/setup/server"
element={<ServerSetup />}
/>
<Route
path="/servers/list"
element={<ServerList />}
/>
<Route
exact
path="/login/withImg/:userName/:userId/"
element={<LoginWithImage />}
/>
<Route
exact
path="/login/users"
element={<UserLogin />}
/>
<Route
path="/login/manual"
element={<UserLoginManual />}
/>
<Route
path="/library/:id"
element={<LibraryView />}
/>
<Route
path="/item/Movie/:id"
element={<ItemMovie />}
/>
<Route
path="/item/Series/:id"
element={<ItemSeries />}
/>
{/* Logical Routes */}
<Route
exact
path="/login"
element={
<HandleLoginRoutes></HandleLoginRoutes>
}
/>
{/* Logical Routes */}
<Route
path="/"
element={
serverAvailable() ? (
<Navigate to="/login" />
) : (
<Navigate to="/setup/server" />
)
}
/>
</Route>
</Routes>
<Route
path="/"
element={<LogicalRoutes />}
/>
<Route
exact
path="/login"
element={<LoginLogicalRoutes />}
/>
</Route>
</Routes>
</div>
</AnimatePresence>
<ReactQueryDevtools />
</ThemeProvider>
</SnackbarProvider>
);
+130
View File
@@ -0,0 +1,130 @@
/** @format */
import { useEffect } from "react";
import MuiAppBar from "@mui/material/AppBar";
import TextField from "@mui/material/TextField";
import IconButton from "@mui/material/IconButton";
import Toolbar from "@mui/material/Toolbar";
import Avatar from "@mui/material/Avatar";
import Box from "@mui/material/Box";
import Zoom from "@mui/material/Zoom";
import { MdiMagnify } from "../icons/mdiMagnify";
import { theme } from "../../theme";
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 { useQueryClient, useQuery } from "@tanstack/react-query";
import "./appBar.module.scss";
import { MdiAccount } from "../icons/mdiAccount";
import { MdiHeartOutline } from "../icons/mdiHeartOutline";
import { MdiArrowLeft } from "../icons/mdiArrowLeft";
export const AppBar = () => {
const dispatch = useDispatch();
const navigate = useNavigate();
const visible = useSelector((state) => state.appBar.visible);
const backButtonVisible = useSelector(
(state) => state.appBar.backButtonVisible,
);
const backdropVisible = useSelector((state) => state.appBar.backdrop);
const location = useLocation();
const user = useQuery({
queryKey: ["user"],
queryFn: async () => {
let usr = await getUserApi(window.api).getCurrentUser();
return usr.data;
},
});
useEffect(() => {
if (location.pathname == "/home") {
dispatch(hideBackButton());
}
});
return (
visible && (
<MuiAppBar
sx={{
width: `calc(100vw - ${theme.spacing(7)} - 10px)`,
// mr: "10px",
background: "transparent",
}}
className={
backdropVisible ? "appBar backdropVisible" : "appBar"
}
elevation={backdropVisible ? 6 : 0}
>
<Toolbar sx={{ justifyContent: "space-between" }}>
<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
variant="outlined"
placeholder="Search..."
size="small"
/>
<IconButton>
<MdiMagnify />
</IconButton>
</Box>
<Box sx={{ display: "flex", gap: 2 }}>
<IconButton>
<MdiHeartOutline />
</IconButton>
<IconButton sx={{ p: 0 }}>
{user.isSuccess &&
(user.data.PrimaryImageTag ==
undefined ? (
<Avatar
className="appBar-avatar"
alt={user.data.Name}
>
<MdiAccount className="appBar-avatar-icon" />
</Avatar>
) : (
<Avatar
className="appBar-avatar"
src={
window.api.basePath +
"/Users/" +
user.data.Id +
"/Images/Primary"
}
alt={user.data.Name}
>
<MdiAccount className="appBar-avatar-icon" />
</Avatar>
))}
</IconButton>
</Box>
</Toolbar>
</MuiAppBar>
)
);
};
+15
View File
@@ -0,0 +1,15 @@
/** @format */
.appBar {
transition: background $transition-time-default,
box-shadow $transition-time-default;
&.backdropVisible {
background: $clr-background-dark;
}
&-avatar {
background: $clr-gradient-dark;
&-icon {
fill: url(#clr-gradient-default) !important;
}
}
}
+17 -57
View File
@@ -4,64 +4,29 @@ import PropTypes from "prop-types";
import Typography from "@mui/material/Typography";
import ButtonBase from "@mui/material/ButtonBase";
import Account from "mdi-material-ui/Account";
import { MdiAccount } from "../icons/mdiAccount";
import "./avatar.module.scss";
export const AvatarCard = ({ userName, userId, userImageAvailable }) => {
return (
<ButtonBase className="card square">
<div className="card-image-container">
{userImageAvailable ? (
<div
className="card-image"
style={{
backgroundImage:
"url('" +
window.api.basePath +
"/Users/" +
userId +
"/Images/Primary')",
// http://localhost/Users/{userId}/Images/{imageType}
}}
></div>
) : (
<div className="card-image empty"></div>
)}
<div className="card-image-icon-container">
<Account className="card-image-icon" />
</div>
</div>
<div className="card-text-container">
<Typography
variant="button"
color="textPrimary"
className="card-text"
>
{userName}
</Typography>
</div>
</ButtonBase>
);
};
export const AvatarImage = ({ userId }) => {
export const AvatarImage = ({ userId, userImageTags }) => {
return (
<div className="avatar-image-container">
<div
className="avatar-image"
style={{
backgroundImage:
"url('" +
window.api.basePath +
"/Users/" +
userId +
"/Images/Primary')",
}}
></div>
{!!userImageTags && (
<div
className="avatar-image"
style={{
backgroundImage:
"url('" +
window.api.basePath +
"/Users/" +
userId +
"/Images/Primary')",
}}
></div>
)}
<div className="avatar-image-icon-container">
<Account className="avatar-image-icon" />
<MdiAccount className="avatar-image-icon" />
</div>
</div>
);
@@ -71,12 +36,7 @@ export const AvatarSideMenu = ({ userName }) => {
return <div></div>;
};
AvatarCard.propType = {
userName: PropTypes.string.isRequired,
userId: PropTypes.string.isRequired,
userImageAvailable: PropTypes.bool.isRequired,
};
AvatarImage.propType = {
userId: PropTypes.string.isRequired,
userImageTags: PropTypes.any,
};
+1 -38
View File
@@ -1,42 +1,5 @@
/** @format */
.userCard {
text-decoration: none !important;
}
.card.square {
width: fit-content;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
gap: 0.5em;
margin-bottom: 0.5em;
.card-image {
position: absolute;
inset: 0;
&-container {
font-size: 5em;
}
&-icon {
font-size: 1.5em !important;
&-container {
position: static;
width: 1.5em !important;
height: 1.5em !important;
aspect-ratio: 1;
border-radius: $border-radius-default;
color: $clr-accent-default;
background: $clr-accent-dark;
}
}
}
.card-text {
margin: 0 !important;
text-decoration: none !important;
}
}
.avatar-image {
aspect-ratio: 1;
height: 100%;
@@ -57,6 +20,6 @@
padding: 0.2em;
background: $clr-accent-dark;
color: $clr-accent-default;
font-size: 6em !important;
font-size: 2em !important;
}
}
+351 -89
View File
@@ -1,110 +1,372 @@
/** @format */
import React from "react";
import React, { useState } from "react";
import PropTypes from "prop-types";
import Box from "@mui/material/Box";
import MuiCard from "@mui/material/Card";
import CardContent from "@mui/material/CardContent";
import CardMedia from "@mui/material/CardMedia";
import CardActionArea from "@mui/material/CardActionArea";
import Typography from "@mui/material/Typography";
import LinearProgress from "@mui/material/LinearProgress";
import Chip from "@mui/material/Chip";
import ButtonGroup from "@mui/material/ButtonGroup";
import IconButton from "@mui/material/IconButton";
import { Blurhash } from "react-blurhash";
import { green, pink } from "@mui/material/colors";
import {
MediaCollectionTypeIconCollectionCard,
MediaTypeIconCollectionCard,
TypeIconCollectionCard,
} from "../utils/iconsCollection";
import { borderRadiusDefault } from "../../palette.module.scss";
import "./card.module.scss";
import { MdiCheck } from "../icons/mdiCheck";
export const CardLandscape = ({ itemName, itemId, imageTags, iconType }) => {
const imageAvailable = () => {
console.log(imageTags);
if (imageTags == undefined) {
console.log("hee");
return false;
} else {
return true;
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
import { MdiHeartOutline } from "../icons/mdiHeartOutline";
import { MdiHeart } from "../icons/mdiHeart";
export const Card = ({
itemName,
itemId,
imageTags,
iconType,
cardType = "",
subText = "",
playedPercent,
cardOrientation,
cardProps,
onClickEvent,
watchedStatus,
watchedCount,
blurhash,
currentUser,
favourite,
}) => {
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);
};
return (
<div className="card landscape">
<div className="card-image-container">
{imageAvailable ? (
<div
className="card-image"
style={{
backgroundImage:
"url('" +
window.api.basePath +
"/Items/" +
itemId +
"/Images/Primary')",
}}
></div>
) : (
<div className="card-image empty"></div>
)}
<div className="card-image-icon-container">
{MediaCollectionTypeIconCollectionCard[iconType]}
</div>
</div>
<div className="card-text-container">
<Typography variant="button" color="white">
{itemName}
</Typography>
</div>
</div>
const availableMarkButtonTypes = [
"Audio",
"AudioBook",
"Book",
"BoxSet",
"CollectionFolder",
"Movie",
"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 (
<MuiCard
className={"card " + cardOrientation}
sx={{
background: "transparent",
borderRadius: borderRadiusDefault,
mr: 1,
}}
elevation={0}
{...cardProps}
>
<CardActionArea
onClick={!!onClickEvent ? onClickEvent : () => {}}
>
<Box
className="card-media-container"
sx={{
position: "relative",
m: 1,
aspectRatio:
cardOrientation == "landscape"
? "1.777"
: cardOrientation == "portait"
? "0.666"
: "1",
}}
>
<>
<Chip
className="card-indicator"
label={<MdiCheck />}
sx={{
transition: "opacity 150ms",
opacity: isWatched ? 1 : 0,
}}
/>
{!!watchedCountState && (
<Chip
className="card-indicator card-indicator-text"
label={watchedCountState}
></Chip>
)}
<div
className="card-media-image-container"
style={{ opacity: imgLoading ? 0 : 1 }}
>
{imageTags &&
(cardType == "thumb" ? (
<CardMedia
component="img"
image={
window.api.basePath +
"/Items/" +
itemId +
"/Images/Backdrop?fillHeight=300&fillWidth=532&quality=96"
}
alt={itemName}
sx={{
width: "100%",
aspectRatio:
cardOrientation ==
"landscape"
? "1.777"
: cardOrientation ==
"portait"
? "0.666"
: "1",
borderRadius:
borderRadiusDefault,
overflow: "hidden",
}}
onLoad={() =>
setImgLoading(false)
}
className="card-image"
></CardMedia>
) : (
<CardMedia
component="img"
image={
window.api.basePath +
"/Items/" +
itemId +
"/Images/Primary"
}
alt={itemName}
sx={{
width: "100%",
aspectRatio:
cardOrientation ==
"landscape"
? "1.777"
: cardOrientation ==
"portait"
? "0.666"
: "1",
}}
className="card-image"
onLoad={() =>
setImgLoading(false)
}
></CardMedia>
))}
</div>
{!!blurhash && (
<Blurhash
hash={blurhash}
width="100%"
height="100%"
resolutionX={64}
resolutionY={64}
style={{
aspectRatio:
cardOrientation == "landscape"
? "1.777"
: cardOrientation ==
"portait"
? "0.666"
: "1",
}}
className="card-image-blurhash"
/>
)}
<div className="card-image-icon-container">
{cardType == "lib"
? MediaCollectionTypeIconCollectionCard[
iconType
]
: TypeIconCollectionCard[iconType]}
</div>
{!!playedPercent && (
<LinearProgress
variant="determinate"
value={playedPercent}
sx={{
width: "90%",
position: "absolute",
left: "5%",
bottom: "5%",
borderRadius: "100px",
height: "5px",
}}
/>
)}
</>
<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>
<CardContent
className="card-text-container"
sx={{
padding: "0 0.5em",
backgroundColor: "transparent",
}}
>
<Typography
gutterBottom={false}
variant="h6"
component="div"
color="white"
fontWeight={500}
textAlign="left"
noWrap
width="fit-content"
maxWidth="100%"
>
{itemName}
</Typography>
<Typography
gutterBottom
variant="subtitle2"
component="div"
color="gray"
textAlign="left"
// textOverflow={}
// fontSize="0.85em"
width="fit-content"
maxWidth="100%"
noWrap
>
{subText}
</Typography>
</CardContent>
</CardActionArea>
</MuiCard>
);
};
export const CardPotrait = ({ itemName, itemId, imageTags, iconType }) => {
const imageAvailable = () => {
console.log(imageTags);
if (imageTags == undefined) {
console.log("hee");
return false;
} else {
return true;
}
};
return (
<div className="card portrait">
<div className="card-image-container">
{imageAvailable ? (
<div
className="card-image"
style={{
backgroundImage:
"url('" +
window.api.basePath +
"/Items/" +
itemId +
"/Images/Primary?quality=95&fillHeight=350&fillWidth=243')",
}}
></div>
) : (
<div className="card-image empty"></div>
)}
<div className="card-image-icon-container">
{MediaTypeIconCollectionCard[iconType]}
</div>
</div>
<div className="card-text-container">
<Typography variant="button" color="white">
{itemName}
</Typography>
</div>
</div>
);
};
CardLandscape.propTypes = {
Card.propTypes = {
itemName: PropTypes.string.isRequired,
itemId: PropTypes.string.isRequired,
imageTags: PropTypes.object,
iconType: PropTypes.string.isRequired,
};
CardPotrait.propTypes = {
itemName: PropTypes.string.isRequired,
itemId: PropTypes.string.isRequired,
imageTags: PropTypes.object,
imageTags: PropTypes.bool,
iconType: PropTypes.string.isRequired,
cardType: PropTypes.string,
subText: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
playedPercent: PropTypes.number,
cardOrientation: PropTypes.string.isRequired,
onClickEvent: PropTypes.func,
watchedStatus: PropTypes.bool,
watchedCount: PropTypes.number,
blurhash: PropTypes.string,
currentUser: PropTypes.object,
favourite: PropTypes.bool,
};
+59 -21
View File
@@ -1,52 +1,90 @@
/** @format */
.card {
margin-right: 1em;
&.landscape {
--image-aspect-ratio: 1.77;
border-radius: $border-radius-default;
&-media {
&-container {
position: relative;
border-radius: $border-radius-default;
overflow: hidden;
}
&-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgb(0 0 0 / 0.6);
opacity: 0;
transition: opacity $transition-time-default;
z-index: 10;
}
&-image-container {
transition: opacity $transition-time-default;
}
}
&.portrait {
--image-aspect-ratio: 0.65;
&:hover .card-media-overlay {
opacity: 1;
}
&-image {
position: relative;
z-index: 1;
border-radius: 10px;
aspect-ratio: var(--image-aspect-ratio);
border-radius: $border-radius-default;
background-size: cover;
background-position: center;
&-container {
position: relative;
border-radius: $border-radius-default;
overflow: hidden;
}
&-icon {
font-size: 4.5em !important;
fill: url(#clr-gradient-default) !important;
&-container {
display: flex;
display: flex !important;
aspect-ratio: 1.777;
justify-content: center;
align-items: center;
width: 100% !important;
color: transparent;
background: $clr-gradient-dark;
border-radius: 10px;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100% !important;
height: 100% !important;
border-radius: $border-radius-default;
color: $clr-accent-default;
background: $clr-accent-dark;
z-index: 0;
height: 100%;
z-index: -2;
}
}
&-blurhash {
position: absolute !important;
width: 100%;
height: 100%;
top: 0;
left: 0;
border-radius: $border-radius-default;
overflow: hidden;
z-index: -1;
}
}
&-text-container {
margin-top: 0.5em;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
&-indicator {
position: absolute;
right: 5px;
top: 5px;
// 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;
}
}
}
+60 -52
View File
@@ -1,83 +1,91 @@
/** @format */
import { useRef, useEffect } from "react";
import { useState, useEffect } from "react";
import PropTypes from "prop-types";
import Carousel from "react-multi-carousel";
import "react-multi-carousel/lib/styles.css";
import ChevronLeft from "mdi-material-ui/ChevronLeft";
import ChevronRight from "mdi-material-ui/ChevronRight";
import { MdiChevronLeft } from "../icons/mdiChevronLeft";
import { MdiChevronRight } from "../icons/mdiChevronRight";
import { styled } from "@mui/material/styles";
import Button from "@mui/material/Button";
import IconButton from "@mui/material/IconButton";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import ButtonGroup from "@mui/material/ButtonGroup";
import "./cardScroller.module.scss";
const CarouselButton = styled(Button)(() => ({
color: "white",
height: "100%",
}));
const SliderButtonRight = ({ onClick }) => {
return (
<CarouselButton
onClick={() => onClick()}
className="card-scroller-button right"
variant="text"
>
<ChevronRight />
</CarouselButton>
);
};
const SliderButtonLeft = ({ onClick }) => {
return (
<CarouselButton
onClick={() => onClick()}
className="card-scroller-button left"
variant="text"
>
<ChevronLeft />
</CarouselButton>
);
};
export const CardScroller = ({ children, displayCards }) => {
export const CardScroller = ({ children, displayCards, title }) => {
const responsive = {
superLargeDesktop: {
// the naming can be any, depends on you.
breakpoint: { max: 4000, min: 3000 },
items: displayCards + 1,
slidesToSlide: displayCards + 1,
},
desktop: {
breakpoint: { max: 3000, min: 1024 },
breakpoint: { max: 3000, min: 1025 },
items: displayCards,
slidesToSlide: displayCards, // optional, default to 1.
},
tablet: {
breakpoint: { max: 1024, min: 464 },
items: displayCards - 1,
slidesToSlide: displayCards - 1, // optional, default to 1.
},
mobile: {
breakpoint: { max: 464, min: 0 },
items: displayCards - 2,
slidesToSlide: displayCards - 2, // optional, default to 1.
},
mobile: {
breakpoint: { max: 464, min: 0 },
items: displayCards - 3,
slidesToSlide: displayCards - 3, // optional, default to 1.
},
};
const [carouselRef, setCarouselRef] = useState();
return (
<Carousel
swipeable={false}
draggable={false}
responsive={responsive}
arrows={true}
customRightArrow={<SliderButtonRight />}
customLeftArrow={<SliderButtonLeft />}
className="card-scroller"
>
{children}
</Carousel>
<Box className="card-scroller-container" sx={{ mb: 4 }}>
<Box sx={{ mb: 2 }} className="card-scroller-header-container">
<Typography
variant="h4"
color="textPrimary"
className="card-scroller-heading"
>
<div className="card-scroller-heading-decoration"></div>{" "}
{title}
</Typography>
<ButtonGroup className="card-scroller-button-group">
<IconButton
className="card-scroller-button"
onClick={() => carouselRef.previous()}
>
<MdiChevronLeft />
</IconButton>
<IconButton
className="card-scroller-button"
onClick={() => carouselRef.next()}
>
<MdiChevronRight />
</IconButton>
</ButtonGroup>
</Box>
<Carousel
swipeable={false}
draggable={false}
responsive={responsive}
arrows={false}
ref={(el) => setCarouselRef(el)}
// customButtonGroup={<HomeSectionHeader />}
// renderButtonGroupOutside={true}
className="card-scroller"
>
{children}
</Carousel>
</Box>
);
};
CardScroller.propTypes = {
displayCards: PropTypes.number.isRequired,
title: PropTypes.string.isRequired,
};
@@ -7,23 +7,25 @@
display: flex;
}
&-button {
color: white;
position: absolute !important;
top: 49%;
transform: translateY(-50%);
background-color: $clr-background-dark !important;
border-radius: $border-radius-intensity-1 !important;
opacity: 0;
transition: opacity $transition-time-default !important;
&:hover,
&:focus {
opacity: 1;
}
&.right {
right: 0%;
}
&.left {
left: 0%;
aspect-ratio: 1;
}
&-header-container {
display: flex;
width: 100%;
justify-content: space-between;
align-items: center;
}
&-heading {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 0.35em;
position: relative;
margin-bottom: 0.25em !important;
&-decoration {
width: 0.75em;
height: 3px;
background: white;
}
}
}
@@ -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>
);
};
@@ -0,0 +1,95 @@
/** @format */
import { useQuery } from "@tanstack/react-query";
import { CardScroller } from "../../components/cardScroller/cardScroller";
import { Card } from "../../components/card/card";
import { CardsSkeleton } from "../skeleton/cards";
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
export const LatestMediaSection = ({ latestMediaLib }) => {
const user = useQuery({
queryKey: ["home", "user"],
queryFn: async () => {
let usr = await getUserApi(window.api).getCurrentUser();
return usr.data;
},
});
const fetchLatestMedia = async (library) => {
const media = await getUserLibraryApi(window.api).getLatestMedia({
userId: user.data.Id,
parentId: library,
limit: 16,
fields: ["PrimaryImageAspectRatio"],
});
return media.data;
};
const data = useQuery({
queryKey: ["homeSection, latestMedia", latestMediaLib],
queryFn: () => fetchLatestMedia(latestMediaLib[0]),
enabled: !!user.data,
});
if (data.isLoading) {
return <CardsSkeleton />;
}
if (data.isSuccess && data.data.length >= 1) {
return (
<CardScroller
displayCards={8}
title={"Latest " + latestMediaLib[1]}
>
{data.data.map((item, index) => {
return (
<Card
key={index}
itemName={
!!item.SeriesId
? item.SeriesName
: item.Name
}
itemId={
!!item.SeriesId
? item.SeriesId
: item.Id
}
// imageTags={false}
imageTags={!!item.ImageTags.Primary}
iconType={item.Type}
subText={item.ProductionYear}
playedPercent={
item.UserData.PlayedPercentage
}
cardOrientation={
item.PrimaryImageAspectRatio == 1
? "sqaure"
: "portait"
}
watchedStatus={item.UserData.Played}
watchedCount={
item.UserData.UnplayedItemCount
}
blurhash={
item.ImageBlurHashes == {}
? ""
: !!item.ImageTags.Primary
? !!item.ImageBlurHashes.Primary
? item.ImageBlurHashes
.Primary[
item.ImageTags
.Primary
]
: ""
: ""
}
currentUser={user.data}
favourite={item.UserData.IsFavorite}
></Card>
);
})}
</CardScroller>
);
}
return <></>;
};
+15
View File
@@ -0,0 +1,15 @@
/** @format */
import { MdiChevronLeft } from "./mdiChevronLeft";
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiAccount } from "@mdi/js";
export const MdiAccount = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiAccount}></path>
</SvgIcon>
);
};
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiAccountMusic } from "@mdi/js";
export const MdiAccountMusic = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiAccountMusic}></path>
</SvgIcon>
);
};
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiAccountTie } from "@mdi/js";
export const MdiAccountTie = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiAccountTie}></path>
</SvgIcon>
);
};
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiAlbum } from "@mdi/js";
export const MdiAlbum = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiAlbum}></path>
</SvgIcon>
);
};
+2 -2
View File
@@ -4,9 +4,9 @@ import SvgIcon from "@mui/material/SvgIcon";
import { mdiArrowLeft } from "@mdi/js";
export const MdiArrowLeft = () => {
export const MdiArrowLeft = (props) => {
return (
<SvgIcon>
<SvgIcon {...props}>
<path d={mdiArrowLeft}></path>
</SvgIcon>
);
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiBook } from "@mdi/js";
export const MdiBook = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiBook}></path>
</SvgIcon>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiBookMultiple } from "@mdi/js";
export const MdiBookMultiple = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiBookMultiple}></path>
</SvgIcon>
);
};
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiBookMusic } from "@mdi/js";
export const MdiBookMusic = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiBookMusic}></path>
</SvgIcon>
);
};
+13
View File
@@ -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>
);
};
+13
View File
@@ -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>
);
};
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiChevronLeft } from "@mdi/js";
export const MdiChevronLeft = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiChevronLeft}></path>
</SvgIcon>
);
};
+2 -2
View File
@@ -4,9 +4,9 @@ import SvgIcon from "@mui/material/SvgIcon";
import { mdiChevronRight } from "@mdi/js";
export const MdiChevronRight = () => {
export const MdiChevronRight = (props) => {
return (
<SvgIcon>
<SvgIcon {...props}>
<path d={mdiChevronRight}></path>
</SvgIcon>
);
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiDramaMasks } from "@mdi/js";
export const MdiDramaMasks = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiDramaMasks}></path>
</SvgIcon>
);
};
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiEmoticonCryOutline } from "@mdi/js";
export const MdiEmoticonCryOutline = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiEmoticonCryOutline}></path>
</SvgIcon>
);
};
+2 -2
View File
@@ -4,9 +4,9 @@ import SvgIcon from "@mui/material/SvgIcon";
import { mdiEyeOffOutline } from "@mdi/js";
export const MdiEyeOffOutline = () => {
export const MdiEyeOffOutline = (props) => {
return (
<SvgIcon>
<SvgIcon {...props}>
<path d={mdiEyeOffOutline}></path>
</SvgIcon>
);
+2 -2
View File
@@ -4,9 +4,9 @@ import SvgIcon from "@mui/material/SvgIcon";
import { mdiEyeOutline } from "@mdi/js";
export const MdiEyeOutline = () => {
export const MdiEyeOutline = (props) => {
return (
<SvgIcon>
<SvgIcon {...props}>
<path d={mdiEyeOutline}></path>
</SvgIcon>
);
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiFilmstrip } from "@mdi/js";
export const MdiFilmstrip = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiFilmstrip}></path>
</SvgIcon>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiFilterOutline } from "@mdi/js";
export const MdiFilterOutline = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiFilterOutline}></path>
</SvgIcon>
);
};
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiFolderMultiple } from "@mdi/js";
export const MdiFolderMultiple = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiFolderMultiple}></path>
</SvgIcon>
);
};
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiFolderMusicOutline } from "@mdi/js";
export const MdiFolderMusicOutline = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiFolderMusicOutline}></path>
</SvgIcon>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiFolderOutline } from "@mdi/js";
export const MdiFolderOutline = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiFolderOutline}></path>
</SvgIcon>
);
};
+13
View File
@@ -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>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiHeartOutline } from "@mdi/js";
export const MdiHeartOutline = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiHeartOutline}></path>
</SvgIcon>
);
};
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiHomeVariantOutline } from "@mdi/js";
export const MdiHomeVariantOutline = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiHomeVariantOutline}></path>
</SvgIcon>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiImage } from "@mdi/js";
export const MdiImage = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiImage}></path>
</SvgIcon>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiImageMultiple } from "@mdi/js";
export const MdiImageMultiple = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiImageMultiple}></path>
</SvgIcon>
);
};
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiLogoutVariant } from "@mdi/js";
export const MdiLogoutVariant = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiLogoutVariant}></path>
</SvgIcon>
);
};
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiMagnify } from "@mdi/js";
export const MdiMagnify = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiMagnify}></path>
</SvgIcon>
);
};
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiMenu } from "@mdi/js";
export const MdiMenu = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiMenu}></path>
</SvgIcon>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiMicrophone } from "@mdi/js";
export const MdiMicrophone = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiMicrophone}></path>
</SvgIcon>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiMovieOutline } from "@mdi/js";
export const MdiMovieOutline = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiMovieOutline}></path>
</SvgIcon>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiMultimedia } from "@mdi/js";
export const MdiMultimedia = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiMultimedia}></path>
</SvgIcon>
);
};
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiMusic } from "@mdi/js";
export const MdiMusic = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiMusic}></path>
</SvgIcon>
);
};
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiMusicBoxMultipleOutline } from "@mdi/js";
export const MdiMusicBoxMultipleOutline = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiMusicBoxMultipleOutline}></path>
</SvgIcon>
);
};
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiPlay } from "@mdi/js";
export const MdiPlay = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiPlay}></path>
</SvgIcon>
);
};
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiPlayBoxMultiple } from "@mdi/js";
export const MdiPlayBoxMultiple = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiPlayBoxMultiple}></path>
</SvgIcon>
);
};
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiPlayOutline } from "@mdi/js";
export const MdiPlayOutline = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiPlayOutline}></path>
</SvgIcon>
);
};
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiPlaylistMusicOutline } from "@mdi/js";
export const MdiPlaylistMusicOutline = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiPlaylistMusicOutline}></path>
</SvgIcon>
);
};
+12
View File
@@ -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>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiStarHalfFull } from "@mdi/js";
export const MdiStarHalfFull = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiStarHalfFull}></path>
</SvgIcon>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiTelevision } from "@mdi/js";
export const MdiTelevision = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiTelevision}></path>
</SvgIcon>
);
};
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiTelevisionClassic } from "@mdi/js";
export const MdiTelevisionClassic = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiTelevisionClassic}></path>
</SvgIcon>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiYoutube } from "@mdi/js";
export const MdiYoutube = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiYoutube}></path>
</SvgIcon>
);
};
+316
View File
@@ -0,0 +1,316 @@
/** @format */
import { useEffect, useState } from "react";
import { delUser } from "../../utils/storage/user";
import { useQueryClient, useQuery, QueryClient } from "@tanstack/react-query";
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
import { useNavigate, NavLink, useLocation } from "react-router-dom";
import { theme } from "../../theme";
import { styled } from "@mui/material/styles";
import Skeleton from "@mui/material/Skeleton";
import Tooltip from "@mui/material/Tooltip";
import List from "@mui/material/List";
import ListItem from "@mui/material/ListItem";
import ListItemText from "@mui/material/ListItemText";
import ListItemIcon from "@mui/material/ListItemIcon";
import ListItemButton from "@mui/material/ListItemButton";
import IconButton from "@mui/material/IconButton";
import Divider from "@mui/material/Divider";
import MuiDrawer from "@mui/material/Drawer";
import { MdiMenu } from "../icons/mdiMenu";
import { MdiLogoutVariant } from "../icons/mdiLogoutVariant";
import { MediaCollectionTypeIconCollection } from "../../components/utils/iconsCollection.jsx";
import { useSelector, useDispatch } from "react-redux";
import { hideSidemenu, setBackdrop } from "../../utils/slice/sidemenu";
import { MdiHomeVariantOutline } from "../icons/mdiHomeVariantOutline";
import "./sidemenu.module.scss";
const drawerWidth = 320;
const DrawerHeader = styled("div")(({ theme }) => ({
display: "flex",
alignItems: "center",
justifyContent: "flex-end",
padding: theme.spacing(0, 1),
// necessary for content to be below app bar
...theme.mixins.toolbar,
}));
const MiniDrawer = styled(MuiDrawer, {
shouldForwardProp: (prop) => prop !== "open",
})(({ theme }) => ({
flexShrink: 0,
whiteSpace: "nowrap",
boxSizing: "border-box",
backgroundColor: theme.palette.primary.background.dark,
overflowX: "hidden",
// width: `calc(${theme.spacing(7)} + 10px)`,
}));
export const SideMenu = ({}) => {
const location = useLocation();
const [display, setDisplay] = useState(false);
const visible = useSelector((state) => state.sidebar.visible);
const backdrop = useSelector((state) => state.sidebar.backdrop);
const navigate = useNavigate();
const user = useQuery({
queryKey: ["user"],
queryFn: async () => {
let usr = await getUserApi(window.api).getCurrentUser();
return usr.data;
},
enabled: false,
});
let libraries = useQuery({
queryKey: ["libraries"],
queryFn: async () => {
let libs = await getUserViewsApi(window.api).getUserViews({
userId: user.data.Id,
});
return libs.data;
},
enabled: !!user.data,
});
const handleDrawerOpen = () => {};
const dispatch = useDispatch();
const handleLogout = async () => {
console.log("Logging out user...");
await window.api.logout();
delUser();
dispatch(hideSidemenu());
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 (
<MiniDrawer
variant="permanent"
open={false}
PaperProps={{
sx: {
backgroundColor: "inherit",
border: "none",
width: visible
? `calc(${theme.spacing(7)} + 10px)`
: 0,
height: "100vh",
// display: visible ? "block" : "none",
},
}}
sx={{
width: visible
? `calc(${theme.spacing(7)} + 10px)`
: 0,
background: backdrop
? theme.palette.background.paper
: "transparent",
borderLeft: "1px solid white",
}}
>
<DrawerHeader
className="Mui-DrawerHeader"
sx={{
justifyContent: "center",
}}
>
{/* <div>
<Avatar src={""}/>
<Typography variant="h3">
{user["Name"]}
</Typography>
</div> */}
<IconButton
color="inherit"
aria-label="open drawer"
onClick={handleDrawerOpen}
>
<MdiMenu />
</IconButton>
</DrawerHeader>
<Divider />
{libraries.isLoading ? (
<>
<Skeleton
height="100%"
variant="rounded"
width="calc(100% - 10px )"
sx={{ margin: "5px" }}
></Skeleton>
</>
) : (
<>
<List sx={{ border: "none" }}>
{libraries.data.Items.map(
(library, index) => {
return (
<Tooltip
title={library.Name}
placement="right"
arrow
followCursor
key={index}
>
<ListItem
className="sidemenu-item-container"
disablePadding
>
<NavLink
to={
"/library/" +
library.Id
}
className={({
isActive,
isPending,
}) =>
isPending
? "sidemenu-item-pending sidemenu-item"
: isActive
? "sidemenu-item-active sidemenu-item"
: "sidemenu-item"
}
>
<ListItemButton
sx={{
minHeight: 48,
justifyContent:
"center",
px: 2.5,
}}
color="white"
>
<ListItemIcon
sx={{
minWidth: 0,
justifyContent:
"center",
}}
>
{
MediaCollectionTypeIconCollection[
library
.CollectionType
]
}
</ListItemIcon>
</ListItemButton>
</NavLink>
</ListItem>
</Tooltip>
);
},
)}
</List>
<List sx={{ marginTop: "auto" }}>
<Tooltip
title="Home"
placement="right"
followCursor
arrow
>
<ListItem
className="sidemenu-item-container"
disablePadding
>
<NavLink
to="/home"
className={({
isActive,
isPending,
}) =>
isPending
? "sidemenu-item-pending sidemenu-item"
: isActive
? "sidemenu-item-active sidemenu-item"
: "sidemenu-item"
}
>
<ListItemButton
sx={{
minHeight: 48,
justifyContent:
"center",
px: 2.5,
}}
>
<ListItemIcon
sx={{
minWidth: 0,
justifyContent:
"center",
}}
>
<MdiHomeVariantOutline></MdiHomeVariantOutline>
</ListItemIcon>
</ListItemButton>
</NavLink>
</ListItem>
</Tooltip>
<Tooltip
title="Logout"
placement="right"
followCursor
arrow
>
<ListItem disablePadding>
<ListItemButton
sx={{
minHeight: 48,
justifyContent: "center",
px: 2.5,
}}
onClick={handleLogout}
>
<ListItemIcon
sx={{
minWidth: 0,
justifyContent:
"center",
}}
>
<MdiLogoutVariant></MdiLogoutVariant>
</ListItemIcon>
</ListItemButton>
</ListItem>
</Tooltip>
</List>
</>
)}
</MiniDrawer>
);
}
};
// SideMenu.propTypes = {
// skeleton: PropTypes.bool.isRequired,
// data: PropTypes.array.isRequired,
// };
+29
View File
@@ -0,0 +1,29 @@
/** @format */
.sidemenu {
&-item {
position: relative;
&::before {
content: "";
position: absolute;
top: 15%;
bottom: 15%;
left: 7%;
width: 5px;
border-radius: 10px;
background: linear-gradient(
135deg,
$clr-accent-default,
$clr-secondary-default
);
opacity: 0;
transform: translateX(-10px);
transition: transform $transition-time-default,
opacity $transition-time-default;
}
&-active::before {
opacity: 1;
transform: translateX(0);
}
}
}
+22
View File
@@ -0,0 +1,22 @@
/** @format */
import Skeleton from "@mui/material/Skeleton";
import Card from "@mui/material/Card";
import CardContent from "@mui/material/CardContent";
import CardMedia from "@mui/material/CardMedia";
import CardActionArea from "@mui/material/CardActionArea";
import Typography from "@mui/material/Typography";
import Box from "@mui/material/Box";
export const CardsSkeleton = () => {
return (
<Box sx={{ display: "flex", flexFlow: "column", mb: 4 }}>
<Typography variant="h4" sx={{ mb: "0.15em" }}>
<Skeleton width="35%" animation="wave" />
</Typography>
<Skeleton width="100%" variant="rounded" animation="wave">
<div style={{ paddingTop: "20%" }}></div>
</Skeleton>
</Box>
);
};
+42
View File
@@ -0,0 +1,42 @@
/** @format */
import Skeleton from "@mui/material/Skeleton";
import Paper from "@mui/material/Paper";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import { theme } from "../../theme";
export const CarouselSkeleton = () => {
return (
<Paper
className="hero-carousel-slide"
sx={{
background: theme.palette.primary.background.dark,
}}
>
<div className="hero-carousel-background">
<Skeleton
variant="rectangular"
height="100%"
animation="wave"
></Skeleton>
</div>
<Box className="hero-carousel-detail">
<Typography variant="h3" className="hero-carousel-text">
<Skeleton
variant="text"
sx={{ fontSize: "5rem" }}
width={300}
animation="wave"
></Skeleton>
</Typography>
<Typography variant="p" className="hero-carousel-text">
<Skeleton
variant="text"
sx={{ fontSize: "3rem" }}
width={400}
animation="wave"
></Skeleton>
</Typography>
</Box>
</Paper>
);
};
+91 -48
View File
@@ -1,61 +1,104 @@
/** @format */
import MovieOutline from "mdi-material-ui/MovieOutline";
import MusicBoxMultipleOutline from "mdi-material-ui/MusicBoxMultipleOutline";
import PlaylistMusicOutline from "mdi-material-ui/PlaylistMusicOutline";
import Television from "mdi-material-ui/Television";
import FolderOutline from "mdi-material-ui/FolderOutline";
import FolderMusicOutline from "mdi-material-ui/FolderMusicOutline";
import Youtube from "mdi-material-ui/Youtube";
import MultiMedia from "mdi-material-ui/Multimedia";
import BookMultiple from "mdi-material-ui/BookMultiple";
import ImageMultiple from "mdi-material-ui/ImageMultiple";
import TelevisionClassic from "mdi-material-ui/TelevisionClassic";
import Filmstrip from "mdi-material-ui/Filmstrip";
import Microphone from "mdi-material-ui/Microphone";
import Image from "mdi-material-ui/Image";
import Book from "mdi-material-ui/Book";
import { MdiMovieOutline } from "../icons/mdiMovieOutline";
import { MdiMusicBoxMultipleOutline } from "../icons/mdiMusicBoxMultipleOutline";
import { MdiPlaylistMusicOutline } from "../icons/mdiPlaylistMusicOutline";
import { MdiTelevision } from "../icons/mdiTelevision";
import { MdiFolderOutline } from "../icons/mdiFolderOutline";
import { MdiFolderMusicOutline } from "../icons/mdiFolderMusicOutline";
import { MdiYoutube } from "../icons/mdiYoutube";
import { MdiMultimedia } from "../icons/mdiMultimedia";
import { MdiBookMultiple } from "../icons/mdiBookMultiple";
import { MdiImageMultiple } from "../icons/mdiImageMultiple";
import { MdiTelevisionClassic } from "../icons/mdiTelevisionClassic";
import { MdiFilmstrip } from "../icons/mdiFilmstrip";
import { MdiMicrophone } from "../icons/mdiMicrophone";
import { MdiImage } from "../icons/mdiImage";
import { MdiBook } from "../icons/mdiBook";
import { MdiFolderMultiple } from "../icons/mdiFolderMultiple";
import { MdiBookMusic } from "../icons/mdiBookMusic";
import { MdiPlayBoxMultiple } from "../icons/mdiPlayBoxMultiple";
import { MdiAlbum } from "../icons/mdiAlbum";
import { MdiAccountMusic } from "../icons/mdiAccountMusic";
import { MdiDramaMasks } from "../icons/mdiDramaMasks";
import { MdiMusic } from "../icons/mdiMusic";
import { MdiAccountTie } from "../icons/mdiAccountTie";
export const MediaCollectionTypeIconCollection = {
universal: <MultiMedia />,
movies: <MovieOutline />,
music: <MusicBoxMultipleOutline />,
playlists: <PlaylistMusicOutline />,
tvshows: <Television />,
boxsets: <MovieOutline />,
musicvideos: <FolderMusicOutline />,
trailers: <Youtube />,
books: <BookMultiple />,
photos: <ImageMultiple />,
livetv: <TelevisionClassic />,
folder: <FolderOutline />,
universal: <MdiMultimedia />,
movies: <MdiMovieOutline />,
music: <MdiMusicBoxMultipleOutline />,
playlists: <MdiPlaylistMusicOutline />,
tvshows: <MdiTelevision />,
boxsets: <MdiMovieOutline />,
musicvideos: <MdiFolderMusicOutline />,
trailers: <MdiYoutube />,
books: <MdiBookMultiple />,
photos: <MdiImageMultiple />,
livetv: <MdiTelevisionClassic />,
folder: <MdiFolderOutline />,
logout: <MdiFolderOutline />,
};
export const MediaCollectionTypeIconCollectionCard = {
universal: <MultiMedia className="card-image-icon" />,
movies: <MovieOutline className="card-image-icon" />,
music: <MusicBoxMultipleOutline className="card-image-icon" />,
playlists: <PlaylistMusicOutline className="card-image-icon" />,
tvshows: <Television className="card-image-icon" />,
boxsets: <MovieOutline className="card-image-icon" />,
musicvideos: <FolderMusicOutline className="card-image-icon" />,
trailers: <Youtube className="card-image-icon" />,
books: <BookMultiple className="card-image-icon" />,
photos: <ImageMultiple className="card-image-icon" />,
livetv: <TelevisionClassic className="card-image-icon" />,
folder: <FolderOutline className="card-image-icon" />,
universal: <MdiMultimedia className="card-image-icon" />,
movies: <MdiMovieOutline className="card-image-icon" />,
music: <MdiMusicBoxMultipleOutline className="card-image-icon" />,
playlists: <MdiPlaylistMusicOutline className="card-image-icon" />,
tvshows: <MdiTelevision className="card-image-icon" />,
boxsets: <MdiMovieOutline className="card-image-icon" />,
musicvideos: <MdiFolderMusicOutline className="card-image-icon" />,
trailers: <MdiYoutube className="card-image-icon" />,
books: <MdiBookMultiple className="card-image-icon" />,
photos: <MdiImageMultiple className="card-image-icon" />,
livetv: <MdiTelevisionClassic className="card-image-icon" />,
folder: <MdiFolderOutline className="card-image-icon" />,
};
export const MediaTypeIconCollection = {
Video: <Filmstrip className="hero-carousel-background-icon" />,
Audio: <Microphone className="hero-carousel-background-icon" />,
Photo: <Image className="hero-carousel-background-icon" />,
Book: <Book className="hero-carousel-background-icon" />,
Movie: <MdiFilmstrip className="hero-carousel-background-icon" />,
Audio: <MdiMicrophone className="hero-carousel-background-icon" />,
Photo: <MdiImage className="hero-carousel-background-icon" />,
Book: <MdiBook className="hero-carousel-background-icon" />,
};
export const MediaTypeIconCollectionCard = {
Video: <Filmstrip className="card-image-icon" />,
Audio: <Microphone className="card-image-icon" />,
Photo: <Image className="card-image-icon" />,
Book: <Book className="card-image-icon" />,
export const TypeIconCollectionCard = {
AggregateFolder: <MdiFolderMultiple className="card-image-icon" />,
Audio: <MdiMicrophone className="card-image-icon" />,
AudioBook: <MdiBookMusic className="card-image-icon" />,
BasePluginFolder: <MdiFolderOutline className="card-image-icon" />,
Book: <MdiBook className="card-image-icon" />,
BoxSet: <MdiPlayBoxMultiple className="card-image-icon" />,
Channel: <MdiTelevisionClassic className="card-image-icon" />,
ChannelFolderItem: <MdiTelevisionClassic className="card-image-icon" />,
CollectionFolder: <MdiFolderOutline className="card-image-icon" />,
Episode: <MdiTelevision className="card-image-icon" />,
Folder: <MdiFolderOutline className="card-image-icon" />,
LiveTvChannel: <MdiTelevisionClassic className="card-image-icon" />,
LiveTvProgram: <MdiTelevisionClassic className="card-image-icon" />,
ManualPlaylistsFolder: (
<MdiPlaylistMusicOutline className="card-image-icon" />
),
Movie: <MdiFilmstrip className="card-image-icon" />,
MusicAlbum: <MdiAlbum className="card-image-icon" />,
MusicArtist: <MdiAccountMusic className="card-image-icon" />,
MusicGenre: <MdiDramaMasks className="card-image-icon" />,
MusicVideo: <MdiMusic className="card-image-icon" />,
Person: <MdiAccountTie className="card-image-icon" />,
Photo: <MdiImage className="card-image-icon" />,
PhotoAlbum: <MdiImageMultiple className="card-image-icon" />,
Playlist: <MdiPlaylistMusicOutline className="card-image-icon" />,
PlaylistsFolder: <MdiPlaylistMusicOutline className="card-image-icon" />,
Program: <MdiTelevisionClassic className="card-image-icon" />,
Recording: <MdiTelevisionClassic className="card-image-icon" />,
Season: <MdiTelevisionClassic className="card-image-icon" />,
Series: <MdiTelevisionClassic className="card-image-icon" />,
Studio: <MdiMultimedia className="card-image-icon" />,
Trailer: <MdiYoutube className="card-image-icon" />,
TvChannel: <MdiTelevisionClassic className="card-image-icon" />,
TvProgram: <MdiTelevisionClassic className="card-image-icon" />,
UserRootFolder: <MdiFolderOutline className="card-image-icon" />,
UserView: <MdiMultimedia className="card-image-icon" />,
Video: <MdiFilmstrip className="card-image-icon" />,
Year: <MdiMultimedia className="card-image-icon" />,
};
+22 -6
View File
@@ -4,16 +4,32 @@ import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter as Router } from "react-router-dom";
import { CookiesProvider } from "react-cookie";
import { invoke } from "@tauri-apps/api/tauri";
import App from "./App";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import store from "./store";
import { Provider } from "react-redux";
const queryClient = new QueryClient();
ReactDOM.createRoot(document.getElementById("root")).render(
<React.StrictMode>
<CookiesProvider>
<Router>
<App />
</Router>
</CookiesProvider>
<QueryClientProvider client={queryClient}>
<Provider store={store}>
<Router>
<App />
</Router>
</Provider>
</QueryClientProvider>
</React.StrictMode>,
);
document.addEventListener("DOMContentLoaded", () => {
// This will wait for the window to load, but you could
// run this function on whatever trigger you want
invoke("close_splashscreen");
});
+2
View File
@@ -10,4 +10,6 @@
clrBackgroundDark: $clr-background-dark;
clrBackgroundLight: $clr-background-light;
borderRadiusDefault: $border-radius-default;
}
+39 -22
View File
@@ -12,6 +12,12 @@
margin: 0 auto;
}
&-background {
&-blurhash {
width: 100%;
height: 100%;
position: absolute;
z-index: 1;
}
&-container {
position: absolute;
z-index: 0;
@@ -21,13 +27,12 @@
bottom: 0;
mask-image: linear-gradient(
to right,
transparent 20%,
black 50%
rgba(0, 0, 0, 0.1),
black 90%
);
-webkit-mask-image: linear-gradient(
to right,
transparent 20%,
rgb(0 0 0 / 0.5) 50%,
rgba(0, 0, 0, 0.1),
black 90%
);
}
@@ -39,18 +44,31 @@
left: 0;
right: 0;
bottom: 0;
background-position: center;
opacity: 1;
mask-image: linear-gradient(
to right,
transparent 10%,
rgba(0, 0, 0, 0.5) 50%,
black 90%
);
-webkit-mask-image: linear-gradient(
to right,
transparent 10%,
rgba(0, 0, 0, 0.5) 50%,
black 90%
);
}
&-icon {
position: absolute;
font-size: 10em !important;
font-size: 15em !important;
left: 70%;
top: 50%;
transform: translate(-50%, -50%);
color: $clr-accent-default;
fill: url(#clr-gradient-default) !important;
&-container {
position: absolute;
background: $clr-accent-dark;
background: $clr-gradient-dark;
z-index: 0;
top: 0;
left: 0;
@@ -63,6 +81,13 @@
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 2;
margin-bottom: 0.5em;
&-logo {
max-width: 6em;
height: 2em;
object-fit: contain;
object-position: bottom;
}
}
&-detail {
position: relative;
@@ -82,18 +107,10 @@
}
}
.home-section {
&-heading {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 0.35em;
position: relative;
margin-bottom: 0.25em !important;
&-decoration {
width: 0.75em;
height: 3px;
background: white;
}
}
.backdropContainer {
background: linear-gradient(
45deg,
$clr-background-default,
$clr-background-light
);
}
+709 -423
View File
File diff suppressed because it is too large. Load diff
+63
View File
@@ -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;
}
}
}
+362
View File
@@ -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;
+63
View File
@@ -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;
}
}
}
+362
View File
@@ -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;
+829
View File
@@ -0,0 +1,829 @@
/** @format */
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 navigate = useNavigate();
const dispatch = useDispatch();
const appBarVisiblity = useSelector((state) => state.appBar.visible);
if (!appBarVisiblity) {
dispatch(showAppBar());
}
const { id } = useParams();
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;
+2
View File
@@ -7,9 +7,11 @@
width: min(60vw, 45em);
}
&Card {
border-radius: $border-radius-default;
display: flex;
flex-flow: column;
flex: 1 1 0px;
overflow: hidden;
}
&Icon {
font-size: 5em;
+193 -115
View File
@@ -1,10 +1,12 @@
/** @format */
import { useState, useEffect } from "react";
import { Cookies, useCookies } from "react-cookie";
import { useState, useEffect, useMemo } from "react";
import { useQuery } from "@tanstack/react-query";
import { useNavigate, useParams, Link } from "react-router-dom";
import { EventEmitter as event } from "../../eventEmitter.js";
import { motion } from "framer-motion";
import { getServer } from "../../utils/storage/servers.js";
import { saveUser } from "../../utils/storage/user.js";
// import Icon from "mdi-material-ui";
import { MdiEyeOffOutline } from "../../components/icons/mdiEyeOffOutline";
@@ -22,23 +24,34 @@ import IconButton from "@mui/material/IconButton";
import LoadingButton from "@mui/lab/LoadingButton";
import Button from "@mui/material/Button";
import { useSnackbar } from "notistack";
import FormGroup from "@mui/material/FormGroup";
import FormControlLabel from "@mui/material/FormControlLabel";
import Checkbox from "@mui/material/Checkbox";
import { AvatarCard, AvatarImage } from "../../components/avatar/avatar.jsx";
import { AvatarImage } from "../../components/avatar/avatar.jsx";
import { CardScroller } from "../../components/cardScroller/cardScroller.jsx";
import { Card } from "../../components/card/card.jsx";
import { AppBarBackOnly } from "../../components/appBar/backOnly.jsx";
// import { jellyfin } from "../../jellyfin";
// import getSystemApi from "@jellyfin/sdk";
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
import { getBrandingApi } from "@jellyfin/sdk/lib/utils/api/branding-api";
import "./login.module.scss";
import { CardsSkeleton } from "../../components/skeleton/cards.jsx";
export const LoginWithImage = () => {
const { userName, userId } = useParams();
const [password, setPassword] = useState({
showpass: false,
});
const [loading, setLoading] = useState(false);
const [rememberMe, setRememberMe] = useState(true);
const navigate = useNavigate();
const { enqueueSnackbar } = useSnackbar();
const handlePassword = (prop) => (event) => {
@@ -57,7 +70,7 @@ export const LoginWithImage = () => {
const authUser = async () => {
try {
const auth = await api.authenticateUserByName(
const auth = await window.api.authenticateUserByName(
userName,
password.password,
);
@@ -73,12 +86,18 @@ export const LoginWithImage = () => {
setLoading(true);
const user = await authUser();
sessionStorage.setItem("accessToken", user.data.AccessToken);
if (rememberMe == true) {
saveUser(userName, password.password);
}
event.emit("set-api-accessToken", window.api.basePath);
// setAccessToken(user.data.AccessToken)
setLoading(false);
navigate(`/home`);
};
const handleCheckRememberMe = (event) => {
setRememberMe(event.target.checked);
};
return (
<>
<AppBarBackOnly />
@@ -90,7 +109,13 @@ export const LoginWithImage = () => {
alignItems="center"
spacing={2}
>
<Grid item marginBottom={2}>
<Grid
container
direction="column"
justifyContent="center"
alignItems="center"
marginBottom={2}
>
<Typography
textAlign="center"
variant="h3"
@@ -116,39 +141,53 @@ export const LoginWithImage = () => {
</Typography>
</Grid>
<Grid item minWidth="100%">
<br />
<FormControl variant="outlined" fullWidth>
<InputLabel htmlFor="user-password">
Password:
</InputLabel>
<OutlinedInput
id="user-password"
type={
password.showpass
? "text"
: "password"
}
variant="outlined"
onChange={handlePassword("password")}
label="Password:"
endAdornment={
<InputAdornment position="end">
<IconButton
onClick={
handleShowPassword
}
aria-label="toggle password visibility"
>
{password.showpass ? (
<MdiEyeOffOutline />
) : (
<MdiEyeOutline />
)}
</IconButton>
</InputAdornment>
<FormGroup>
<FormControl variant="outlined" fullWidth>
<InputLabel htmlFor="user-password">
Password:
</InputLabel>
<OutlinedInput
id="user-password"
type={
password.showpass
? "text"
: "password"
}
variant="outlined"
onChange={handlePassword(
"password",
)}
label="Password:"
endAdornment={
<InputAdornment position="end">
<IconButton
onClick={
handleShowPassword
}
aria-label="toggle password visibility"
>
{password.showpass ? (
<MdiEyeOffOutline />
) : (
<MdiEyeOutline />
)}
</IconButton>
</InputAdornment>
}
/>
</FormControl>
<FormControlLabel
control={
<Checkbox
checked={rememberMe}
onChange={
handleCheckRememberMe
}
/>
}
label="Remember me"
/>
</FormControl>
</FormGroup>
</Grid>
<Grid item minWidth="100%">
<LoadingButton
@@ -172,10 +211,6 @@ export const LoginWithImage = () => {
export const UserLogin = () => {
const [userList, setUsers] = useState([]);
const navigate = useNavigate();
const cookies = new Cookies();
const currentServer = cookies.get("currentServer");
const serverList = cookies.get("servers");
const handleChangeServer = () => {
navigate("/servers/list");
@@ -183,50 +218,52 @@ export const UserLogin = () => {
const handleManualLogin = () => {
navigate("/login/manual");
};
const getUsers = async () => {
const users = await getUserApi(window.api).getPublicUsers();
// console.log(users.data);
return users;
// return {};
};
useEffect(() => {
getUsers().then((users) => {
setUsers(users.data);
console.log(userList);
});
}, []);
const users = useQuery({
queryKey: ["login", "users"],
queryFn: async () => {
const users = await getUserApi(window.api).getPublicUsers();
// console.log(users.data);
return users.data;
// return {};
},
});
return (
<>
<AppBarBackOnly />
<Container maxWidth="md" className="centered">
<h1 color="white">WIP-user login</h1>
<div className="userList">
{userList.map((item, index) => {
return (
//
<Link
to={`/login/withImg/${item.Name}/${item.Id}/`}
key={item.Id}
className="userCard"
index={index}
>
{item.PrimaryImageTag ? (
<AvatarCard
userName={item.Name}
userId={item.Id}
userImageAvailable={true}
></AvatarCard>
) : (
<AvatarCard
userName={item.Name}
userImageAvailable={false}
></AvatarCard>
)}
</Link>
);
})}
</div>
{/* <Typography variant="h3" sx={{ marginBottom: "1em" }}>
Users
</Typography> */}
{users.isLoading ? (
<CardsSkeleton />
) : (
<CardScroller displayCards={5} title="Users">
{users.data.map((item, index) => {
return (
//
<Link
to={`/login/withImg/${item.Name}/${item.Id}/`}
key={item.Id}
className="userCard"
index={index}
>
<Card
key={index}
itemName={item.Name}
itemId={item.Id}
imageTags={
!!item.PrimaryImageTag
}
// cardType="sqaure"
iconType="Person"
cardOrientation="sqaure"
/>
</Link>
);
})}
</CardScroller>
)}
<div className="buttons">
<Button
color="secondary"
@@ -251,6 +288,8 @@ export const UserLogin = () => {
export const UserLoginManual = () => {
const [loading, setLoading] = useState(false);
const [rememberMe, setRememberMe] = useState(true);
const navigate = useNavigate();
const { enqueueSnackbar } = useSnackbar();
@@ -259,6 +298,17 @@ export const UserLoginManual = () => {
});
const [userName, setUserName] = useState("");
const server = useQuery({
queryKey: ["login, manual", "serverInfo"],
queryFn: async () => {
const result = await getBrandingApi(
window.api,
).getBrandingOptions();
return result.data;
},
enabled: !window.api,
});
const handleUsername = (event) => {
setUserName(event.target.value);
};
@@ -279,7 +329,7 @@ export const UserLoginManual = () => {
const authUser = async () => {
try {
const auth = await api.authenticateUserByName(
const auth = await window.api.authenticateUserByName(
userName,
password.password,
);
@@ -297,12 +347,19 @@ export const UserLoginManual = () => {
setLoading(true);
const user = await authUser();
sessionStorage.setItem("accessToken", user.data.AccessToken);
if (rememberMe == true) {
saveUser(userName, password.password);
}
event.emit("set-api-accessToken", window.api.basePath);
// setAccessToken(user.data.AccessToken)
setLoading(false);
navigate(`/home`);
};
const handleCheckRememberMe = (event) => {
setRememberMe(event.target.checked);
};
return (
<>
<AppBarBackOnly />
@@ -338,42 +395,57 @@ export const UserLoginManual = () => {
</FormControl>
</Grid>
<Grid sx={{ width: "100%" }} item xl={5} md={6}>
<FormControl
sx={{ width: "100%" }}
variant="outlined"
>
<InputLabel htmlFor="user-password">
Password:
</InputLabel>
<OutlinedInput
fullWidth
id="user-password"
type={
password.showpass
? "text"
: "password"
}
<FormGroup>
<FormControl
sx={{ width: "100%" }}
variant="outlined"
onChange={handlePassword("password")}
label="Password:"
endAdornment={
<InputAdornment position="end">
<IconButton
onClick={
handleShowPassword
}
aria-label="toggle password visibility"
>
{password.showpass ? (
<MdiEyeOffOutline />
) : (
<MdiEyeOutline />
)}
</IconButton>
</InputAdornment>
>
<InputLabel htmlFor="user-password">
Password:
</InputLabel>
<OutlinedInput
fullWidth
id="user-password"
type={
password.showpass
? "text"
: "password"
}
variant="outlined"
onChange={handlePassword(
"password",
)}
label="Password:"
endAdornment={
<InputAdornment position="end">
<IconButton
onClick={
handleShowPassword
}
aria-label="toggle password visibility"
>
{password.showpass ? (
<MdiEyeOffOutline />
) : (
<MdiEyeOutline />
)}
</IconButton>
</InputAdornment>
}
/>
</FormControl>
<FormControlLabel
control={
<Checkbox
checked={rememberMe}
onChange={
handleCheckRememberMe
}
/>
}
label="Remember me"
/>
</FormControl>
</FormGroup>
</Grid>
<Grid item xl={5} md={6} sx={{ width: "100%" }}>
<LoadingButton
@@ -388,6 +460,12 @@ export const UserLoginManual = () => {
Login
</LoadingButton>
</Grid>
<Grid item xl={15} md={6} sx={{ width: "100%" }}>
<Typography variant="subtitle2">
{server.isSuccess &&
server.data.LoginDisclaimer}
</Typography>
</Grid>
</Grid>
</Container>
</>
+26 -32
View File
@@ -2,11 +2,13 @@
import { useState, useEffect } from "react";
import { Cookies, useCookies } from "react-cookie";
import { Navigate } from "react-router-dom";
import { useNavigate } from "react-router-dom";
import { v4 as uuidv4 } from "uuid";
import { EventEmitter as event } from "../../../eventEmitter.js";
import { setServer } from "../../../utils/storage/servers.js";
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
// MUI
import TextField from "@mui/material/TextField";
@@ -14,8 +16,6 @@ import Typography from "@mui/material/Typography";
import Grid from "@mui/material/Grid";
import LoadingButton from "@mui/lab/LoadingButton";
import SvgIcon from "@mui/material/SvgIcon";
import Button from "@mui/material/Button";
import LinearProgress from "@mui/material/LinearProgress";
import Container from "@mui/material/Container";
import { mdiChevronRight } from "@mdi/js";
@@ -126,57 +126,53 @@ export const ServerList = () => {
export const ServerSetup = (props) => {
const [serverIp, setServerIp] = useState("");
const [checkingServer, setServerCheckState] = useState(false);
const [isJfServer, setIsJfServerState] = useState(false);
const { enqueueSnackbar } = useSnackbar();
const [serverlistCookies, setServerList] = useCookies(["servers"]);
const [currentServer, setCurrentServer] = useCookies(["currentServer"]);
const cookies = new Cookies();
const navigate = useNavigate();
const [loading, setLoading] = useState(false);
const usersAvailable = async () => {
const users = await getUserApi(window.api).getPublicUsers();
if (users.data.length >= 1) {
console.log("Users => ", users.data);
return true;
} else {
return false;
}
};
const addServer = async () => {
event.emit("create-jellyfin-api", serverIp);
let sysInfo = await getSystemApi(window.api).getPublicSystemInfo();
sysInfo = sysInfo.data;
let initServerList = cookies.get("servers");
if (initServerList == null) {
initServerList = [];
// Set Server Config to Tauri store
sysInfo.Ip = serverIp;
setServer(sysInfo);
const usersAvailablity = await usersAvailable();
if (usersAvailablity == true) {
console.log(usersAvailablity);
navigate("/login/users");
} else {
initServerList = JSON.parse(initServerList);
navigate("/login/manual");
}
let serverConf = {
serverName: sysInfo.ServerName,
id: sysInfo.Id,
jellyfinVersion: sysInfo.Version,
serverAddress: serverIp,
};
let jfId = sysInfo.Id;
let server = {};
server[sysInfo.Id] = serverConf;
server = JSON.stringify([...initServerList, server]);
setServerList("servers", server, { path: "/" });
setCurrentServer("currentServer", sysInfo.Id, { path: "/" });
setIsJfServerState(true);
};
const handleAddServer = () => {
setLoading(true);
let data;
// setServerCheckState(true);
fetch(`${serverIp}/System/Ping`, {
body: JSON.stringify(data),
})
.then((res) => res.json())
.then((data) => {
if (data == "Jellyfin Server") {
console.log(true);
// setServerCheckState(false);
addServer();
setLoading(false);
return true;
} else {
// setServerCheckState(false);
enqueueSnackbar(
"The server address does not seem be a jellyfin server",
{ variant: "error" },
@@ -186,7 +182,6 @@ export const ServerSetup = (props) => {
}
})
.catch((error) => {
// setServerCheckState(false);
setLoading(false);
enqueueSnackbar(
"Unable to verify whether the give address is a valid Jellyfin server",
@@ -198,9 +193,8 @@ export const ServerSetup = (props) => {
return (
<>
{isJfServer && <Navigate to="/login" />}
<Container
maxWidth="md"
maxWidth="sm"
className={
checkingServer
? "centered serverContainer loading"
@@ -215,7 +209,7 @@ export const ServerSetup = (props) => {
alignItems="center"
>
<Grid item xl={5} md={6} sx={{ marginBottom: "1em" }}>
<JellyplayerLogo className="logo" />
<Typography variant="h3">Add Server</Typography>
</Grid>
<Grid item xl={5} md={6} sx={{ width: "100%" }}>
<TextField
+11
View File
@@ -0,0 +1,11 @@
/** @format */
import { configureStore } from "@reduxjs/toolkit";
import sideBarReducer from "./utils/slice/sidemenu";
import appBarReducer from "./utils/slice/appBar";
export default configureStore({
reducer: {
sidebar: sideBarReducer,
appBar: appBarReducer,
},
});
+20 -1
View File
@@ -1,4 +1,21 @@
/** @format */
::-webkit-scrollbar {
z-index: 10000;
width: 10px;
background: $clr-background-dark;
}
::-webkit-scrollbar-track {
z-index: 10000;
background-color: transparent;
&:hover {
background: rgb(255 255 255 / 0.25);
}
}
::-webkit-scrollbar-thumb {
z-index: 10000;
background: rgb(255 255 255 / 0.25);
}
body {
font-family: "Open Sans";
background: $clr-background-default;
@@ -12,8 +29,9 @@ body {
#root,
.root-page {
height: 100vh;
width: 100vw;
width: 100%;
overflow: hidden;
position: relative;
}
.centered {
@@ -65,6 +83,7 @@ h1 {
overflow-x: hidden;
overflow-y: auto;
height: 100vh;
width: inherit;
box-sizing: border-box;
}
+14 -2
View File
@@ -1,13 +1,25 @@
/** @format */
$clr-accent-default: hsl(337, 96%, 56%);
$clr-accent-dark: hsl(337, 96%, 10%);
$clr-secondary-default: hsl(273, 100%, 22%);
$clr-accent-dark: hsl(337, 96%, 20%);
$clr-secondary-default: hsl(273, 100%, 36%);
$clr-secondary-dark: hsl(273, 100%, 12%);
$clr-background-default: hsl(256, 100%, 6%);
$clr-background-dark: hsl(256, 100%, 4%);
$clr-background-light: hsl(256, 100%, 16%);
$clr-gradient-default: linear-gradient(
135deg,
$clr-accent-default,
$clr-secondary-default
);
$clr-gradient-dark: linear-gradient(
135deg,
$clr-accent-dark,
$clr-secondary-dark
);
$border-radius-default: 10px;
$border-radius-intensity-1: 5px;
+3
View File
@@ -26,6 +26,9 @@ export const theme = createTheme({
default: clrBackgroundDefault,
paper: clrBackgroundDark,
},
white: {
main: "#ffffff",
},
mode: "dark",
},
typography: {
+11
View File
@@ -0,0 +1,11 @@
/**
* @format
* @param {string} date - Date from server
* @returns {string} Formated Date
*/
export const formateDate = (date) => {
date = new Date(date);
date = new Intl.DateTimeFormat().format(date);
return date;
};
+39
View File
@@ -0,0 +1,39 @@
/**
* @format
* @param {number} ticks - C# ticks of a particular item
* @return {number} Converted ticks to Milliseconds
*/
const ticksToMs = (ticks) => {
return Math.round(ticks / 10000);
};
export const getRuntime = (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}hr ${timeMin}min`;
} else {
formatedTime = `${timeMin}min`;
}
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;
};
+37
View File
@@ -0,0 +1,37 @@
/** @format */
import { createSlice } from "@reduxjs/toolkit";
export const appBarSlice = createSlice({
name: "appBar",
initialState: {
visible: false,
backdrop: false,
backButtonVisible: false,
},
reducers: {
showAppBar: (state) => {
state.visible = true;
},
hideAppBar: (state) => {
state.visible = false;
},
setBackdrop: (state, action) => {
state.backdrop = action.payload;
},
showBackButton: (state, action) => {
state.backButtonVisible = true;
},
hideBackButton: (state) => {
state.backButtonVisible = false;
},
},
});
export const {
showAppBar,
hideAppBar,
setBackdrop,
showBackButton,
hideBackButton,
} = appBarSlice.actions;
export default appBarSlice.reducer;
+24
View File
@@ -0,0 +1,24 @@
/** @format */
import { createSlice } from "@reduxjs/toolkit";
export const sideBarSlice = createSlice({
name: "sidebar",
initialState: {
visible: false,
backdrop: true,
},
reducers: {
showSidemenu: (state) => {
state.visible = true;
},
hideSidemenu: (state) => {
state.visible = false;
},
setBackdrop: (state, action) => {
state.backdrop = action.payload;
},
},
});
export const { showSidemenu, hideSidemenu, setBackdrop } = sideBarSlice.actions;
export default sideBarSlice.reducer;
+33
View File
@@ -0,0 +1,33 @@
/** @format */
import { Store } from "tauri-plugin-store-api";
const servers = new Store(".servers.dat");
/**
* Set server in .servers.dat
* @param {object} data - Server info
*/
const setServer = async (data) => {
let server = servers.set("server", data);
await servers.save();
};
/**
* Get Server list
* @returns {object} server
*/
const getServer = async () => {
let server = await servers.get("server");
return server;
};
/**
* Delete the given server from client storage
*/
const delServer = async () => {
await servers.delete("server");
await servers.save();
};
export { setServer, getServer, delServer };
+35
View File
@@ -0,0 +1,35 @@
/** @format */
import { Store } from "tauri-plugin-store-api";
const user = new Store(".user.dat");
/**
* Set User details to .user.dat
* @param {string} userName - User's name
* @param {string} userPassword - User's Password
*/
const saveUser = async (userName, userPassword) => {
let details = user.set("user", {
Name: userName,
Password: userPassword || "",
});
await user.save();
};
/**
* Get saved user fro .user.dat
* @return {object}
*/
const getUser = async () => {
let details = await user.get("user");
return details;
};
/**
* Delete user from storage
*/
const delUser = async () => {
await user.clear();
};
export { saveUser, getUser, delUser };