16 files changed
+1569
-558
No files matched your search
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es2021": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:react/recommended"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": "latest",
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
"react"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"no-mixed-spaces-and-tabs": "off",
|
||||||
|
"react/prop-types": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
+9
-7
@@ -4,24 +4,24 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preinstall": "npx only-allow pnpm",
|
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"tauri": "tauri"
|
"tauri": "tauri",
|
||||||
|
"lint": "eslint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.11.1",
|
"@emotion/react": "^11.11.1",
|
||||||
"@emotion/styled": "^11.11.0",
|
"@emotion/styled": "^11.11.0",
|
||||||
"@fontsource/noto-sans": "^5.0.12",
|
"@fontsource/noto-sans": "^5.0.12",
|
||||||
"@jellyfin/sdk": "^0.8.2",
|
"@jellyfin/sdk": "0.8.2",
|
||||||
"@mdi/js": "^7.2.96",
|
"@mdi/js": "^7.2.96",
|
||||||
"@mui/lab": "5.0.0-alpha.146",
|
"@mui/lab": "5.0.0-alpha.146",
|
||||||
"@mui/material": "^5.14.10",
|
"@mui/material": "^5.14.11",
|
||||||
"@tanstack/react-query": "^4.35.3",
|
"@tanstack/react-query": "^4.35.3",
|
||||||
"@tanstack/react-query-devtools": "^4.35.3",
|
"@tanstack/react-query-devtools": "^4.35.3",
|
||||||
"@tauri-apps/api": "^1.4.0",
|
"@tauri-apps/api": "^1.5.0",
|
||||||
"axios": "^1.5.0",
|
"axios": "^1.5.1",
|
||||||
"axios-tauri-api-adapter": "^0.2.0",
|
"axios-tauri-api-adapter": "^0.2.0",
|
||||||
"blurhash": "^2.0.5",
|
"blurhash": "^2.0.5",
|
||||||
"events": "^3.3.0",
|
"events": "^3.3.0",
|
||||||
@@ -43,8 +43,10 @@
|
|||||||
"zustand": "^4.4.1"
|
"zustand": "^4.4.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tauri-apps/cli": "^1.4.0",
|
"@tauri-apps/cli": "^1.5.0",
|
||||||
"@vitejs/plugin-react": "^4.1.0",
|
"@vitejs/plugin-react": "^4.1.0",
|
||||||
|
"eslint": "^8.50.0",
|
||||||
|
"eslint-plugin-react": "^7.33.2",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"sass": "^1.68.0",
|
"sass": "^1.68.0",
|
||||||
"vite": "^4.4.9",
|
"vite": "^4.4.9",
|
||||||
|
|||||||
Generated
+1318
-189
File diff suppressed because it is too large.
Load diff
+3
-11
@@ -76,21 +76,14 @@ import "@fontsource/noto-sans/900.css";
|
|||||||
import "@fontsource/noto-sans/900-italic.css";
|
import "@fontsource/noto-sans/900-italic.css";
|
||||||
|
|
||||||
// Jellyfin SDK TypeScript
|
// Jellyfin SDK TypeScript
|
||||||
import {
|
import { Jellyfin } from "@jellyfin/sdk";
|
||||||
Jellyfin,
|
|
||||||
VersionOutdatedIssue,
|
|
||||||
VersionUnsupportedIssue,
|
|
||||||
} from "@jellyfin/sdk";
|
|
||||||
import { version as appVer } from "../package.json";
|
import { version as appVer } from "../package.json";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
import { v4 as uuidv4 } from "uuid";
|
||||||
import { delServer, getServer } from "./utils/storage/servers.js";
|
import { delServer, getServer } from "./utils/storage/servers.js";
|
||||||
import { delUser, getUser } from "./utils/storage/user.js";
|
import { delUser, getUser } from "./utils/storage/user.js";
|
||||||
|
|
||||||
import { useBackdropStore } from "./utils/store/backdrop.js";
|
import { useBackdropStore } from "./utils/store/backdrop.js";
|
||||||
import {
|
import { usePlaybackDataLoadStore } from "./utils/store/playback.js";
|
||||||
usePlaybackDataLoadStore,
|
|
||||||
usePlaybackStore,
|
|
||||||
} from "./utils/store/playback.js";
|
|
||||||
import BoxSetTitlePage from "./routes/boxset/index.jsx";
|
import BoxSetTitlePage from "./routes/boxset/index.jsx";
|
||||||
import PersonTitlePage from "./routes/person/index.jsx";
|
import PersonTitlePage from "./routes/person/index.jsx";
|
||||||
import MusicAlbumTitlePage from "./routes/album/index.jsx";
|
import MusicAlbumTitlePage from "./routes/album/index.jsx";
|
||||||
@@ -239,7 +232,7 @@ function App() {
|
|||||||
|
|
||||||
const userLogin = async () => {
|
const userLogin = async () => {
|
||||||
const user = await getUser();
|
const user = await getUser();
|
||||||
const auth = await api.authenticateUserByName(
|
const auth = await window.api.authenticateUserByName(
|
||||||
user.Name,
|
user.Name,
|
||||||
user.Password,
|
user.Password,
|
||||||
);
|
);
|
||||||
@@ -382,7 +375,6 @@ function App() {
|
|||||||
height="315"
|
height="315"
|
||||||
src="https://www.youtube.com/embed/dQw4w9WgXcQ?autoplay=1&disablekb=1"
|
src="https://www.youtube.com/embed/dQw4w9WgXcQ?autoplay=1&disablekb=1"
|
||||||
title="EasterEgg"
|
title="EasterEgg"
|
||||||
frameborder="0"
|
|
||||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||||
></iframe>
|
></iframe>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ const PlayButton = ({
|
|||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
onSuccess: (item) => {
|
onSuccess: (item) => {
|
||||||
if (audio) {
|
if (!!trackIndex) {
|
||||||
setCurrentTrack(trackIndex);
|
setCurrentTrack(trackIndex);
|
||||||
setAudioTracks(item.Items);
|
setAudioTracks(item.Items);
|
||||||
setAudioUrl(
|
setAudioUrl(
|
||||||
@@ -151,6 +151,13 @@ const PlayButton = ({
|
|||||||
setAudioItem(item.Items[trackIndex]);
|
setAudioItem(item.Items[trackIndex]);
|
||||||
setPlaylistItemId(playlistItemId);
|
setPlaylistItemId(playlistItemId);
|
||||||
setAudioDisplay(true);
|
setAudioDisplay(true);
|
||||||
|
} else if (audio) {
|
||||||
|
setAudioTracks(item.Items);
|
||||||
|
setAudioUrl(
|
||||||
|
`${window.api.basePath}/Audio/${item.Items[0].Id}/universal?deviceId=${window.api.deviceInfo.id}&userId=${userId}&api_key=${window.api.accessToken}`,
|
||||||
|
);
|
||||||
|
setAudioItem(item.Items[0]);
|
||||||
|
setAudioDisplay(true);
|
||||||
} else {
|
} else {
|
||||||
setUrl(
|
setUrl(
|
||||||
`${window.api.basePath}/Videos/${item.Items[0].Id}/stream.
|
`${window.api.basePath}/Videos/${item.Items[0].Id}/stream.
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 1em;
|
bottom: 1em;
|
||||||
width: calc(100vw - 2em);
|
width: calc(100vw - 8em);
|
||||||
left: 1em;
|
left: 1em;
|
||||||
right: 1em;
|
right: 1em;
|
||||||
gap: 1em;
|
gap: 1em;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { AnimatePresence, motion } from "framer-motion";
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
|
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
@@ -96,34 +96,17 @@ const Carousel = ({ content, onChange }) => {
|
|||||||
<MdiChevronRight />
|
<MdiChevronRight />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<div className="carousel-indicator-container">
|
<div className="carousel-indicator-container">
|
||||||
<div
|
|
||||||
className={
|
|
||||||
currentSlide == 0
|
|
||||||
? "carousel-indicator active"
|
|
||||||
: "carousel-indicator"
|
|
||||||
}
|
|
||||||
style={{
|
|
||||||
background:
|
|
||||||
currentSlide == 0
|
|
||||||
? "white"
|
|
||||||
: "rgb(255 255 255 / 0.5)",
|
|
||||||
}}
|
|
||||||
onClick={() => {
|
|
||||||
setDirection("left");
|
|
||||||
setCurrentSlide(0);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
{content.map((item, index) => (
|
{content.map((item, index) => (
|
||||||
<div
|
<div
|
||||||
className={
|
className={
|
||||||
currentSlide == index + 1
|
currentSlide == index
|
||||||
? "carousel-indicator active"
|
? "carousel-indicator active"
|
||||||
: "carousel-indicator"
|
: "carousel-indicator"
|
||||||
}
|
}
|
||||||
key={index}
|
key={index}
|
||||||
style={{
|
style={{
|
||||||
background:
|
background:
|
||||||
currentSlide == index + 1
|
currentSlide == index
|
||||||
? "white"
|
? "white"
|
||||||
: "rgb(255 255 255 / 0.5)",
|
: "rgb(255 255 255 / 0.5)",
|
||||||
}}
|
}}
|
||||||
@@ -133,7 +116,7 @@ const Carousel = ({ content, onChange }) => {
|
|||||||
} else if (currentSlide <= index) {
|
} else if (currentSlide <= index) {
|
||||||
setDirection("right");
|
setDirection("right");
|
||||||
}
|
}
|
||||||
setCurrentSlide(index + 1);
|
setCurrentSlide(index);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class ErrorBoundary extends React.Component {
|
|||||||
// in ErrorBoundary (created by App)
|
// in ErrorBoundary (created by App)
|
||||||
// in div (created by App)
|
// in div (created by App)
|
||||||
// in App
|
// in App
|
||||||
logErrorToMyService(error, info.componentStack);
|
console.error(`Err in ${info} - ${error}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
@@ -370,6 +370,10 @@ const Hero = ({
|
|||||||
}}
|
}}
|
||||||
itemUserData={item.UserData}
|
itemUserData={item.UserData}
|
||||||
audio={audioPlayButton}
|
audio={audioPlayButton}
|
||||||
|
playlistItemId={
|
||||||
|
item.Type == BaseItemKind.Playlist &&
|
||||||
|
item.Id
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!disableLikeButton && (
|
{!disableLikeButton && (
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
import React from "react";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import "./musicTrack.module.scss";
|
import "./musicTrack.module.scss";
|
||||||
import { getRuntimeMusic } from "../../utils/date/time";
|
import { getRuntimeMusic } from "../../utils/date/time";
|
||||||
@@ -6,6 +7,7 @@ import LikeButton from "../buttons/likeButton";
|
|||||||
import TextLink from "../textLink";
|
import TextLink from "../textLink";
|
||||||
import PlayButton from "../buttons/playButton";
|
import PlayButton from "../buttons/playButton";
|
||||||
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
||||||
|
import { MdiMusic } from "../icons/mdiMusic";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Props
|
* @typedef {Object} Props
|
||||||
@@ -37,6 +39,14 @@ const MusicTrack = ({
|
|||||||
return (
|
return (
|
||||||
<div className={`music-track ${className}`}>
|
<div className={`music-track ${className}`}>
|
||||||
<div className="music-track-image">
|
<div className="music-track-image">
|
||||||
|
<div className="music-track-icon">
|
||||||
|
<MdiMusic
|
||||||
|
sx={{
|
||||||
|
fontSize: "2em !important",
|
||||||
|
fill: "url(#clr-gradient-default) !important",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<img
|
<img
|
||||||
src={window.api.getItemImageUrl(
|
src={window.api.getItemImageUrl(
|
||||||
Object.keys(item.ImageTags).length == 0
|
Object.keys(item.ImageTags).length == 0
|
||||||
@@ -93,13 +103,14 @@ const MusicTrack = ({
|
|||||||
{item.ArtistItems.map((artist, index) => (
|
{item.ArtistItems.map((artist, index) => (
|
||||||
<>
|
<>
|
||||||
<TextLink
|
<TextLink
|
||||||
text={artist.Name}
|
|
||||||
variant={"subtitle2"}
|
variant={"subtitle2"}
|
||||||
location={`/artist/${artist.Id}`}
|
location={`/artist/${artist.Id}`}
|
||||||
otherProps={{
|
otherProps={{
|
||||||
fontWeight: 400,
|
fontWeight: 400,
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
{artist.Name}
|
||||||
|
</TextLink>
|
||||||
{index != item.ArtistItems.length - 1 && (
|
{index != item.ArtistItems.length - 1 && (
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
@@ -7,12 +7,25 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-items: center;
|
justify-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
&-icon {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: rgb(255 255 255 / 0.09);
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
&-image {
|
&-image {
|
||||||
margin: 0.4em;
|
margin: 0.4em;
|
||||||
border-radius: $border-radius-default;
|
border-radius: $border-radius-default;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
width: 4em;
|
||||||
&-overlay {
|
&-overlay {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -27,7 +40,7 @@
|
|||||||
transition: opacity $transition-time-fast;
|
transition: opacity $transition-time-fast;
|
||||||
}
|
}
|
||||||
box-shadow: 0 0 10px rgb(0 0 0 / 0.2);
|
box-shadow: 0 0 10px rgb(0 0 0 / 0.2);
|
||||||
transition: opacity $transition-time-fast;
|
transition: opacity $transition-time-default;
|
||||||
}
|
}
|
||||||
&-info {
|
&-info {
|
||||||
justify-self: start;
|
justify-self: start;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
@@ -358,7 +358,7 @@ const ArtistTitlePage = () => {
|
|||||||
>
|
>
|
||||||
{artistAppearances.isSuccess &&
|
{artistAppearances.isSuccess &&
|
||||||
artistAppearances.data.Items.map(
|
artistAppearances.data.Items.map(
|
||||||
(tabitem, aindex) => {
|
(tabitem) => {
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
key={
|
key={
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
import { useState } from "react";
|
import React, { useState } from "react";
|
||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
@@ -33,6 +33,7 @@ import CarouselSlide from "../../components/carouselSlide";
|
|||||||
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
|
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
|
||||||
import ErrorBoundary from "../../components/errorBoundary";
|
import ErrorBoundary from "../../components/errorBoundary";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
|
import CarouselSlideError from "../../components/errors/carousel";
|
||||||
|
|
||||||
const Home = () => {
|
const Home = () => {
|
||||||
const authUser = useQuery({
|
const authUser = useQuery({
|
||||||
@@ -216,13 +217,7 @@ const Home = () => {
|
|||||||
position: "relative",
|
position: "relative",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ErrorBoundary
|
<ErrorBoundary fallback={<CarouselSlideError />}>
|
||||||
fallback={
|
|
||||||
<div className="error">
|
|
||||||
<Typography>Error with Carousel</Typography>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{latestMedia.isLoading ? (
|
{latestMedia.isLoading ? (
|
||||||
<CarouselSkeleton />
|
<CarouselSkeleton />
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
+132
-280
@@ -1,7 +1,7 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useState, useMemo } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
import { useParams, useNavigate } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
@@ -19,18 +19,12 @@ import Accordion from "@mui/material/Accordion";
|
|||||||
import AccordionSummary from "@mui/material/AccordionSummary";
|
import AccordionSummary from "@mui/material/AccordionSummary";
|
||||||
import AccordionDetails from "@mui/material/AccordionDetails";
|
import AccordionDetails from "@mui/material/AccordionDetails";
|
||||||
import Button from "@mui/material/Button";
|
import Button from "@mui/material/Button";
|
||||||
import Table from "@mui/material/Table";
|
|
||||||
import TableBody from "@mui/material/TableBody";
|
|
||||||
import TableContainer from "@mui/material/TableContainer";
|
|
||||||
import TableRow from "@mui/material/TableRow";
|
|
||||||
import TableCell from "@mui/material/TableCell";
|
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import Pagination from "@mui/material/Pagination";
|
import Pagination from "@mui/material/Pagination";
|
||||||
import Popper from "@mui/material/Popper";
|
import Popper from "@mui/material/Popper";
|
||||||
import Grow from "@mui/material/Grow";
|
import Grow from "@mui/material/Grow";
|
||||||
|
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
|
||||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||||
import { getArtistsApi } from "@jellyfin/sdk/lib/utils/api/artists-api";
|
import { getArtistsApi } from "@jellyfin/sdk/lib/utils/api/artists-api";
|
||||||
import { getGenresApi } from "@jellyfin/sdk/lib/utils/api/genres-api";
|
import { getGenresApi } from "@jellyfin/sdk/lib/utils/api/genres-api";
|
||||||
@@ -53,19 +47,14 @@ import {
|
|||||||
ItemFields,
|
ItemFields,
|
||||||
SortOrder,
|
SortOrder,
|
||||||
} from "@jellyfin/sdk/lib/generated-client";
|
} from "@jellyfin/sdk/lib/generated-client";
|
||||||
import { getRuntimeMusic } from "../../utils/date/time";
|
import MusicTrack from "../../components/musicTrack";
|
||||||
|
|
||||||
import "./library.module.scss";
|
|
||||||
import { MdiMusic } from "../../components/icons/mdiMusic";
|
|
||||||
import { MdiHeart } from "../../components/icons/mdiHeart";
|
|
||||||
import { MdiHeartOutline } from "../../components/icons/mdiHeartOutline";
|
|
||||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
|
|
||||||
const LibraryView = () => {
|
import "./library.module.scss";
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
|
const LibraryView = () => {
|
||||||
const [page, setPage] = useState(1);
|
const [page, setPage] = useState(1);
|
||||||
const maxDisplayItems = 50;
|
const maxDisplayItems = 100;
|
||||||
|
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
|
||||||
@@ -121,46 +110,12 @@ const LibraryView = () => {
|
|||||||
const [hasSpecialFeature, setHasSpecialFeature] = useState(false);
|
const [hasSpecialFeature, setHasSpecialFeature] = useState(false);
|
||||||
const [hasThemeSong, setHasThemeSong] = useState(false);
|
const [hasThemeSong, setHasThemeSong] = useState(false);
|
||||||
const [hasThemeVideo, setHasThemeVideo] = useState(false);
|
const [hasThemeVideo, setHasThemeVideo] = useState(false);
|
||||||
const availableFeatureFilters = [
|
|
||||||
{
|
|
||||||
title: "Subtitles",
|
|
||||||
value: false,
|
|
||||||
state: (val) => setHasSubtitles(val),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Trailer",
|
|
||||||
value: false,
|
|
||||||
state: (val) => setHasTrailer(val),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Special Feature",
|
|
||||||
value: false,
|
|
||||||
state: (val) => setHasSpecialFeature(val),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Theme Song",
|
|
||||||
value: false,
|
|
||||||
state: (val) => setHasThemeSong(val),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Theme Video",
|
|
||||||
vslue: false,
|
|
||||||
state: (val) => setHasThemeVideo(val),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const [isBluRay, setIsBluRay] = useState(false);
|
const [isBluRay, setIsBluRay] = useState(false);
|
||||||
const [isDVD, setIsDVD] = useState(false);
|
const [isDVD, setIsDVD] = useState(false);
|
||||||
const [isHD, setIsHD] = useState(false);
|
const [isHD, setIsHD] = useState(false);
|
||||||
const [is4K, setIs4K] = useState(false);
|
const [is4K, setIs4K] = useState(false);
|
||||||
const [is3D, setIs3D] = useState(false);
|
const [is3D, setIs3D] = useState(false);
|
||||||
const availableVideoTypeFilters = [
|
|
||||||
{ title: "Blu-Ray", value: false, state: (val) => setIsBluRay(val) },
|
|
||||||
{ title: "DVD", value: false, state: (val) => setIsDVD(val) },
|
|
||||||
{ title: "HD", value: false, state: (val) => setIsHD(val) },
|
|
||||||
{ title: "4K", value: false, state: (val) => setIs4K(val) },
|
|
||||||
{ title: "3D", value: false, state: (val) => setIs3D(val) },
|
|
||||||
];
|
|
||||||
|
|
||||||
const [currentViewType, setCurrentViewType] = useState("");
|
const [currentViewType, setCurrentViewType] = useState("");
|
||||||
|
|
||||||
@@ -169,7 +124,7 @@ const LibraryView = () => {
|
|||||||
*/
|
*/
|
||||||
const [viewType, setViewType] = useState([]);
|
const [viewType, setViewType] = useState([]);
|
||||||
|
|
||||||
useMemo(() => {
|
useEffect(() => {
|
||||||
if (currentLib.isSuccess) {
|
if (currentLib.isSuccess) {
|
||||||
if (currentLib.data.Items[0].CollectionType == "movies") {
|
if (currentLib.data.Items[0].CollectionType == "movies") {
|
||||||
setCurrentViewType(BaseItemKind.Movie);
|
setCurrentViewType(BaseItemKind.Movie);
|
||||||
@@ -269,81 +224,6 @@ const LibraryView = () => {
|
|||||||
|
|
||||||
const [videoTypes, setVideoTypes] = useState([]);
|
const [videoTypes, setVideoTypes] = useState([]);
|
||||||
|
|
||||||
const fetchLibItems = async (libraryId) => {
|
|
||||||
let result;
|
|
||||||
if (currentViewType == "MusicArtist") {
|
|
||||||
result = await getArtistsApi(window.api).getAlbumArtists({
|
|
||||||
userId: user.data.Id,
|
|
||||||
parentId: libraryId,
|
|
||||||
startIndex: maxDisplayItems * (page - 1),
|
|
||||||
limit: maxDisplayItems,
|
|
||||||
});
|
|
||||||
} else if (currentViewType == "Person") {
|
|
||||||
result = await getPersonsApi(window.api).getPersons({
|
|
||||||
userId: user.data.Id,
|
|
||||||
personTypes: ["Actor"],
|
|
||||||
startIndex: maxDisplayItems * (page - 1),
|
|
||||||
limit: maxDisplayItems,
|
|
||||||
});
|
|
||||||
} else if (currentViewType == "Genre") {
|
|
||||||
result = await getGenresApi(window.api).getGenres({
|
|
||||||
userId: user.data.Id,
|
|
||||||
parentId: libraryId,
|
|
||||||
startIndex: maxDisplayItems * (page - 1),
|
|
||||||
limit: maxDisplayItems,
|
|
||||||
});
|
|
||||||
} else if (currentViewType == "MusicGenre") {
|
|
||||||
result = await getMusicGenresApi(window.api).getMusicGenres({
|
|
||||||
userId: user.data.Id,
|
|
||||||
parentId: libraryId,
|
|
||||||
startIndex: maxDisplayItems * (page - 1),
|
|
||||||
limit: maxDisplayItems,
|
|
||||||
});
|
|
||||||
} else if (currentViewType == "Studio") {
|
|
||||||
result = await getStudiosApi(window.api).getStudios({
|
|
||||||
userId: user.data.Id,
|
|
||||||
parentId: libraryId,
|
|
||||||
startIndex: maxDisplayItems * (page - 1),
|
|
||||||
limit: maxDisplayItems,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
result = await getItemsApi(window.api).getItems({
|
|
||||||
userId: user.data.Id,
|
|
||||||
parentId: libraryId,
|
|
||||||
recursive:
|
|
||||||
currentLib.data.Items[0].CollectionType ===
|
|
||||||
"homevideos" ||
|
|
||||||
currentLib.data.Items[0].Type === "Folder" ||
|
|
||||||
currentLib.data.Items[0].Type === "CollectionFolder" ||
|
|
||||||
(currentLib.data.Items[0].Type != "boxsets" &&
|
|
||||||
!("CollectionType" in currentLib.data.Items[0]))
|
|
||||||
? undefined
|
|
||||||
: true,
|
|
||||||
includeItemTypes: [currentViewType],
|
|
||||||
sortOrder: [
|
|
||||||
sortAscending
|
|
||||||
? SortOrder.Ascending
|
|
||||||
: SortOrder.Descending,
|
|
||||||
],
|
|
||||||
sortBy: sortBy,
|
|
||||||
filters: filterArray,
|
|
||||||
hasSubtitles: hasSubtitles ? true : undefined,
|
|
||||||
hasTrailer: hasTrailer ? true : undefined,
|
|
||||||
hasSpecialFeature: hasSpecialFeature ? true : undefined,
|
|
||||||
hasThemeSong: hasThemeSong ? true : undefined,
|
|
||||||
hasThemeVideo: hasThemeVideo ? true : undefined,
|
|
||||||
videoTypes: videoTypes,
|
|
||||||
isHd: isHD ? true : undefined,
|
|
||||||
is4K: is4K ? true : undefined,
|
|
||||||
is3D: is3D ? true : undefined,
|
|
||||||
startIndex: maxDisplayItems * (page - 1),
|
|
||||||
limit: maxDisplayItems,
|
|
||||||
fields: ["UserData"],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return result.data;
|
|
||||||
};
|
|
||||||
|
|
||||||
const items = useQuery({
|
const items = useQuery({
|
||||||
queryKey: [
|
queryKey: [
|
||||||
"libraryView",
|
"libraryView",
|
||||||
@@ -371,8 +251,81 @@ const LibraryView = () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
queryFn: () => fetchLibItems(id),
|
queryFn: async () => {
|
||||||
enabled: Boolean(currentViewType),
|
let result;
|
||||||
|
if (currentViewType == "MusicArtist") {
|
||||||
|
result = await getArtistsApi(window.api).getAlbumArtists({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: id,
|
||||||
|
startIndex: maxDisplayItems * (page - 1),
|
||||||
|
limit: maxDisplayItems,
|
||||||
|
});
|
||||||
|
} else if (currentViewType == "Person") {
|
||||||
|
result = await getPersonsApi(window.api).getPersons({
|
||||||
|
userId: user.data.Id,
|
||||||
|
personTypes: ["Actor"],
|
||||||
|
startIndex: maxDisplayItems * (page - 1),
|
||||||
|
limit: maxDisplayItems,
|
||||||
|
});
|
||||||
|
} else if (currentViewType == "Genre") {
|
||||||
|
result = await getGenresApi(window.api).getGenres({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: id,
|
||||||
|
startIndex: maxDisplayItems * (page - 1),
|
||||||
|
limit: maxDisplayItems,
|
||||||
|
});
|
||||||
|
} else if (currentViewType == "MusicGenre") {
|
||||||
|
result = await getMusicGenresApi(window.api).getMusicGenres(
|
||||||
|
{
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: id,
|
||||||
|
startIndex: maxDisplayItems * (page - 1),
|
||||||
|
limit: maxDisplayItems,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else if (currentViewType == "Studio") {
|
||||||
|
result = await getStudiosApi(window.api).getStudios({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: id,
|
||||||
|
startIndex: maxDisplayItems * (page - 1),
|
||||||
|
limit: maxDisplayItems,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
result = await getItemsApi(window.api).getItems({
|
||||||
|
userId: user.data.Id,
|
||||||
|
parentId: currentLib.data.Items[0].Id,
|
||||||
|
recursive:
|
||||||
|
currentLib.data.Items[0].CollectionType ==
|
||||||
|
"boxsets"
|
||||||
|
? undefined
|
||||||
|
: true,
|
||||||
|
includeItemTypes: [currentViewType],
|
||||||
|
sortOrder: [
|
||||||
|
sortAscending
|
||||||
|
? SortOrder.Ascending
|
||||||
|
: SortOrder.Descending,
|
||||||
|
],
|
||||||
|
sortBy: sortBy,
|
||||||
|
filters: filterArray,
|
||||||
|
hasSubtitles: hasSubtitles ? true : undefined,
|
||||||
|
hasTrailer: hasTrailer ? true : undefined,
|
||||||
|
hasSpecialFeature: hasSpecialFeature
|
||||||
|
? true
|
||||||
|
: undefined,
|
||||||
|
hasThemeSong: hasThemeSong ? true : undefined,
|
||||||
|
hasThemeVideo: hasThemeVideo ? true : undefined,
|
||||||
|
videoTypes: videoTypes,
|
||||||
|
isHd: isHD || undefined,
|
||||||
|
is4K: is4K || undefined,
|
||||||
|
is3D: is3D || undefined,
|
||||||
|
startIndex: maxDisplayItems * (page - 1),
|
||||||
|
limit: maxDisplayItems,
|
||||||
|
enableUserData: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return result.data;
|
||||||
|
},
|
||||||
|
enabled: user.isSuccess && Boolean(currentViewType),
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -389,29 +342,6 @@ const LibraryView = () => {
|
|||||||
const [filterButtonAnchorEl, setFilterButtonAnchorEl] = useState(null);
|
const [filterButtonAnchorEl, setFilterButtonAnchorEl] = useState(null);
|
||||||
const [filterMenuOpen, setFilterMenuOpen] = useState(false);
|
const [filterMenuOpen, setFilterMenuOpen] = useState(false);
|
||||||
|
|
||||||
const openFiltersMenu = (event) => {
|
|
||||||
setFilterButtonAnchorEl(event.currentTarget);
|
|
||||||
};
|
|
||||||
const closeFiltersMenu = () => {
|
|
||||||
setFilterButtonAnchorEl(null);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleLiking = async (item) => {
|
|
||||||
let result;
|
|
||||||
if (item.UserData.isFavorite) {
|
|
||||||
result = await getUserLibraryApi(window.api).unmarkFavoriteItem({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.Id,
|
|
||||||
});
|
|
||||||
} else if (!item.UserData.isFavorite) {
|
|
||||||
result = await getUserLibraryApi(window.api).markFavoriteItem({
|
|
||||||
userId: user.data.Id,
|
|
||||||
itemId: item.Id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
items.refetch();
|
|
||||||
};
|
|
||||||
|
|
||||||
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||||
|
|
||||||
useState(() => {
|
useState(() => {
|
||||||
@@ -483,7 +413,7 @@ const LibraryView = () => {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
|
|
||||||
<TextField
|
<TextField
|
||||||
disabled={!Boolean(sortBy)}
|
disabled={!sortBy}
|
||||||
select
|
select
|
||||||
value={sortBy}
|
value={sortBy}
|
||||||
onChange={handleSortBy}
|
onChange={handleSortBy}
|
||||||
@@ -510,9 +440,7 @@ const LibraryView = () => {
|
|||||||
orientation="vertical"
|
orientation="vertical"
|
||||||
/>
|
/>
|
||||||
<TextField
|
<TextField
|
||||||
disabled={
|
disabled={!currentViewType}
|
||||||
!Boolean(currentViewType)
|
|
||||||
}
|
|
||||||
select
|
select
|
||||||
value={currentViewType}
|
value={currentViewType}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
@@ -1345,7 +1273,7 @@ const LibraryView = () => {
|
|||||||
) : items.data.TotalRecordCount == 0 ? (
|
) : items.data.TotalRecordCount == 0 ? (
|
||||||
<EmptyNotice />
|
<EmptyNotice />
|
||||||
) : currentViewType == BaseItemKind.Genre ? (
|
) : currentViewType == BaseItemKind.Genre ? (
|
||||||
items.data.Items.map((item, index) => {
|
items.data.Items.map((item) => {
|
||||||
return (
|
return (
|
||||||
<GenreView
|
<GenreView
|
||||||
key={item.Id}
|
key={item.Id}
|
||||||
@@ -1358,7 +1286,7 @@ const LibraryView = () => {
|
|||||||
})
|
})
|
||||||
) : currentViewType != BaseItemKind.Audio ? (
|
) : currentViewType != BaseItemKind.Audio ? (
|
||||||
<div className="library-grid">
|
<div className="library-grid">
|
||||||
{items.data.Items.map((item, index) => {
|
{items.data.Items.map((item) => {
|
||||||
return (
|
return (
|
||||||
<motion.div
|
<motion.div
|
||||||
style={{
|
style={{
|
||||||
@@ -1400,7 +1328,7 @@ const LibraryView = () => {
|
|||||||
? `${
|
? `${
|
||||||
item.ProductionYear
|
item.ProductionYear
|
||||||
} - ${
|
} - ${
|
||||||
!!item.EndDate
|
item.EndDate
|
||||||
? new Date(
|
? new Date(
|
||||||
item.EndDate,
|
item.EndDate,
|
||||||
).toLocaleString(
|
).toLocaleString(
|
||||||
@@ -1493,127 +1421,51 @@ const LibraryView = () => {
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<TableContainer>
|
<div
|
||||||
<Table>
|
style={{
|
||||||
<TableBody>
|
display: "flex",
|
||||||
{items.data.Items.map((item, index) => {
|
flexDirection: "column",
|
||||||
return (
|
}}
|
||||||
<TableRow
|
>
|
||||||
component={motion.div}
|
{items.data.Items.map((item) => (
|
||||||
key={item.Id}
|
<MusicTrack
|
||||||
sx={{
|
item={item}
|
||||||
"& td,& th": {
|
key={item.Id}
|
||||||
borderBottom:
|
queryKey={[
|
||||||
"1px solid rgb(255 255 255 / 0.1)",
|
"libraryView",
|
||||||
},
|
"currentLibItems",
|
||||||
"&:last-child td, &:last-child th":
|
id,
|
||||||
{ border: 0 },
|
`page: ${page}`,
|
||||||
"&:hover": {
|
{
|
||||||
background:
|
currentViewType:
|
||||||
"rgb(255 255 255 / 0.05)",
|
currentViewType,
|
||||||
},
|
sortAscending: sortAscending,
|
||||||
}}
|
sortBy: sortBy,
|
||||||
initial={{
|
playbackFilters: filterArray,
|
||||||
transform:
|
extraFilters: {
|
||||||
"scale(0.8)",
|
hasSubtitles:
|
||||||
opacity: 0,
|
hasSubtitles,
|
||||||
}}
|
hasTrailer: hasTrailer,
|
||||||
animate={{
|
hasSpecialFeature:
|
||||||
transform:
|
hasSpecialFeature,
|
||||||
"scale(1)",
|
hasThemeSong:
|
||||||
opacity: 1,
|
hasThemeSong,
|
||||||
}}
|
hasThemeVideo:
|
||||||
transition={{
|
hasThemeVideo,
|
||||||
duration: 0.25,
|
},
|
||||||
ease: "easeInOut",
|
qualityFilters: {
|
||||||
delay: 0.02 * index,
|
isBluRay: isBluRay,
|
||||||
}}
|
isDVD: isDVD,
|
||||||
>
|
isHD: isHD,
|
||||||
<TableCell width="4.5em">
|
is4K: is4K,
|
||||||
<Box className="library-list-image-container">
|
is3D: is3D,
|
||||||
{!!item
|
},
|
||||||
.ImageTags
|
},
|
||||||
.Primary && (
|
]}
|
||||||
<img
|
userId={user.data.Id}
|
||||||
className="library-list-image"
|
/>
|
||||||
src={`${window.api.basePath}/Items/${item.Id}/Images/Primary?quality=80&tag=${item.ImageTags.Primary}`}
|
))}
|
||||||
/>
|
</div>
|
||||||
)}
|
|
||||||
<Box className="library-list-icon-container">
|
|
||||||
<MdiMusic className="library-list-icon" />
|
|
||||||
</Box>
|
|
||||||
</Box>
|
|
||||||
</TableCell>
|
|
||||||
<TableCell>
|
|
||||||
<Typography variant="h6">
|
|
||||||
{item.Name}
|
|
||||||
</Typography>
|
|
||||||
<Stack
|
|
||||||
direction="row"
|
|
||||||
divider={
|
|
||||||
<Typography
|
|
||||||
variant="subtitle1"
|
|
||||||
sx={{
|
|
||||||
opacity: 0.7,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
,
|
|
||||||
</Typography>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{item.Artists.map(
|
|
||||||
(
|
|
||||||
artist,
|
|
||||||
aindex,
|
|
||||||
) => {
|
|
||||||
return (
|
|
||||||
<Typography
|
|
||||||
variant="subtitle1"
|
|
||||||
sx={{
|
|
||||||
opacity: 0.7,
|
|
||||||
}}
|
|
||||||
key={
|
|
||||||
aindex
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
artist
|
|
||||||
}
|
|
||||||
</Typography>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)}
|
|
||||||
</Stack>
|
|
||||||
</TableCell>
|
|
||||||
<TableCell>
|
|
||||||
<Typography variant="subtitle1">
|
|
||||||
{getRuntimeMusic(
|
|
||||||
item.RunTimeTicks,
|
|
||||||
)}
|
|
||||||
</Typography>
|
|
||||||
</TableCell>
|
|
||||||
<TableCell width="1em">
|
|
||||||
<IconButton
|
|
||||||
onClick={() => {
|
|
||||||
handleLiking(
|
|
||||||
item,
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{item.UserData
|
|
||||||
.IsFavorite ? (
|
|
||||||
<MdiHeart />
|
|
||||||
) : (
|
|
||||||
<MdiHeartOutline />
|
|
||||||
)}
|
|
||||||
</IconButton>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</TableBody>
|
|
||||||
</Table>
|
|
||||||
</TableContainer>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{items.isSuccess &&
|
{items.isSuccess &&
|
||||||
|
|||||||
+36
-33
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
|
|
||||||
import TextField from "@mui/material/TextField";
|
import TextField from "@mui/material/TextField";
|
||||||
import CircularProgress from "@mui/material/CircularProgress";
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
@@ -226,8 +226,9 @@ const SearchPage = () => {
|
|||||||
displayCards={8}
|
displayCards={8}
|
||||||
disableDecoration
|
disableDecoration
|
||||||
>
|
>
|
||||||
{movies.data.Items.map((item, index) => (
|
{movies.data.Items.map((item) => (
|
||||||
<Card
|
<Card
|
||||||
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
cardTitle={item.Name}
|
cardTitle={item.Name}
|
||||||
imageType={"Primary"}
|
imageType={"Primary"}
|
||||||
@@ -261,6 +262,7 @@ const SearchPage = () => {
|
|||||||
>
|
>
|
||||||
{series.data.Items.map((item, index) => (
|
{series.data.Items.map((item, index) => (
|
||||||
<Card
|
<Card
|
||||||
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
cardTitle={item.Name}
|
cardTitle={item.Name}
|
||||||
imageType={"Primary"}
|
imageType={"Primary"}
|
||||||
@@ -304,6 +306,7 @@ const SearchPage = () => {
|
|||||||
>
|
>
|
||||||
{audio.data.Items.map((item, index) => (
|
{audio.data.Items.map((item, index) => (
|
||||||
<Card
|
<Card
|
||||||
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
cardTitle={item.Name}
|
cardTitle={item.Name}
|
||||||
imageType={"Primary"}
|
imageType={"Primary"}
|
||||||
@@ -338,6 +341,7 @@ const SearchPage = () => {
|
|||||||
>
|
>
|
||||||
{musicAlbum.data.Items.map((item, index) => (
|
{musicAlbum.data.Items.map((item, index) => (
|
||||||
<Card
|
<Card
|
||||||
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
seriesId={item.SeriesId}
|
seriesId={item.SeriesId}
|
||||||
cardTitle={item.Name}
|
cardTitle={item.Name}
|
||||||
@@ -373,6 +377,7 @@ const SearchPage = () => {
|
|||||||
>
|
>
|
||||||
{book.data.Items.map((item, index) => (
|
{book.data.Items.map((item, index) => (
|
||||||
<Card
|
<Card
|
||||||
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
cardTitle={item.Name}
|
cardTitle={item.Name}
|
||||||
imageType={"Primary"}
|
imageType={"Primary"}
|
||||||
@@ -406,36 +411,33 @@ const SearchPage = () => {
|
|||||||
displayCards={8}
|
displayCards={8}
|
||||||
disableDecoration
|
disableDecoration
|
||||||
>
|
>
|
||||||
{musicArtists.data.Items.map(
|
{musicArtists.data.Items.map((item) => (
|
||||||
(item, index) => (
|
<Card
|
||||||
<Card
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
cardTitle={item.Name}
|
cardTitle={item.Name}
|
||||||
imageType={"Primary"}
|
imageType={"Primary"}
|
||||||
disableOverlay
|
disableOverlay
|
||||||
cardType={"square"}
|
cardType={"square"}
|
||||||
queryKey={[
|
queryKey={[
|
||||||
"search",
|
"search",
|
||||||
"items",
|
"items",
|
||||||
"MusicArtists",
|
"MusicArtists",
|
||||||
searchParam,
|
searchParam,
|
||||||
]}
|
]}
|
||||||
userId={user.data.Id}
|
userId={user.data.Id}
|
||||||
imageBlurhash={
|
imageBlurhash={
|
||||||
!!item.ImageBlurHashes
|
!!item.ImageBlurHashes
|
||||||
?.Primary &&
|
?.Primary &&
|
||||||
item.ImageBlurHashes
|
item.ImageBlurHashes?.Primary[
|
||||||
?.Primary[
|
Object.keys(
|
||||||
Object.keys(
|
item.ImageBlurHashes
|
||||||
item
|
.Primary,
|
||||||
.ImageBlurHashes
|
)[0]
|
||||||
.Primary,
|
]
|
||||||
)[0]
|
}
|
||||||
]
|
/>
|
||||||
}
|
))}
|
||||||
/>
|
|
||||||
),
|
|
||||||
)}
|
|
||||||
</CardScroller>
|
</CardScroller>
|
||||||
)}
|
)}
|
||||||
{person.isSuccess && person.data.Items.length > 0 && (
|
{person.isSuccess && person.data.Items.length > 0 && (
|
||||||
@@ -444,8 +446,9 @@ const SearchPage = () => {
|
|||||||
displayCards={8}
|
displayCards={8}
|
||||||
disableDecoration
|
disableDecoration
|
||||||
>
|
>
|
||||||
{person.data.Items.map((item, index) => (
|
{person.data.Items.map((item) => (
|
||||||
<Card
|
<Card
|
||||||
|
key={item.Id}
|
||||||
item={item}
|
item={item}
|
||||||
cardTitle={item.Name}
|
cardTitle={item.Name}
|
||||||
imageType={"Primary"}
|
imageType={"Primary"}
|
||||||
|
|||||||
Reference in new issue
Block a user