Fix library page not displaying all items #183 #182

This commit is contained in:
Prayag Prajapati committed 2023-09-30 19:11:39 +05:30
1 parent 3d75c08979
commit 52faaef201
16 files changed
+1569 -558

No files matched your search

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