diff --git a/biome.json b/biome.json index 3d94b67..bcd1c15 100644 --- a/biome.json +++ b/biome.json @@ -9,6 +9,9 @@ "recommended": true, "style": { "noNonNullAssertion": "off" + }, + "a11y": { + "useKeyWithClickEvents": "off" } } }, diff --git a/package.json b/package.json index 0226fc7..2f34fa7 100644 --- a/package.json +++ b/package.json @@ -1,67 +1,67 @@ { - "name": "jellyplayer", - "private": true, - "version": "0.0.3-dev", - "type": "module", - "scripts": { - "dev": "vite", - "build": "vite build", - "preview": "vite preview", - "tauri": "tauri", - "lint": "biome check src/", - "lint:fix": "biome check --apply src/" - }, - "dependencies": { - "@emotion/react": "^11.11.3", - "@emotion/styled": "^11.11.0", - "@fontsource-variable/jetbrains-mono": "^5.0.19", - "@fontsource/noto-sans": "^5.0.18", - "@jellyfin/sdk": "0.8.2", - "@mdi/js": "^7.4.47", - "@mui/lab": "5.0.0-alpha.159", - "@mui/material": "^5.15.3", - "@tanstack/react-query": "^5.17.5", - "@tanstack/react-query-devtools": "^5.17.5", - "@tauri-apps/api": "^1.5.3", - "@types/node": "^20.10.7", - "@types/react": "^18.2.47", - "@types/react-dom": "^18.2.18", - "axios": "^1.6.5", - "axios-tauri-api-adapter": "^0.2.1", - "blurhash": "^2.0.5", - "events": "^3.3.0", - "framer-motion": "^10.17.9", - "material-symbols": "^0.14.4", - "notistack": "^3.0.1", - "react": "^18.2.0", - "react-blurhash": "^0.3.0", - "react-dom": "^18.2.0", - "react-error-boundary": "^4.0.12", - "react-markdown": "^9.0.1", - "react-multi-carousel": "^2.8.4", - "react-player": "^2.14.1", - "react-router-dom": "^6.21.1", - "react-use-konami": "^1.1.0", - "tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log#v1", - "tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store", - "typescript": "^5.3.3", - "uuid": "^9.0.1", - "vite-plugin-svgr": "^4.2.0", - "wavesurfer.js": "^7.6.1", - "zustand": "^4.4.7" - }, - "devDependencies": { - "@biomejs/biome": "^1.5.0", - "@tauri-apps/cli": "^1.5.9", - "@types/uuid": "^9.0.7", - "@vitejs/plugin-react": "^4.2.1", - "eslint": "^8.56.0", - "eslint-plugin-react": "^7.33.2", - "eslint-plugin-react-refresh": "^0.4.5", - "prop-types": "^15.8.1", - "sass": "^1.69.7", - "vite": "^5.0.11", - "vite-plugin-compression": "^0.5.1" - }, - "license": "GPL-3.0-only" + "name": "jellyplayer", + "private": true, + "version": "0.0.3-dev", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "tauri": "tauri", + "lint": "biome check src/**/*", + "lint:fix": "biome check --apply src/**/*" + }, + "dependencies": { + "@emotion/react": "^11.11.3", + "@emotion/styled": "^11.11.0", + "@fontsource-variable/jetbrains-mono": "^5.0.19", + "@fontsource/noto-sans": "^5.0.18", + "@jellyfin/sdk": "0.8.2", + "@mdi/js": "^7.4.47", + "@mui/lab": "5.0.0-alpha.159", + "@mui/material": "^5.15.3", + "@tanstack/react-query": "^5.17.5", + "@tanstack/react-query-devtools": "^5.17.5", + "@tauri-apps/api": "^1.5.3", + "@types/node": "^20.10.7", + "@types/react": "^18.2.47", + "@types/react-dom": "^18.2.18", + "axios": "^1.6.5", + "axios-tauri-api-adapter": "^0.2.1", + "blurhash": "^2.0.5", + "events": "^3.3.0", + "framer-motion": "^10.17.9", + "material-symbols": "^0.14.4", + "notistack": "^3.0.1", + "react": "^18.2.0", + "react-blurhash": "^0.3.0", + "react-dom": "^18.2.0", + "react-error-boundary": "^4.0.12", + "react-markdown": "^9.0.1", + "react-multi-carousel": "^2.8.4", + "react-player": "^2.14.1", + "react-router-dom": "^6.21.1", + "react-use-konami": "^1.1.0", + "tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log#v1", + "tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store", + "typescript": "^5.3.3", + "uuid": "^9.0.1", + "vite-plugin-svgr": "^4.2.0", + "wavesurfer.js": "^7.6.1", + "zustand": "^4.4.7" + }, + "devDependencies": { + "@biomejs/biome": "^1.5.0", + "@tauri-apps/cli": "^1.5.9", + "@types/uuid": "^9.0.7", + "@vitejs/plugin-react": "^4.2.1", + "eslint": "^8.56.0", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-refresh": "^0.4.5", + "prop-types": "^15.8.1", + "sass": "^1.69.7", + "vite": "^5.0.11", + "vite-plugin-compression": "^0.5.1" + }, + "license": "GPL-3.0-only" } diff --git a/src/components/appBar/appBar.jsx b/src/components/appBar/appBar.jsx index e5fc026..9ca2b99 100644 --- a/src/components/appBar/appBar.jsx +++ b/src/components/appBar/appBar.jsx @@ -330,6 +330,7 @@ export const AppBar = () => { "Primary", ) ? ( {library.Name} ) : ( diff --git a/src/components/appBar/backOnly.jsx b/src/components/appBar/backOnly.jsx index 2014ffc..a29da01 100644 --- a/src/components/appBar/backOnly.jsx +++ b/src/components/appBar/backOnly.jsx @@ -1,4 +1,3 @@ - import AppBar from "@mui/material/AppBar"; import IconButton from "@mui/material/IconButton"; import Toolbar from "@mui/material/Toolbar"; diff --git a/src/components/buttons/playButton.jsx b/src/components/buttons/playButton.jsx index e520998..b199f16 100644 --- a/src/components/buttons/playButton.jsx +++ b/src/components/buttons/playButton.jsx @@ -199,6 +199,7 @@ const PlayButton = ({ setItemName(
{item.Items[0].Name} { @@ -220,6 +221,7 @@ const PlayButton = ({ setItemName(
{item.Items[0].SeriesName} { diff --git a/src/components/card/actorCards.jsx b/src/components/card/actorCards.jsx index 51d6ecd..da8543f 100644 --- a/src/components/card/actorCards.jsx +++ b/src/components/card/actorCards.jsx @@ -72,6 +72,7 @@ export const ActorCard = ({
person
{item.Name} (e.target.style.opacity = 1)} + onLoad={(e) => { + e.target.style.opacity = 1; + }} className="card-image" />
diff --git a/src/components/card/card.jsx b/src/components/card/card.jsx index a4960c1..1cf7e22 100644 --- a/src/components/card/card.jsx +++ b/src/components/card/card.jsx @@ -130,6 +130,7 @@ export const Card = ({ {overrideIcon ? getTypeIcon(overrideIcon) : getTypeIcon(item.Type)} {item.Name} (e.target.style.opacity = 1)} + onLoad={(e) => { + e.target.style.opacity = 1; + }} className="card-image" />
diff --git a/src/components/card/episodeCard.jsx b/src/components/card/episodeCard.jsx index 663f83b..8d8361c 100644 --- a/src/components/card/episodeCard.jsx +++ b/src/components/card/episodeCard.jsx @@ -86,6 +86,7 @@ export const EpisodeCard = ({
tv_gen
{item.Name} (e.target.style.opacity = 1)} + onLoad={(e) => { + e.target.style.opacity = 1; + }} className="card-image" /> diff --git a/src/components/cardScroller/cardScroller.jsx b/src/components/cardScroller/cardScroller.jsx index e663fce..b67cc08 100644 --- a/src/components/cardScroller/cardScroller.jsx +++ b/src/components/cardScroller/cardScroller.jsx @@ -1,4 +1,3 @@ - import PropTypes from "prop-types"; import React, { useState } from "react"; diff --git a/src/components/carousel/index.jsx b/src/components/carousel/index.jsx index a16fd22..6b70a2d 100644 --- a/src/components/carousel/index.jsx +++ b/src/components/carousel/index.jsx @@ -20,6 +20,8 @@ const Carousel = ({ content, onChange }) => { state.setDirection, state.direction, ]); + + // biome-ignore lint/correctness/useExhaustiveDependencies: useEffect(() => { onChange(currentSlide); }, [content[currentSlide].key]); @@ -106,7 +108,7 @@ const Carousel = ({ content, onChange }) => { ? "carousel-indicator active" : "carousel-indicator" } - key={index} + key={item.Id} onClick={() => { if (currentSlide > index) { setDirection("left"); diff --git a/src/components/carouselSlide/index.jsx b/src/components/carouselSlide/index.jsx index dfc08ec..e53a47f 100644 --- a/src/components/carouselSlide/index.jsx +++ b/src/components/carouselSlide/index.jsx @@ -100,6 +100,7 @@ const CarouselSlide = ({ item }) => { /> )} {item.Name} { style={{ opacity: 0, }} - onLoad={(e) => (e.target.style.opacity = 1)} + onLoad={(e) => { + e.target.style.opacity = 1; + }} loading="eager" /> @@ -156,6 +159,7 @@ const CarouselSlide = ({ item }) => { item.Name ) : ( {item.Name} { transition: "opacity 0.2s", objectFit: "contain", }} - onLoad={(e) => (e.target.style.opacity = 1)} + onLoad={(e) => { + e.target.style.opacity = 1; + }} /> )} diff --git a/src/components/icons/index.jsx b/src/components/icons/index.jsx index 4b4cc08..282001f 100644 --- a/src/components/icons/index.jsx +++ b/src/components/icons/index.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import React from "react"; diff --git a/src/components/icons/mdiAccount.jsx b/src/components/icons/mdiAccount.jsx index fced90b..8edb776 100644 --- a/src/components/icons/mdiAccount.jsx +++ b/src/components/icons/mdiAccount.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { MdiChevronLeft } from "./mdiChevronLeft"; diff --git a/src/components/icons/mdiArrowLeft.jsx b/src/components/icons/mdiArrowLeft.jsx index a8306b0..91ff81b 100644 --- a/src/components/icons/mdiArrowLeft.jsx +++ b/src/components/icons/mdiArrowLeft.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiArrowLeft } from "@mdi/js"; diff --git a/src/components/icons/mdiBook.jsx b/src/components/icons/mdiBook.jsx index b8874cf..774bd13 100644 --- a/src/components/icons/mdiBook.jsx +++ b/src/components/icons/mdiBook.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiBook } from "@mdi/js"; diff --git a/src/components/icons/mdiBookMultiple.jsx b/src/components/icons/mdiBookMultiple.jsx index 33685e1..66c7bcf 100644 --- a/src/components/icons/mdiBookMultiple.jsx +++ b/src/components/icons/mdiBookMultiple.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiBookMultiple } from "@mdi/js"; diff --git a/src/components/icons/mdiCheck.jsx b/src/components/icons/mdiCheck.jsx index 4e2f388..8354904 100644 --- a/src/components/icons/mdiCheck.jsx +++ b/src/components/icons/mdiCheck.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiCheck } from "@mdi/js"; diff --git a/src/components/icons/mdiChevronDown.jsx b/src/components/icons/mdiChevronDown.jsx index a66fec5..598d1e0 100644 --- a/src/components/icons/mdiChevronDown.jsx +++ b/src/components/icons/mdiChevronDown.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiChevronDown } from "@mdi/js"; diff --git a/src/components/icons/mdiChevronRight.jsx b/src/components/icons/mdiChevronRight.jsx index d7d12b8..2bb06f1 100644 --- a/src/components/icons/mdiChevronRight.jsx +++ b/src/components/icons/mdiChevronRight.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiChevronRight } from "@mdi/js"; diff --git a/src/components/icons/mdiCog.jsx b/src/components/icons/mdiCog.jsx index 79d4a3d..8306360 100644 --- a/src/components/icons/mdiCog.jsx +++ b/src/components/icons/mdiCog.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { MdiChevronLeft } from "./mdiChevronLeft"; diff --git a/src/components/icons/mdiCogSync.jsx b/src/components/icons/mdiCogSync.jsx index c86b3c7..5b3f605 100644 --- a/src/components/icons/mdiCogSync.jsx +++ b/src/components/icons/mdiCogSync.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiCogSync } from "@mdi/js"; diff --git a/src/components/icons/mdiEyeOffOutline.jsx b/src/components/icons/mdiEyeOffOutline.jsx index 1c78622..0534491 100644 --- a/src/components/icons/mdiEyeOffOutline.jsx +++ b/src/components/icons/mdiEyeOffOutline.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiEyeOffOutline } from "@mdi/js"; diff --git a/src/components/icons/mdiEyeOutline.jsx b/src/components/icons/mdiEyeOutline.jsx index 98c8262..e6331c5 100644 --- a/src/components/icons/mdiEyeOutline.jsx +++ b/src/components/icons/mdiEyeOutline.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiEyeOutline } from "@mdi/js"; diff --git a/src/components/icons/mdiFilmstrip.jsx b/src/components/icons/mdiFilmstrip.jsx index 95f3d91..9d92bbb 100644 --- a/src/components/icons/mdiFilmstrip.jsx +++ b/src/components/icons/mdiFilmstrip.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiFilmstrip } from "@mdi/js"; diff --git a/src/components/icons/mdiFilmstripBoxMultiple.jsx b/src/components/icons/mdiFilmstripBoxMultiple.jsx index 8b36a77..d0ab7db 100644 --- a/src/components/icons/mdiFilmstripBoxMultiple.jsx +++ b/src/components/icons/mdiFilmstripBoxMultiple.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiFilmstripBoxMultiple } from "@mdi/js"; diff --git a/src/components/icons/mdiFilterOutline.jsx b/src/components/icons/mdiFilterOutline.jsx index af3e645..10c0d8e 100644 --- a/src/components/icons/mdiFilterOutline.jsx +++ b/src/components/icons/mdiFilterOutline.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiFilterOutline } from "@mdi/js"; diff --git a/src/components/icons/mdiFolderMultiple.jsx b/src/components/icons/mdiFolderMultiple.jsx index 488531e..d218ca0 100644 --- a/src/components/icons/mdiFolderMultiple.jsx +++ b/src/components/icons/mdiFolderMultiple.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiFolderMultiple } from "@mdi/js"; diff --git a/src/components/icons/mdiFolderMusicOutline.jsx b/src/components/icons/mdiFolderMusicOutline.jsx index 355c507..2700c4a 100644 --- a/src/components/icons/mdiFolderMusicOutline.jsx +++ b/src/components/icons/mdiFolderMusicOutline.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiFolderMusicOutline } from "@mdi/js"; diff --git a/src/components/icons/mdiFolderOutline.jsx b/src/components/icons/mdiFolderOutline.jsx index 89d6605..0874ba7 100644 --- a/src/components/icons/mdiFolderOutline.jsx +++ b/src/components/icons/mdiFolderOutline.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiFolderOutline } from "@mdi/js"; diff --git a/src/components/icons/mdiFullscreen.jsx b/src/components/icons/mdiFullscreen.jsx index b5bd8e7..d272d64 100644 --- a/src/components/icons/mdiFullscreen.jsx +++ b/src/components/icons/mdiFullscreen.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiFullscreen } from "@mdi/js"; diff --git a/src/components/icons/mdiFullscreenExit.jsx b/src/components/icons/mdiFullscreenExit.jsx index 15ece65..95f603b 100644 --- a/src/components/icons/mdiFullscreenExit.jsx +++ b/src/components/icons/mdiFullscreenExit.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiFullscreenExit } from "@mdi/js"; diff --git a/src/components/icons/mdiHdr.jsx b/src/components/icons/mdiHdr.jsx index 57b5179..b63340a 100644 --- a/src/components/icons/mdiHdr.jsx +++ b/src/components/icons/mdiHdr.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiHdr } from "@mdi/js"; diff --git a/src/components/icons/mdiHeart.jsx b/src/components/icons/mdiHeart.jsx index 54df87f..0845577 100644 --- a/src/components/icons/mdiHeart.jsx +++ b/src/components/icons/mdiHeart.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiHeart } from "@mdi/js"; diff --git a/src/components/icons/mdiHeartOutline.jsx b/src/components/icons/mdiHeartOutline.jsx index 92cb9fa..6156b10 100644 --- a/src/components/icons/mdiHeartOutline.jsx +++ b/src/components/icons/mdiHeartOutline.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiHeartOutline } from "@mdi/js"; diff --git a/src/components/icons/mdiHomeVariant.jsx b/src/components/icons/mdiHomeVariant.jsx index 07bdc16..07b4a0e 100644 --- a/src/components/icons/mdiHomeVariant.jsx +++ b/src/components/icons/mdiHomeVariant.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiHomeVariant } from "@mdi/js"; diff --git a/src/components/icons/mdiHomeVariantOutline.jsx b/src/components/icons/mdiHomeVariantOutline.jsx index 68ae94f..c0d499f 100644 --- a/src/components/icons/mdiHomeVariantOutline.jsx +++ b/src/components/icons/mdiHomeVariantOutline.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiHomeVariantOutline } from "@mdi/js"; diff --git a/src/components/icons/mdiImage.jsx b/src/components/icons/mdiImage.jsx index 7c6fd4a..ab5e392 100644 --- a/src/components/icons/mdiImage.jsx +++ b/src/components/icons/mdiImage.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiImage } from "@mdi/js"; diff --git a/src/components/icons/mdiImageMultiple.jsx b/src/components/icons/mdiImageMultiple.jsx index 07643d6..e25ed49 100644 --- a/src/components/icons/mdiImageMultiple.jsx +++ b/src/components/icons/mdiImageMultiple.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiImageMultiple } from "@mdi/js"; diff --git a/src/components/icons/mdiInformation.jsx b/src/components/icons/mdiInformation.jsx index a3182ed..44f6d4c 100644 --- a/src/components/icons/mdiInformation.jsx +++ b/src/components/icons/mdiInformation.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiInformation } from "@mdi/js"; diff --git a/src/components/icons/mdiMicrophone.jsx b/src/components/icons/mdiMicrophone.jsx index 0ddab29..9949669 100644 --- a/src/components/icons/mdiMicrophone.jsx +++ b/src/components/icons/mdiMicrophone.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiMicrophone } from "@mdi/js"; diff --git a/src/components/icons/mdiMovieOutline.jsx b/src/components/icons/mdiMovieOutline.jsx index 8956959..9bb3eba 100644 --- a/src/components/icons/mdiMovieOutline.jsx +++ b/src/components/icons/mdiMovieOutline.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiMovieOutline } from "@mdi/js"; diff --git a/src/components/icons/mdiMultimedia.jsx b/src/components/icons/mdiMultimedia.jsx index 1aae577..79fce7c 100644 --- a/src/components/icons/mdiMultimedia.jsx +++ b/src/components/icons/mdiMultimedia.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiMultimedia } from "@mdi/js"; diff --git a/src/components/icons/mdiMusicBoxMultipleOutline.jsx b/src/components/icons/mdiMusicBoxMultipleOutline.jsx index cc67efe..3efc06f 100644 --- a/src/components/icons/mdiMusicBoxMultipleOutline.jsx +++ b/src/components/icons/mdiMusicBoxMultipleOutline.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiMusicBoxMultipleOutline } from "@mdi/js"; diff --git a/src/components/icons/mdiPlaySpeed.jsx b/src/components/icons/mdiPlaySpeed.jsx index 2d8472d..a610748 100644 --- a/src/components/icons/mdiPlaySpeed.jsx +++ b/src/components/icons/mdiPlaySpeed.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiPlaySpeed } from "@mdi/js"; diff --git a/src/components/icons/mdiPlaylistMusicOutline.jsx b/src/components/icons/mdiPlaylistMusicOutline.jsx index 30a676e..fe53050 100644 --- a/src/components/icons/mdiPlaylistMusicOutline.jsx +++ b/src/components/icons/mdiPlaylistMusicOutline.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiPlaylistMusicOutline } from "@mdi/js"; diff --git a/src/components/icons/mdiStar.jsx b/src/components/icons/mdiStar.jsx index 0841dd7..46c590a 100644 --- a/src/components/icons/mdiStar.jsx +++ b/src/components/icons/mdiStar.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiStar } from "@mdi/js"; diff --git a/src/components/icons/mdiStarHalfFull.jsx b/src/components/icons/mdiStarHalfFull.jsx index aab5eaf..5122c42 100644 --- a/src/components/icons/mdiStarHalfFull.jsx +++ b/src/components/icons/mdiStarHalfFull.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiStarHalfFull } from "@mdi/js"; diff --git a/src/components/icons/mdiTelevision.jsx b/src/components/icons/mdiTelevision.jsx index bab859c..04f8472 100644 --- a/src/components/icons/mdiTelevision.jsx +++ b/src/components/icons/mdiTelevision.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiTelevision } from "@mdi/js"; diff --git a/src/components/icons/mdiTelevisionClassic.jsx b/src/components/icons/mdiTelevisionClassic.jsx index e648e53..a3eedaa 100644 --- a/src/components/icons/mdiTelevisionClassic.jsx +++ b/src/components/icons/mdiTelevisionClassic.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiTelevisionClassic } from "@mdi/js"; diff --git a/src/components/icons/mdiVolumeHigh.jsx b/src/components/icons/mdiVolumeHigh.jsx index dd6d607..26586da 100644 --- a/src/components/icons/mdiVolumeHigh.jsx +++ b/src/components/icons/mdiVolumeHigh.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiVolumeHigh } from "@mdi/js"; diff --git a/src/components/icons/mdiVolumeOff.jsx b/src/components/icons/mdiVolumeOff.jsx index 1d3c263..6dc2059 100644 --- a/src/components/icons/mdiVolumeOff.jsx +++ b/src/components/icons/mdiVolumeOff.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiVolumeOff } from "@mdi/js"; diff --git a/src/components/icons/mdiYoutube.jsx b/src/components/icons/mdiYoutube.jsx index e9b47f9..df3a4d9 100644 --- a/src/components/icons/mdiYoutube.jsx +++ b/src/components/icons/mdiYoutube.jsx @@ -1,4 +1,3 @@ - import SvgIcon from "@mui/material/SvgIcon"; import { mdiYoutube } from "@mdi/js"; diff --git a/src/components/layouts/item/hero.jsx b/src/components/layouts/item/hero.jsx index 6fba86a..2a33923 100644 --- a/src/components/layouts/item/hero.jsx +++ b/src/components/layouts/item/hero.jsx @@ -111,13 +111,14 @@ const Hero = ({ videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("4k") ) { return "4K"; - }if ( + } + if ( videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("1080p") || videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("hd") ) { return "HD"; } - return "SD"; + return "SD"; }; const atmosLabel = () => { @@ -126,25 +127,24 @@ const Hero = ({ audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("truehd") ) { return "TrueHD | Atmos"; - }if ( - audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("atmos") - ) { + } + if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("atmos")) { return "Atmos"; - }if ( - audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("truehd") - ) { + } + if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("truehd")) { return "TrueHD"; } - return ""; + return ""; }; const surroundSoundLabel = () => { if (audioTracks[0]?.DisplayTitle.includes("7.1")) { return "7.1"; - }if (audioTracks[0].DisplayTitle.includes("5.1")) { + } + if (audioTracks[0].DisplayTitle.includes("5.1")) { return "5.1"; } - return "2.0"; + return "2.0"; }; return ( @@ -182,7 +182,9 @@ const Hero = ({ style={{ opacity: 0, }} - onLoad={(e) => (e.target.style.opacity = 1)} + onLoad={(e) => { + e.target.style.opacity = 1; + }} loading="eager" /> diff --git a/src/components/menu/sidemenu.jsx b/src/components/menu/sidemenu.jsx index 9aa0e17..2987566 100644 --- a/src/components/menu/sidemenu.jsx +++ b/src/components/menu/sidemenu.jsx @@ -109,7 +109,7 @@ export const SideMenu = () => { justifyContent: "center", }} > - + JellyPlayer
{libraries.isPending ? ( diff --git a/src/components/musicTrack/index.jsx b/src/components/musicTrack/index.jsx index 61b4d1a..bfaea0f 100644 --- a/src/components/musicTrack/index.jsx +++ b/src/components/musicTrack/index.jsx @@ -49,6 +49,7 @@ const MusicTrack = ({ />
{item.Name} (e.target.style.opacity = 1)} + onLoad={(e) => { + e.target.style.opacity = 1; + }} />
{ }} sx={{ width: "100%" }} > - {Array.from(new Array(4)).map((a, index) => { + {Array.from(new Array(4)).map((a) => { return ( - + { /> {Array.from(new Array(4)).map((a, index) => { return ( - + { useEffect(() => { setBackdrop("", ""); - }, []); + }); if (systemInfo.isPending) { return (
{ target="_blank" rel="noreferrer" > - + JellyPlayer
{ item.data.Id, ); } - }, [item.isSuccess]); + }); if (item.isPending || similarItems.isPending) { return ( diff --git a/src/routes/artist/index.jsx b/src/routes/artist/index.jsx index cf13a87..577ac3f 100644 --- a/src/routes/artist/index.jsx +++ b/src/routes/artist/index.jsx @@ -158,11 +158,7 @@ const ArtistTitlePage = () => { setActiveArtistTab(2); } } - }, [ - artistDiscography.isPending, - artistSongs.isPending, - artistAppearances.isPending, - ]); + }); const [animationDirection, setAnimationDirection] = useState("forward"); @@ -178,7 +174,7 @@ const ArtistTitlePage = () => { item.data.Id, ); } - }, [item.isSuccess]); + }); if (item.isPending) { return ( @@ -243,7 +239,7 @@ const ArtistTitlePage = () => { {artistTabs.map((tab, index) => { return ( @@ -273,10 +269,10 @@ const ArtistTitlePage = () => { }} > {artistDiscography.isSuccess && - artistDiscography.data.Items.map((tabitem, aindex) => { + artistDiscography.data.Items.map((tabitem) => { return ( diff --git a/src/routes/boxset/index.jsx b/src/routes/boxset/index.jsx index ddd4562..7ccc902 100644 --- a/src/routes/boxset/index.jsx +++ b/src/routes/boxset/index.jsx @@ -113,6 +113,7 @@ const BoxSetTitlePage = () => { const [directors, setDirectors] = useState([]); const [writers, setWriters] = useState([]); + useEffect(() => { if (item.isSuccess) { setAppBackdrop( @@ -127,7 +128,7 @@ const BoxSetTitlePage = () => { const writeTp = item.data.People.filter((itm) => itm.Type === "Writer"); setWriters(writeTp); } - }, [item.isSuccess]); + }); if (item.isPending || similarItems.isPending) { return ( diff --git a/src/routes/episode/index.jsx b/src/routes/episode/index.jsx index e9ed865..c03f874 100644 --- a/src/routes/episode/index.jsx +++ b/src/routes/episode/index.jsx @@ -1,21 +1,20 @@ import PropTypes from "prop-types"; import React, { useState, useLayoutEffect } from "react"; -import PropTypes from "prop-types"; import Box from "@mui/material/Box"; -import Stack from "@mui/material/Stack"; -import Typography from "@mui/material/Typography"; -import CircularProgress from "@mui/material/CircularProgress"; import Chip from "@mui/material/Chip"; -import TextField from "@mui/material/TextField"; -import MenuItem from "@mui/material/MenuItem"; +import CircularProgress from "@mui/material/CircularProgress"; import Divider from "@mui/material/Divider"; import LinearProgress from "@mui/material/LinearProgress"; -import { red, green, yellow } from "@mui/material/colors"; +import MenuItem from "@mui/material/MenuItem"; +import Stack from "@mui/material/Stack"; +import TextField from "@mui/material/TextField"; +import Typography from "@mui/material/Typography"; +import { green, red, yellow } from "@mui/material/colors"; import { Blurhash } from "react-blurhash"; -import { useParams, Link, NavLink } from "react-router-dom"; +import { Link, NavLink, useParams } from "react-router-dom"; import { motion } from "framer-motion"; @@ -34,16 +33,16 @@ import { Card } from "../../components/card/card"; import { CardScroller } from "../../components/cardScroller/cardScroller"; import Hero from "../../components/layouts/item/hero"; -import "./episode.module.scss"; -import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice"; -import { useBackdropStore } from "../../utils/store/backdrop"; -import { useApi } from "../../utils/store/api"; -import { endsAt, getRuntime } from "../../utils/date/time"; -import PlayButton from "../../components/buttons/playButton"; import LikeButton from "../../components/buttons/likeButton"; import MarkPlayedButton from "../../components/buttons/markPlayedButton"; +import PlayButton from "../../components/buttons/playButton"; +import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice"; import TextLink from "../../components/textLink"; import { getTypeIcon } from "../../components/utils/iconsCollection"; +import { endsAt, getRuntime } from "../../utils/date/time"; +import { useApi } from "../../utils/store/api"; +import { useBackdropStore } from "../../utils/store/backdrop"; +import "./episode.module.scss"; function TabPanel(props) { const { children, value, index, ...other } = props; @@ -107,7 +106,7 @@ const EpisodeTitlePage = () => { }); return result.data; }, - enabled: item.isSuccess && item.data.Type == BaseItemKind.Episode, + enabled: item.isSuccess && item.data.Type === BaseItemKind.Episode, networkMode: "always", }); @@ -154,12 +153,13 @@ const EpisodeTitlePage = () => { setAudioTracks(audios); setSubtitleTracks(subs); } - }, [item.isSuccess]); + }); const [directors, setDirectors] = useState([]); const [writers, setWriters] = useState([]); const [actors, setActors] = useState([]); const [producers, setProducers] = useState([]); + useLayoutEffect(() => { if (item.isSuccess) { setAppBackdrop( @@ -173,72 +173,57 @@ const EpisodeTitlePage = () => { setDirectors(direTp); const writeTp = item.data.People.filter((itm) => itm.Type === "Writer"); setWriters(writeTp); - let producerTp = item.data.People.filter( - (itm) => itm.Type == "Producer", + const producerTp = item.data.People.filter( + (itm) => itm.Type === "Producer", ); setProducers(producerTp); - let actorTp = item.data.People.filter( - (itm) => itm.Type == "Actor", - ); + const actorTp = item.data.People.filter((itm) => itm.Type === "Actor"); setActors(actorTp); } - }, [item.isSuccess]); + }); const qualityLabel = () => { if ( - videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes( - "2160p", - ) || + videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("2160p") || videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("4k") ) { return 4k; - } else if ( - videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes( - "1080p", - ) || + } + + if ( + videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("1080p") || videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("hd") ) { return full_hd; - } else { - return hd; } + return hd; }; const atmosLabel = () => { if ( - audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes( - "atmos", - ) && - audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes( - "truehd", - ) + audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("atmos") && + audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("truehd") ) { - return `TrueHD | Atmos`; - } else if ( - audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes( - "atmos", - ) - ) { - return "Atmos"; - } else if ( - audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes( - "truehd", - ) - ) { - return "TrueHD"; - } else { - return ""; + return "TrueHD | Atmos"; } + if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("atmos")) { + return "Atmos"; + } + if (audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("truehd")) { + return "TrueHD"; + } + return ""; }; const surroundSoundLabel = () => { if (audioTracks[0]?.DisplayTitle.includes("7.1")) { return "7.1"; - } else if (audioTracks[0]?.DisplayTitle.includes("5.1")) { - return "5.1"; - } else { - return "2.0"; } + if (audioTracks[0]?.DisplayTitle.includes("5.1")) { + return "5.1"; + } + + return "2.0"; }; if (item.isPending) { @@ -276,18 +261,18 @@ const EpisodeTitlePage = () => {
{item.data.BackdropImageTags ? ( {item.data.Name} - (e.currentTarget.style.opacity = 1) - } + onLoad={(e) => { + e.currentTarget.style.opacity = 1; + }} /> ) : ( <> @@ -296,39 +281,28 @@ const EpisodeTitlePage = () => {
- {Object.keys(item.data.ImageTags).includes( - "Primary", - ) ? ( + {Object.keys(item.data.ImageTags).includes("Primary") ? ( <> - (e.currentTarget.style.opacity = 1) - } + alt={item.data.Name} + src={api.getItemImageUrl(item.data.Id, "Primary", { + quality: 90, + tag: item.data.ImageTags.Primary, + })} + onLoad={(e) => { + e.currentTarget.style.opacity = 1; + }} className="item-hero-image" /> @@ -337,24 +311,18 @@ const EpisodeTitlePage = () => { )}
- + {item.data.ParentLogoItemId.length > 0 ? ( - (e.currentTarget.style.opacity = 1) - } + alt={item.data.SeriesName} + src={api.getItemImageUrl(item.data.ParentLogoItemId, "Logo", { + quality: 90, + fillWidth: 592, + fillHeight: 592, + })} + onLoad={(e) => { + e.currentTarget.style.opacity = 1; + }} className="item-hero-logo" /> ) : ( @@ -372,8 +340,7 @@ const EpisodeTitlePage = () => { variant="filled" label={qualityLabel()} sx={{ - borderRadius: - "8px !important", + borderRadius: "8px !important", "& .MuiChip-label": { fontSize: "2.2em", }, @@ -384,16 +351,12 @@ const EpisodeTitlePage = () => { + {surroundSoundLabel()} } sx={{ - borderRadius: - "8px !important", + borderRadius: "8px !important", "& .MuiChip-label": { fontSize: "2.2em", }, @@ -404,19 +367,12 @@ const EpisodeTitlePage = () => { - { - videoTracks[0] - .VideoRangeType - } + + {videoTracks[0].VideoRangeType} } sx={{ - borderRadius: - "8px !important", + borderRadius: "8px !important", "& .MuiChip-label": { fontSize: "2.2em", }, @@ -427,16 +383,12 @@ const EpisodeTitlePage = () => { + {atmosLabel()} } sx={{ - borderRadius: - "8px !important", + borderRadius: "8px !important", "& .MuiChip-label": { fontSize: "2.2em", }, @@ -459,8 +411,7 @@ const EpisodeTitlePage = () => { } sx={{ - borderRadius: - "8px !important", + borderRadius: "8px !important", "& .MuiChip-label": { fontSize: "2.2em", }, @@ -474,17 +425,11 @@ const EpisodeTitlePage = () => { justifyItems="flex-start" alignItems="center" > - + {item.data.ProductionYear ?? ""} {item.data.OfficialRating && ( - + )} {item.data.CommunityRating && ( @@ -513,11 +458,7 @@ const EpisodeTitlePage = () => { }} variant="subtitle1" > - {Math.round( - item.data - .CommunityRating * - 10, - ) / 10} + {Math.round(item.data.CommunityRating * 10) / 10}
)} @@ -534,18 +475,12 @@ const EpisodeTitlePage = () => { className="material-symbols-rounded " style={{ color: - item.data - .CriticRating > - 50 - ? green[400] - : red[400], + item.data.CriticRating > 50 ? green[400] : red[400], fontVariationSettings: '"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40', }} > - {item.data.CriticRating > 50 - ? "thumb_up" - : "thumb_down"} + {item.data.CriticRating > 50 ? "thumb_up" : "thumb_down"}
{ )} {item.data.RunTimeTicks && ( - - {getRuntime( - item.data.RunTimeTicks, - )} + + {getRuntime(item.data.RunTimeTicks)} )} {item.data.RunTimeTicks && ( - + {endsAt( item.data.RunTimeTicks - - item.data.UserData - .PlaybackPositionTicks, + item.data.UserData.PlaybackPositionTicks, )} )} - + {item.data.Genres.join(", ")} @@ -594,38 +517,25 @@ const EpisodeTitlePage = () => { itemId={item.data.Id} itemType={item.data.Type} itemUserData={item.data.UserData} - currentVideoTrack={ - selectedVideoTrack - } - currentAudioTrack={ - selectedAudioTrack - } - currentSubTrack={ - selectedSubtitleTrack - } + currentVideoTrack={selectedVideoTrack} + currentAudioTrack={selectedAudioTrack} + currentSubTrack={selectedSubtitleTrack} userId={user.data.Id} />
-
+
@@ -644,29 +554,21 @@ const EpisodeTitlePage = () => { {getRuntime( item.data.RunTimeTicks - - item.data.UserData - .PlaybackPositionTicks, + item.data.UserData.PlaybackPositionTicks, )}{" "} left
)} - + {item.data.Taglines[0] ?? ""} @@ -688,20 +590,15 @@ const EpisodeTitlePage = () => { <> {writer.Name} - {index != - writers.length - - 1 && ( + {index !== writers.length - 1 && ( ,{" "} @@ -724,35 +621,26 @@ const EpisodeTitlePage = () => { Directed by
- {directors.map( - (director, index) => ( - <> - ( + <> + + {director.Name} + + {index !== directors.length - 1 && ( + - {director.Name} - - {index != - directors.length - - 1 && ( - - ,{" "} - - )} - - ), - )} + ,{" "} + + )} + + ))}
)} @@ -772,17 +660,10 @@ const EpisodeTitlePage = () => { marginBottom: "1em", }} value={selectedVideoTrack} - onChange={(e) => - setSelectedVideoTrack( - e.target.value, - ) - } + onChange={(e) => setSelectedVideoTrack(e.target.value)} > {videoTracks.map((track) => ( - + {track.DisplayTitle} ))} @@ -797,17 +678,10 @@ const EpisodeTitlePage = () => { marginBottom: "1em", }} value={selectedAudioTrack} - onChange={(e) => - setSelectedAudioTrack( - e.target.value, - ) - } + onChange={(e) => setSelectedAudioTrack(e.target.value)} > {audioTracks.map((track) => ( - + {track.DisplayTitle} ))} @@ -821,20 +695,13 @@ const EpisodeTitlePage = () => { width: "100%", }} value={selectedSubtitleTrack} - onChange={(e) => - setSelectedSubtitleTrack( - e.target.value, - ) - } + onChange={(e) => setSelectedSubtitleTrack(e.target.value)} > No Subtitle {subtitleTracks.map((track) => ( - + {track.DisplayTitle} ))} @@ -907,28 +774,21 @@ const EpisodeTitlePage = () => { > {actor.PrimaryImageTag ? ( {actor.Name} ) : (
- {getTypeIcon( - "Person", - )} + {getTypeIcon("Person")}
)}
- - {actor.Name} - + {actor.Name} { > {actor.PrimaryImageTag ? ( {actor.Name} ) : (
- {getTypeIcon( - "Person", - )} + {getTypeIcon("Person")}
)}
- - {actor.Name} - + {actor.Name} { )} {directors.length > 0 && (
- - Directors - + Directors
{directors.map((actor) => ( { > {actor.PrimaryImageTag ? ( {actor.Name} ) : (
- {getTypeIcon( - "Person", - )} + {getTypeIcon("Person")}
)}
- - {actor.Name} - + {actor.Name} { )} {producers.length > 0 && (
- - Producers - + Producers
{producers.map((actor) => ( { > {actor.PrimaryImageTag ? ( {actor.Name} ) : (
- {getTypeIcon( - "Person", - )} + {getTypeIcon("Person")}
)}
- - {actor.Name} - + {actor.Name} { }); useEffect(() => { - // Removing app's backdrop setBackdrop("", ""); - }, []); + }); + return (
{ setAudioTracks(audios); setSubtitleTracks(subs); } - }, [item.isSuccess]); + }); const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]); @@ -187,6 +186,7 @@ const ItemDetail = () => { const [writers, setWriters] = useState([]); const [actors, setActors] = useState([]); const [producers, setProducers] = useState([]); + useLayoutEffect(() => { if (item.isSuccess) { setAppBackdrop( @@ -207,7 +207,7 @@ const ItemDetail = () => { const actorTp = item.data.People.filter((itm) => itm.Type === "Actor"); setActors(actorTp); } - }, [item.isSuccess]); + }); const qualityLabel = () => { if ( @@ -287,16 +287,14 @@ const ItemDetail = () => {
{item.data.BackdropImageTags ? ( {item.data.Name} (e.currentTarget.style.opacity = 1)} + onLoad={(e) => { + e.currentTarget.style.opacity = 1; + }} /> ) : ( <> @@ -319,11 +317,14 @@ const ItemDetail = () => { className="item-hero-image-blurhash" /> {item.data.Name} (e.currentTarget.style.opacity = 1)} + onLoad={(e) => { + e.currentTarget.style.opacity = 1; + }} className="item-hero-image" /> @@ -334,12 +335,15 @@ const ItemDetail = () => {
{Object.keys(item.data.ImageTags).includes("Logo") ? ( {item.data.Name} (e.currentTarget.style.opacity = 1)} + onLoad={(e) => { + e.currentTarget.style.opacity = 1; + }} className="item-hero-logo" /> ) : ( @@ -755,6 +759,7 @@ const ItemDetail = () => { > {actor.PrimaryImageTag ? ( {actor.Name} { > {actor.PrimaryImageTag ? ( {actor.Name} { > {actor.PrimaryImageTag ? ( {actor.Name} { > {actor.PrimaryImageTag ? ( {actor.Name} { ]); } } - }, [currentLib.isSuccess]); + }); const [filterArray, setFilterArray] = useState([]); diff --git a/src/routes/person/index.jsx b/src/routes/person/index.jsx index bc24d8e..cac9b0d 100644 --- a/src/routes/person/index.jsx +++ b/src/routes/person/index.jsx @@ -226,13 +226,7 @@ const PersonTitlePage = () => { setActivePersonTab(4); } } - }, [ - personMovies.isPending, - personShows.isPending, - personBooks.isPending, - personPhotos.isPending, - personEpisodes.isPending, - ]); + }); const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]); const [animationDirection, setAnimationDirection] = useState("forward"); @@ -247,7 +241,7 @@ const PersonTitlePage = () => { item.data.Id, ); } - }, [item.isSuccess]); + }); if (item.isPending) { return ( @@ -308,10 +302,10 @@ const PersonTitlePage = () => { setActivePersonTab(newVal); }} > - {personTabs.map((tab, index) => { + {personTabs.map((tab) => { return ( diff --git a/src/routes/player/videoPlayer.jsx b/src/routes/player/videoPlayer.jsx index 6f93f5b..6431ffc 100644 --- a/src/routes/player/videoPlayer.jsx +++ b/src/routes/player/videoPlayer.jsx @@ -174,7 +174,7 @@ export const VideoPlayer = () => { playerRef.current.seekTo(timeToStart, "seconds"); setIsReady(true); } - }, [isReady]); + }); const handleDisplayCurrentTime = () => { let time = ticksToSec(progress * itemDuration); @@ -249,6 +249,7 @@ export const VideoPlayer = () => { setItemName(
Series Logo { setItemName(
Series Logo { return () => { clearTimeout(timeout); }; - }, [volume]); + }); const handleExit = async () => { // Remove app from fullscreen diff --git a/src/routes/playlist/index.jsx b/src/routes/playlist/index.jsx index 6258afe..70aa047 100644 --- a/src/routes/playlist/index.jsx +++ b/src/routes/playlist/index.jsx @@ -122,7 +122,7 @@ const PlaylistTitlePage = () => { item.data.Id, ); } - }, [item.isSuccess]); + }); if (item.isPending || similarItems.isPending) { return ( diff --git a/src/routes/search/index.jsx b/src/routes/search/index.jsx index 609924d..61d8198 100644 --- a/src/routes/search/index.jsx +++ b/src/routes/search/index.jsx @@ -150,7 +150,7 @@ const SearchPage = () => { useEffect(() => { // Removing app's backdrop setBackdrop("", ""); - }, []); + }); return (
{ const [writers, setWriters] = useState([]); const [actors, setActors] = useState([]); const [producers, setProducers] = useState([]); + useEffect(() => { if (item.isSuccess) { setAppBackdrop( @@ -223,7 +224,7 @@ const SeriesTitlePage = () => { const actorTp = item.data.People.filter((itm) => itm.Type === "Actor"); setActors(actorTp); } - }, [item.isSuccess]); + }); if (item.isPending || similarItems.isPending) { return ( @@ -260,16 +261,14 @@ const SeriesTitlePage = () => {
{item.data.BackdropImageTags ? ( {item.data.Name} (e.currentTarget.style.opacity = 1)} + onLoad={(e) => { + e.currentTarget.style.opacity = 1; + }} /> ) : ( <> @@ -292,11 +291,14 @@ const SeriesTitlePage = () => { className="item-hero-image-blurhash" /> {item.data.Name} (e.currentTarget.style.opacity = 1)} + onLoad={(e) => { + e.currentTarget.style.opacity = 1; + }} className="item-hero-image" /> @@ -307,12 +309,15 @@ const SeriesTitlePage = () => {
{Object.keys(item.data.ImageTags).includes("Logo") ? ( {item.data.Name} (e.currentTarget.style.opacity = 1)} + onLoad={(e) => { + e.currentTarget.style.opacity = 1; + }} className="item-hero-logo" /> ) : ( @@ -592,6 +597,7 @@ const SeriesTitlePage = () => { > {actor.PrimaryImageTag ? ( {actor.Name} { > {actor.PrimaryImageTag ? ( {actor.Name} { > {actor.PrimaryImageTag ? ( {actor.Name} { > {actor.PrimaryImageTag ? ( {actor.Name} {
{episodes.isPending - ? Array.from(new Array(4)).map( - (a, index) => { - return ( - { + return ( + + + + + - + - - - - - + - - - + + + - - - - - ); - }, - ) + + + + + ); + }) : episodes.data.Items.map((episode) => { return ( { return

WIP Settings

; }; diff --git a/src/utils/date/formateDate.js b/src/utils/date/formateDate.js index 4aea54c..76a8d04 100644 --- a/src/utils/date/formateDate.js +++ b/src/utils/date/formateDate.js @@ -5,7 +5,7 @@ */ export const formateDate = (date) => { - date = new Date(date); + let date = new Date(date); date = new Intl.DateTimeFormat().format(date); return date; }; diff --git a/src/utils/hooks/useDebounce.js b/src/utils/hooks/useDebounce.js index 51e4b35..e49a343 100644 --- a/src/utils/hooks/useDebounce.js +++ b/src/utils/hooks/useDebounce.js @@ -1,4 +1,3 @@ - import { useEffect, useState } from "react"; // see https://github.com/tannerlinsley/react-query/issues/293 diff --git a/src/utils/hooks/useIntersecting.jsx b/src/utils/hooks/useIntersecting.jsx index ead5255..6d2056d 100644 --- a/src/utils/hooks/useIntersecting.jsx +++ b/src/utils/hooks/useIntersecting.jsx @@ -1,4 +1,3 @@ - import { useEffect, useMemo, useState } from "react"; const useIntersecting = (ref) => { @@ -9,13 +8,12 @@ const useIntersecting = (ref) => { new IntersectionObserver(([entry]) => setIntersecting(entry.isIntersecting), ), - [ref], ); useEffect(() => { observer.observe(ref.current); return () => observer.disconnect(); - }, []); + }); return isIntersecting; }; diff --git a/src/utils/hooks/useKeyPress.jsx b/src/utils/hooks/useKeyPress.jsx index 9f51e9a..961bba7 100644 --- a/src/utils/hooks/useKeyPress.jsx +++ b/src/utils/hooks/useKeyPress.jsx @@ -24,7 +24,7 @@ const useKeyPress = (targetKey) => { window.removeEventListener("keydown", downHandler); window.removeEventListener("keyup", upHandler); }; - }, []); // Empty array ensures that effect is only run on mount and unmount + }); // Empty array ensures that effect is only run on mount and unmount return keyPressed; }; diff --git a/src/utils/misc/konami.ts b/src/utils/misc/konami.ts index a9ce252..8f58381 100644 --- a/src/utils/misc/konami.ts +++ b/src/utils/misc/konami.ts @@ -2,25 +2,25 @@ import { useState } from "react"; import useKonami from "react-use-konami"; export const useKonamiEasterEgg = () => { - const [easterEgg, setEasterEgg] = useState(false); - const sixtyNine = () => { - setEasterEgg(true); - }; + const [easterEgg, setEasterEgg] = useState(false); + const sixtyNine = () => { + setEasterEgg(true); + }; - useKonami(sixtyNine, { - code: [ - "ArrowUp", - "ArrowUp", - "ArrowDown", - "ArrowDown", - "ArrowLeft", - "ArrowRight", - "ArrowLeft", - "ArrowRight", - "b", - "a", - ], - }); + useKonami(sixtyNine, { + code: [ + "ArrowUp", + "ArrowUp", + "ArrowDown", + "ArrowDown", + "ArrowLeft", + "ArrowRight", + "ArrowLeft", + "ArrowRight", + "b", + "a", + ], + }); - return [easterEgg, setEasterEgg] as const; + return [easterEgg, setEasterEgg] as const; }; diff --git a/src/utils/misc/relaunch.ts b/src/utils/misc/relaunch.ts index 2012783..944fd6c 100644 --- a/src/utils/misc/relaunch.ts +++ b/src/utils/misc/relaunch.ts @@ -1,8 +1,8 @@ import { relaunch } from "@tauri-apps/api/process"; export const handleRelaunch = async (_event: unknown, reason?: string) => { - if (reason && reason === "backdropClick") { - return; - } - await relaunch(); + if (reason && reason === "backdropClick") { + return; + } + await relaunch(); }; diff --git a/src/utils/storage/servers.ts b/src/utils/storage/servers.ts index 1576dbf..6177887 100644 --- a/src/utils/storage/servers.ts +++ b/src/utils/storage/servers.ts @@ -3,12 +3,12 @@ import { Store } from "tauri-plugin-store-api"; import { v4 as uuidv4 } from "uuid"; interface ServerInfo extends RecommendedServerInfo { - id: string; + id: string; } export interface ServerStore { - defaultServer: string | null; - servers: ServerInfo[]; + defaultServer: string | null; + servers: ServerInfo[]; } const store = new Store(".servers.dat"); @@ -17,71 +17,71 @@ const store = new Store(".servers.dat"); * Set server in .servers.dat */ export const setServer = async (serverId: string, serverInfo: ServerInfo) => { - const servers = await getAllServers(); - const newServers = servers.filter((server) => server.id !== serverId); + const servers = await getAllServers(); + const newServers = servers.filter((server) => server.id !== serverId); - newServers.push({ - ...serverInfo, - id: serverId, - }); + newServers.push({ + ...serverInfo, + id: serverId, + }); - await store.set("servers", newServers); - await store.save(); + await store.set("servers", newServers); + await store.save(); }; /** * Set default server */ export const setDefaultServer = async ( - serverId: ServerStore["defaultServer"] + serverId: ServerStore["defaultServer"], ) => { - await store.set("defaultServer", serverId); - await store.save(); + await store.set("defaultServer", serverId); + await store.save(); }; /** * Get a Server */ export const getServer = async (serverId: string) => { - const servers = await getAllServers(); + const servers = await getAllServers(); - return servers.find((server) => server.id === serverId); + return servers.find((server) => server.id === serverId); }; /** * Get all Servers */ export const getAllServers = async () => { - const servers = (await store.get("servers")) || []; + const servers = (await store.get("servers")) || []; - return servers; + return servers; }; /** * Get default server */ export const getDefaultServer = () => { - return store.get("defaultServer"); + return store.get("defaultServer"); }; /** * Delete the given server from client storage */ export const delServer = async (serverId: string) => { - const servers = await getAllServers(); + const servers = await getAllServers(); - const newServers = servers.filter((server) => server.id !== serverId); + const newServers = servers.filter((server) => server.id !== serverId); - await store.set("servers", newServers); - await store.save(); + await store.set("servers", newServers); + await store.save(); }; /** * Delete the all servers from client storage */ export const delAllServer = async () => { - await store.clear(); - // remove the default server - await setDefaultServer(null); - await store.save(); + await store.clear(); + // remove the default server + await setDefaultServer(null); + await store.save(); }; diff --git a/src/utils/store/api.ts b/src/utils/store/api.ts index b4acaac..e840dd3 100644 --- a/src/utils/store/api.ts +++ b/src/utils/store/api.ts @@ -8,48 +8,48 @@ import axiosTauriApiAdapter from "axios-tauri-api-adapter"; import { v4 as uuidv4 } from "uuid"; export const axiosClient = axios.create({ - adapter: axiosTauriApiAdapter, - headers: { - "Access-Control-Allow-Origin": "*", - }, - timeout: 60000, + adapter: axiosTauriApiAdapter, + headers: { + "Access-Control-Allow-Origin": "*", + }, + timeout: 60000, }); let deviceId = localStorage.getItem("deviceId"); if (!deviceId) { - const randomId = uuidv4(); - localStorage.setItem("deviceId", randomId); + const randomId = uuidv4(); + localStorage.setItem("deviceId", randomId); - deviceId = randomId; + deviceId = randomId; } const jellyfin = new Jellyfin({ - clientInfo: { - name: "JellyPlayer", - version: appVer, - }, - deviceInfo: { - name: "JellyPlayer", - id: deviceId!, - }, + clientInfo: { + name: "JellyPlayer", + version: appVer, + }, + deviceInfo: { + name: "JellyPlayer", + id: deviceId!, + }, }); export const useApi = create<{ - api: Api | null; - deviceId: string | null; - jellyfin: Jellyfin; + api: Api | null; + deviceId: string | null; + jellyfin: Jellyfin; }>(() => ({ - api: null, - deviceId: deviceId, - jellyfin: jellyfin, + api: null, + deviceId: deviceId, + jellyfin: jellyfin, })); export const createApi = ( - serverAddress: string, - accessToken: string | undefined + serverAddress: string, + accessToken: string | undefined, ) => - useApi.setState((state) => ({ - ...state, - api: jellyfin.createApi(serverAddress, accessToken, axiosClient), - })); + useApi.setState((state) => ({ + ...state, + api: jellyfin.createApi(serverAddress, accessToken, axiosClient), + })); diff --git a/src/utils/store/audioPlayback.js b/src/utils/store/audioPlayback.js index 979b144..dab9f44 100644 --- a/src/utils/store/audioPlayback.js +++ b/src/utils/store/audioPlayback.js @@ -1,4 +1,3 @@ - import { create } from "zustand"; const initialState = { diff --git a/src/utils/store/backdrop.js b/src/utils/store/backdrop.js index c19c833..682ec25 100644 --- a/src/utils/store/backdrop.js +++ b/src/utils/store/backdrop.js @@ -1,4 +1,3 @@ - import { create } from "zustand"; export const useBackdropStore = create((set) => ({ diff --git a/src/utils/store/carousel.js b/src/utils/store/carousel.js index bb22b3e..b70b26b 100644 --- a/src/utils/store/carousel.js +++ b/src/utils/store/carousel.js @@ -1,4 +1,3 @@ - import { create } from "zustand"; export const useCarouselStore = create((set) => ({ diff --git a/src/utils/store/central.js b/src/utils/store/central.js index 046c037..9a98283 100644 --- a/src/utils/store/central.js +++ b/src/utils/store/central.js @@ -1,4 +1,3 @@ - import { create } from "zustand"; import { version } from "../../../package.json"; import { getAllServers, getDefaultServer, getServer } from "../storage/servers"; diff --git a/src/utils/store/drawer.js b/src/utils/store/drawer.js index 7c8d29e..931ab17 100644 --- a/src/utils/store/drawer.js +++ b/src/utils/store/drawer.js @@ -1,4 +1,3 @@ - import { create } from "zustand"; export const useDrawerStore = create((set) => ({ diff --git a/src/utils/store/playback.js b/src/utils/store/playback.js index ab744dd..77f321d 100644 --- a/src/utils/store/playback.js +++ b/src/utils/store/playback.js @@ -1,4 +1,3 @@ - import { create } from "zustand"; export const usePlaybackStore = create((set) => ({ diff --git a/src/utils/store/server.js b/src/utils/store/server.js index 20ba0ac..9e76ef8 100644 --- a/src/utils/store/server.js +++ b/src/utils/store/server.js @@ -1,4 +1,3 @@ - import { create } from "zustand"; export const useServerStore = create(() => ({