Fix search not showing all item types #34
This commit is contained in:
2 files changed
+225
-210
No files matched your search
@@ -158,6 +158,8 @@ export const Card = ({
|
||||
: window.api.getItemImageUrl(
|
||||
!!seriesId
|
||||
? item.SeriesId
|
||||
: item.AlbumId
|
||||
? item.AlbumId
|
||||
: item.Id,
|
||||
imageType,
|
||||
{
|
||||
|
||||
+223
-210
@@ -34,81 +34,165 @@ const SearchPage = () => {
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const items = useQuery({
|
||||
queryKey: ["search", "items", searchParam],
|
||||
const itemLimit = 12;
|
||||
|
||||
const movies = useQuery({
|
||||
queryKey: ["search", "items", "Movie", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(window.api).getItemsByUserId({
|
||||
userId: user.data.Id,
|
||||
searchTerm: searchTerm,
|
||||
includeItemTypes: [
|
||||
BaseItemKind.Movie,
|
||||
BaseItemKind.Series,
|
||||
BaseItemKind.Audio,
|
||||
BaseItemKind.MusicAlbum,
|
||||
BaseItemKind.Book,
|
||||
BaseItemKind.MusicArtist,
|
||||
BaseItemKind.Person,
|
||||
],
|
||||
searchTerm,
|
||||
includeItemTypes: [BaseItemKind.Movie],
|
||||
recursive: true,
|
||||
limit: itemLimit,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess,
|
||||
enabled: user.isSuccess && Boolean(searchParam),
|
||||
cacheTime: 0,
|
||||
});
|
||||
const series = useQuery({
|
||||
queryKey: ["search", "items", "Series", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(window.api).getItemsByUserId({
|
||||
userId: user.data.Id,
|
||||
searchTerm,
|
||||
includeItemTypes: [BaseItemKind.Series],
|
||||
recursive: true,
|
||||
limit: itemLimit,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess && Boolean(searchParam),
|
||||
cacheTime: 0,
|
||||
});
|
||||
const musicAlbum = useQuery({
|
||||
queryKey: ["search", "items", "MusicAlbum", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(window.api).getItemsByUserId({
|
||||
userId: user.data.Id,
|
||||
searchTerm,
|
||||
includeItemTypes: [BaseItemKind.MusicAlbum],
|
||||
recursive: true,
|
||||
limit: itemLimit,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess && Boolean(searchParam),
|
||||
cacheTime: 0,
|
||||
});
|
||||
const audio = useQuery({
|
||||
queryKey: ["search", "items", "Audio", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(window.api).getItemsByUserId({
|
||||
userId: user.data.Id,
|
||||
searchTerm,
|
||||
includeItemTypes: [BaseItemKind.Audio],
|
||||
recursive: true,
|
||||
limit: itemLimit,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess && Boolean(searchParam),
|
||||
cacheTime: 0,
|
||||
});
|
||||
const book = useQuery({
|
||||
queryKey: ["search", "items", "Book", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(window.api).getItemsByUserId({
|
||||
userId: user.data.Id,
|
||||
searchTerm,
|
||||
includeItemTypes: [BaseItemKind.Book],
|
||||
recursive: true,
|
||||
limit: itemLimit,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess && Boolean(searchParam),
|
||||
cacheTime: 0,
|
||||
});
|
||||
const musicArtists = useQuery({
|
||||
queryKey: ["search", "items", "MusicArtist", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(window.api).getItemsByUserId({
|
||||
userId: user.data.Id,
|
||||
searchTerm,
|
||||
includeItemTypes: [BaseItemKind.MusicArtist],
|
||||
recursive: true,
|
||||
limit: itemLimit,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess && Boolean(searchParam),
|
||||
cacheTime: 0,
|
||||
});
|
||||
const person = useQuery({
|
||||
queryKey: ["search", "items", "Person", searchParam],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(window.api).getItemsByUserId({
|
||||
userId: user.data.Id,
|
||||
searchTerm,
|
||||
includeItemTypes: [BaseItemKind.Person],
|
||||
recursive: true,
|
||||
limit: itemLimit,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: user.isSuccess && Boolean(searchParam),
|
||||
cacheTime: 0,
|
||||
});
|
||||
|
||||
/**
|
||||
* @typedef {import("@jellyfin/sdk/lib/generated-client/models").BaseItemDto} BaseItemDto
|
||||
* @type {[BaseItemDto[], Function]}
|
||||
*/
|
||||
const [movies, setMovies] = useState([]);
|
||||
const [series, setSeries] = useState([]);
|
||||
const [audios, setAudios] = useState([]);
|
||||
const [musicAlbum, setMusicAlbum] = useState([]);
|
||||
const [books, setBooks] = useState([]);
|
||||
const [musicArtists, setMusicArtists] = useState([]);
|
||||
const [persons, setPersons] = useState([]);
|
||||
// const [movies, setMovies] = useState([]);
|
||||
// const [series, setSeries] = useState([]);
|
||||
// const [audios, setAudios] = useState([]);
|
||||
// const [musicAlbum, setMusicAlbum] = useState([]);
|
||||
// const [books, setBooks] = useState([]);
|
||||
// const [musicArtists, setMusicArtists] = useState([]);
|
||||
// const [persons, setPersons] = useState([]);
|
||||
|
||||
const itemLimit = 16;
|
||||
|
||||
useEffect(() => {
|
||||
if (items.isSuccess) {
|
||||
setMovies(
|
||||
items.data.Items.filter(
|
||||
(item) => item.Type == BaseItemKind.Movie,
|
||||
).slice(0, itemLimit),
|
||||
);
|
||||
setSeries(
|
||||
items.data.Items.filter(
|
||||
(item) => item.Type == BaseItemKind.Series,
|
||||
).slice(0, itemLimit),
|
||||
);
|
||||
setAudios(
|
||||
items.data.Items.filter(
|
||||
(item) => item.Type == BaseItemKind.Audio,
|
||||
).slice(0, itemLimit),
|
||||
);
|
||||
setMusicAlbum(
|
||||
items.data.Items.filter(
|
||||
(item) => item.Type == BaseItemKind.MusicAlbum,
|
||||
).slice(0, itemLimit),
|
||||
);
|
||||
setBooks(
|
||||
items.data.Items.filter(
|
||||
(item) => item.Type == BaseItemKind.Book,
|
||||
).slice(0, itemLimit),
|
||||
);
|
||||
setMusicArtists(
|
||||
items.data.Items.filter(
|
||||
(item) => item.Type == BaseItemKind.MusicArtist,
|
||||
).slice(0, itemLimit),
|
||||
);
|
||||
setPersons(
|
||||
items.data.Items.filter(
|
||||
(item) => item.Type == BaseItemKind.Person,
|
||||
).slice(0, itemLimit),
|
||||
);
|
||||
}
|
||||
}, [items.isSuccess]);
|
||||
// useEffect(() => {
|
||||
// if (items.isSuccess) {
|
||||
// setMovies(
|
||||
// items.data.Items.filter(
|
||||
// (item) => item.Type == BaseItemKind.Movie,
|
||||
// ).slice(0, itemLimit),
|
||||
// );
|
||||
// setSeries(
|
||||
// items.data.Items.filter(
|
||||
// (item) => item.Type == BaseItemKind.Series,
|
||||
// ).slice(0, itemLimit),
|
||||
// );
|
||||
// setAudios(
|
||||
// items.data.Items.filter(
|
||||
// (item) => item.Type == BaseItemKind.Audio,
|
||||
// ).slice(0, itemLimit),
|
||||
// );
|
||||
// setMusicAlbum(
|
||||
// items.data.Items.filter(
|
||||
// (item) => item.Type == BaseItemKind.MusicAlbum,
|
||||
// ).slice(0, itemLimit),
|
||||
// );
|
||||
// setBooks(
|
||||
// items.data.Items.filter(
|
||||
// (item) => item.Type == BaseItemKind.Book,
|
||||
// ).slice(0, itemLimit),
|
||||
// );
|
||||
// setMusicArtists(
|
||||
// items.data.Items.filter(
|
||||
// (item) => item.Type == BaseItemKind.MusicArtist,
|
||||
// ).slice(0, itemLimit),
|
||||
// );
|
||||
// setPersons(
|
||||
// items.data.Items.filter(
|
||||
// (item) => item.Type == BaseItemKind.Person,
|
||||
// ).slice(0, itemLimit),
|
||||
// );
|
||||
// }
|
||||
// }, [items.isSuccess]);
|
||||
|
||||
const [setBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||
|
||||
@@ -142,53 +226,33 @@ const SearchPage = () => {
|
||||
onChange={(e) => setSearchTerm(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
{items.isLoading ? (
|
||||
<div
|
||||
style={{
|
||||
height: "calc(100vh - 9em)",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<LinearProgress
|
||||
style={{
|
||||
width: "25%",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div
|
||||
style={{
|
||||
height: "100%",
|
||||
}}
|
||||
>
|
||||
{movies.length > 0 && (
|
||||
{movies.isSuccess && movies.data.Items.length > 0 && (
|
||||
<CardScroller
|
||||
title="Movies"
|
||||
displayCards={8}
|
||||
disableDecoration
|
||||
>
|
||||
{movies.map((item, index) => (
|
||||
{movies.data.Items.map((item, index) => (
|
||||
<Card
|
||||
item={item}
|
||||
seriesId={item.SeriesId}
|
||||
cardTitle={
|
||||
item.Type ==
|
||||
BaseItemKind.Episode
|
||||
item.Type == BaseItemKind.Episode
|
||||
? item.SeriesName
|
||||
: item.Name
|
||||
}
|
||||
imageType={"Primary"}
|
||||
cardCaption={
|
||||
item.Type ==
|
||||
BaseItemKind.Episode
|
||||
item.Type == BaseItemKind.Episode
|
||||
? `S${item.ParentIndexNumber}:E${item.IndexNumber} - ${item.Name}`
|
||||
: item.Type ==
|
||||
BaseItemKind.Series
|
||||
? `${
|
||||
item.ProductionYear
|
||||
} - ${
|
||||
? `${item.ProductionYear} - ${
|
||||
!!item.EndDate
|
||||
? new Date(
|
||||
item.EndDate,
|
||||
@@ -203,36 +267,28 @@ const SearchPage = () => {
|
||||
: item.ProductionYear
|
||||
}
|
||||
disableOverlay={
|
||||
item.Type ==
|
||||
BaseItemKind.Person ||
|
||||
item.Type ==
|
||||
BaseItemKind.Genre ||
|
||||
item.Type == BaseItemKind.Person ||
|
||||
item.Type == BaseItemKind.Genre ||
|
||||
item.Type ==
|
||||
BaseItemKind.MusicGenre ||
|
||||
item.Type ==
|
||||
BaseItemKind.Studio
|
||||
item.Type == BaseItemKind.Studio
|
||||
}
|
||||
cardType={
|
||||
item.Type ==
|
||||
BaseItemKind.MusicAlbum ||
|
||||
item.Type ==
|
||||
BaseItemKind.Audio ||
|
||||
item.Type ==
|
||||
BaseItemKind.Genre ||
|
||||
item.Type == BaseItemKind.Audio ||
|
||||
item.Type == BaseItemKind.Genre ||
|
||||
item.Type ==
|
||||
BaseItemKind.MusicGenre ||
|
||||
item.Type ==
|
||||
BaseItemKind.Studio ||
|
||||
item.Type ==
|
||||
BaseItemKind.Playlist
|
||||
item.Type == BaseItemKind.Studio ||
|
||||
item.Type == BaseItemKind.Playlist
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
queryKey={[]}
|
||||
userId={user.data.Id}
|
||||
imageBlurhash={
|
||||
!!item.ImageBlurHashes
|
||||
?.Primary &&
|
||||
!!item.ImageBlurHashes?.Primary &&
|
||||
item.ImageBlurHashes?.Primary[
|
||||
Object.keys(
|
||||
item.ImageBlurHashes
|
||||
@@ -244,32 +300,28 @@ const SearchPage = () => {
|
||||
))}
|
||||
</CardScroller>
|
||||
)}
|
||||
{series.length > 0 && (
|
||||
{series.isSuccess && series.data.Items.length > 0 && (
|
||||
<CardScroller
|
||||
title="TV Shows"
|
||||
displayCards={8}
|
||||
disableDecoration
|
||||
>
|
||||
{series.map((item, index) => (
|
||||
{series.data.Items.map((item, index) => (
|
||||
<Card
|
||||
item={item}
|
||||
seriesId={item.SeriesId}
|
||||
cardTitle={
|
||||
item.Type ==
|
||||
BaseItemKind.Episode
|
||||
item.Type == BaseItemKind.Episode
|
||||
? item.SeriesName
|
||||
: item.Name
|
||||
}
|
||||
imageType={"Primary"}
|
||||
cardCaption={
|
||||
item.Type ==
|
||||
BaseItemKind.Episode
|
||||
item.Type == BaseItemKind.Episode
|
||||
? `S${item.ParentIndexNumber}:E${item.IndexNumber} - ${item.Name}`
|
||||
: item.Type ==
|
||||
BaseItemKind.Series
|
||||
? `${
|
||||
item.ProductionYear
|
||||
} - ${
|
||||
? `${item.ProductionYear} - ${
|
||||
!!item.EndDate
|
||||
? new Date(
|
||||
item.EndDate,
|
||||
@@ -284,36 +336,28 @@ const SearchPage = () => {
|
||||
: item.ProductionYear
|
||||
}
|
||||
disableOverlay={
|
||||
item.Type ==
|
||||
BaseItemKind.Person ||
|
||||
item.Type ==
|
||||
BaseItemKind.Genre ||
|
||||
item.Type == BaseItemKind.Person ||
|
||||
item.Type == BaseItemKind.Genre ||
|
||||
item.Type ==
|
||||
BaseItemKind.MusicGenre ||
|
||||
item.Type ==
|
||||
BaseItemKind.Studio
|
||||
item.Type == BaseItemKind.Studio
|
||||
}
|
||||
cardType={
|
||||
item.Type ==
|
||||
BaseItemKind.MusicAlbum ||
|
||||
item.Type ==
|
||||
BaseItemKind.Audio ||
|
||||
item.Type ==
|
||||
BaseItemKind.Genre ||
|
||||
item.Type == BaseItemKind.Audio ||
|
||||
item.Type == BaseItemKind.Genre ||
|
||||
item.Type ==
|
||||
BaseItemKind.MusicGenre ||
|
||||
item.Type ==
|
||||
BaseItemKind.Studio ||
|
||||
item.Type ==
|
||||
BaseItemKind.Playlist
|
||||
item.Type == BaseItemKind.Studio ||
|
||||
item.Type == BaseItemKind.Playlist
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
queryKey={[]}
|
||||
userId={user.data.Id}
|
||||
imageBlurhash={
|
||||
!!item.ImageBlurHashes
|
||||
?.Primary &&
|
||||
!!item.ImageBlurHashes?.Primary &&
|
||||
item.ImageBlurHashes?.Primary[
|
||||
Object.keys(
|
||||
item.ImageBlurHashes
|
||||
@@ -325,32 +369,28 @@ const SearchPage = () => {
|
||||
))}
|
||||
</CardScroller>
|
||||
)}
|
||||
{audios.length > 0 && (
|
||||
{audio.isSuccess && audio.data.Items.length > 0 && (
|
||||
<CardScroller
|
||||
title="Audio"
|
||||
displayCards={8}
|
||||
disableDecoration
|
||||
>
|
||||
{audios.map((item, index) => (
|
||||
{audio.data.Items.map((item, index) => (
|
||||
<Card
|
||||
item={item}
|
||||
seriesId={item.SeriesId}
|
||||
cardTitle={
|
||||
item.Type ==
|
||||
BaseItemKind.Episode
|
||||
item.Type == BaseItemKind.Episode
|
||||
? item.SeriesName
|
||||
: item.Name
|
||||
}
|
||||
imageType={"Primary"}
|
||||
cardCaption={
|
||||
item.Type ==
|
||||
BaseItemKind.Episode
|
||||
item.Type == BaseItemKind.Episode
|
||||
? `S${item.ParentIndexNumber}:E${item.IndexNumber} - ${item.Name}`
|
||||
: item.Type ==
|
||||
BaseItemKind.Series
|
||||
? `${
|
||||
item.ProductionYear
|
||||
} - ${
|
||||
? `${item.ProductionYear} - ${
|
||||
!!item.EndDate
|
||||
? new Date(
|
||||
item.EndDate,
|
||||
@@ -365,36 +405,28 @@ const SearchPage = () => {
|
||||
: item.ProductionYear
|
||||
}
|
||||
disableOverlay={
|
||||
item.Type ==
|
||||
BaseItemKind.Person ||
|
||||
item.Type ==
|
||||
BaseItemKind.Genre ||
|
||||
item.Type == BaseItemKind.Person ||
|
||||
item.Type == BaseItemKind.Genre ||
|
||||
item.Type ==
|
||||
BaseItemKind.MusicGenre ||
|
||||
item.Type ==
|
||||
BaseItemKind.Studio
|
||||
item.Type == BaseItemKind.Studio
|
||||
}
|
||||
cardType={
|
||||
item.Type ==
|
||||
BaseItemKind.MusicAlbum ||
|
||||
item.Type ==
|
||||
BaseItemKind.Audio ||
|
||||
item.Type ==
|
||||
BaseItemKind.Genre ||
|
||||
item.Type == BaseItemKind.Audio ||
|
||||
item.Type == BaseItemKind.Genre ||
|
||||
item.Type ==
|
||||
BaseItemKind.MusicGenre ||
|
||||
item.Type ==
|
||||
BaseItemKind.Studio ||
|
||||
item.Type ==
|
||||
BaseItemKind.Playlist
|
||||
item.Type == BaseItemKind.Studio ||
|
||||
item.Type == BaseItemKind.Playlist
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
queryKey={[]}
|
||||
userId={user.data.Id}
|
||||
imageBlurhash={
|
||||
!!item.ImageBlurHashes
|
||||
?.Primary &&
|
||||
!!item.ImageBlurHashes?.Primary &&
|
||||
item.ImageBlurHashes?.Primary[
|
||||
Object.keys(
|
||||
item.ImageBlurHashes
|
||||
@@ -406,13 +438,14 @@ const SearchPage = () => {
|
||||
))}
|
||||
</CardScroller>
|
||||
)}
|
||||
{musicAlbum.length > 0 && (
|
||||
{musicAlbum.isSuccess &&
|
||||
musicAlbum.data.Items.length > 0 && (
|
||||
<CardScroller
|
||||
title="Albums"
|
||||
displayCards={8}
|
||||
disableDecoration
|
||||
>
|
||||
{musicAlbum.map((item, index) => (
|
||||
{musicAlbum.data.Items.map((item, index) => (
|
||||
<Card
|
||||
item={item}
|
||||
seriesId={item.SeriesId}
|
||||
@@ -487,32 +520,28 @@ const SearchPage = () => {
|
||||
))}
|
||||
</CardScroller>
|
||||
)}
|
||||
{books.length > 0 && (
|
||||
{book.isSuccess && book.data.Items.length > 0 && (
|
||||
<CardScroller
|
||||
title="Books"
|
||||
displayCards={8}
|
||||
disableDecoration
|
||||
>
|
||||
{books.map((item, index) => (
|
||||
{book.data.Items.map((item, index) => (
|
||||
<Card
|
||||
item={item}
|
||||
seriesId={item.SeriesId}
|
||||
cardTitle={
|
||||
item.Type ==
|
||||
BaseItemKind.Episode
|
||||
item.Type == BaseItemKind.Episode
|
||||
? item.SeriesName
|
||||
: item.Name
|
||||
}
|
||||
imageType={"Primary"}
|
||||
cardCaption={
|
||||
item.Type ==
|
||||
BaseItemKind.Episode
|
||||
item.Type == BaseItemKind.Episode
|
||||
? `S${item.ParentIndexNumber}:E${item.IndexNumber} - ${item.Name}`
|
||||
: item.Type ==
|
||||
BaseItemKind.Series
|
||||
? `${
|
||||
item.ProductionYear
|
||||
} - ${
|
||||
? `${item.ProductionYear} - ${
|
||||
!!item.EndDate
|
||||
? new Date(
|
||||
item.EndDate,
|
||||
@@ -527,36 +556,28 @@ const SearchPage = () => {
|
||||
: item.ProductionYear
|
||||
}
|
||||
disableOverlay={
|
||||
item.Type ==
|
||||
BaseItemKind.Person ||
|
||||
item.Type ==
|
||||
BaseItemKind.Genre ||
|
||||
item.Type == BaseItemKind.Person ||
|
||||
item.Type == BaseItemKind.Genre ||
|
||||
item.Type ==
|
||||
BaseItemKind.MusicGenre ||
|
||||
item.Type ==
|
||||
BaseItemKind.Studio
|
||||
item.Type == BaseItemKind.Studio
|
||||
}
|
||||
cardType={
|
||||
item.Type ==
|
||||
BaseItemKind.MusicAlbum ||
|
||||
item.Type ==
|
||||
BaseItemKind.Audio ||
|
||||
item.Type ==
|
||||
BaseItemKind.Genre ||
|
||||
item.Type == BaseItemKind.Audio ||
|
||||
item.Type == BaseItemKind.Genre ||
|
||||
item.Type ==
|
||||
BaseItemKind.MusicGenre ||
|
||||
item.Type ==
|
||||
BaseItemKind.Studio ||
|
||||
item.Type ==
|
||||
BaseItemKind.Playlist
|
||||
item.Type == BaseItemKind.Studio ||
|
||||
item.Type == BaseItemKind.Playlist
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
queryKey={[]}
|
||||
userId={user.data.Id}
|
||||
imageBlurhash={
|
||||
!!item.ImageBlurHashes
|
||||
?.Primary &&
|
||||
!!item.ImageBlurHashes?.Primary &&
|
||||
item.ImageBlurHashes?.Primary[
|
||||
Object.keys(
|
||||
item.ImageBlurHashes
|
||||
@@ -568,13 +589,15 @@ const SearchPage = () => {
|
||||
))}
|
||||
</CardScroller>
|
||||
)}
|
||||
{musicArtists.length > 0 && (
|
||||
{musicArtists.isSuccess &&
|
||||
musicArtists.data.Items.length > 0 && (
|
||||
<CardScroller
|
||||
title="Artists"
|
||||
displayCards={8}
|
||||
disableDecoration
|
||||
>
|
||||
{musicArtists.map((item, index) => (
|
||||
{musicArtists.data.Items.map(
|
||||
(item, index) => (
|
||||
<Card
|
||||
item={item}
|
||||
seriesId={item.SeriesId}
|
||||
@@ -638,43 +661,42 @@ const SearchPage = () => {
|
||||
imageBlurhash={
|
||||
!!item.ImageBlurHashes
|
||||
?.Primary &&
|
||||
item.ImageBlurHashes?.Primary[
|
||||
Object.keys(
|
||||
item.ImageBlurHashes
|
||||
?.Primary[
|
||||
Object.keys(
|
||||
item
|
||||
.ImageBlurHashes
|
||||
.Primary,
|
||||
)[0]
|
||||
]
|
||||
}
|
||||
/>
|
||||
))}
|
||||
),
|
||||
)}
|
||||
</CardScroller>
|
||||
)}
|
||||
{persons.length > 0 && (
|
||||
{person.isSuccess && person.data.Items.length > 0 && (
|
||||
<CardScroller
|
||||
title="People"
|
||||
displayCards={8}
|
||||
disableDecoration
|
||||
>
|
||||
{persons.map((item, index) => (
|
||||
{person.data.Items.map((item, index) => (
|
||||
<Card
|
||||
item={item}
|
||||
seriesId={item.SeriesId}
|
||||
cardTitle={
|
||||
item.Type ==
|
||||
BaseItemKind.Episode
|
||||
item.Type == BaseItemKind.Episode
|
||||
? item.SeriesName
|
||||
: item.Name
|
||||
}
|
||||
imageType={"Primary"}
|
||||
cardCaption={
|
||||
item.Type ==
|
||||
BaseItemKind.Episode
|
||||
item.Type == BaseItemKind.Episode
|
||||
? `S${item.ParentIndexNumber}:E${item.IndexNumber} - ${item.Name}`
|
||||
: item.Type ==
|
||||
BaseItemKind.Series
|
||||
? `${
|
||||
item.ProductionYear
|
||||
} - ${
|
||||
? `${item.ProductionYear} - ${
|
||||
!!item.EndDate
|
||||
? new Date(
|
||||
item.EndDate,
|
||||
@@ -689,36 +711,28 @@ const SearchPage = () => {
|
||||
: item.ProductionYear
|
||||
}
|
||||
disableOverlay={
|
||||
item.Type ==
|
||||
BaseItemKind.Person ||
|
||||
item.Type ==
|
||||
BaseItemKind.Genre ||
|
||||
item.Type == BaseItemKind.Person ||
|
||||
item.Type == BaseItemKind.Genre ||
|
||||
item.Type ==
|
||||
BaseItemKind.MusicGenre ||
|
||||
item.Type ==
|
||||
BaseItemKind.Studio
|
||||
item.Type == BaseItemKind.Studio
|
||||
}
|
||||
cardType={
|
||||
item.Type ==
|
||||
BaseItemKind.MusicAlbum ||
|
||||
item.Type ==
|
||||
BaseItemKind.Audio ||
|
||||
item.Type ==
|
||||
BaseItemKind.Genre ||
|
||||
item.Type == BaseItemKind.Audio ||
|
||||
item.Type == BaseItemKind.Genre ||
|
||||
item.Type ==
|
||||
BaseItemKind.MusicGenre ||
|
||||
item.Type ==
|
||||
BaseItemKind.Studio ||
|
||||
item.Type ==
|
||||
BaseItemKind.Playlist
|
||||
item.Type == BaseItemKind.Studio ||
|
||||
item.Type == BaseItemKind.Playlist
|
||||
? "square"
|
||||
: "portrait"
|
||||
}
|
||||
queryKey={[]}
|
||||
userId={user.data.Id}
|
||||
imageBlurhash={
|
||||
!!item.ImageBlurHashes
|
||||
?.Primary &&
|
||||
!!item.ImageBlurHashes?.Primary &&
|
||||
item.ImageBlurHashes?.Primary[
|
||||
Object.keys(
|
||||
item.ImageBlurHashes
|
||||
@@ -731,7 +745,6 @@ const SearchPage = () => {
|
||||
</CardScroller>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user