From e3b3cb3ab647a4e18d0d112c197662ce7a7e84b2 Mon Sep 17 00:00:00 2001 From: Prayag Prajapati Date: Mon, 25 Sep 2023 21:59:43 +0530 Subject: [PATCH] Fix card navigating Persona and artists #176 --- src/components/card/card.jsx | 4 +++- src/routes/album/index.jsx | 2 +- src/routes/boxset/index.jsx | 2 +- src/routes/item/index.jsx | 2 +- src/routes/library/index.jsx | 2 -- src/routes/person/index.jsx | 15 +++++++++++++++ src/routes/playlist/index.jsx | 2 +- src/routes/series/index.jsx | 4 +++- 8 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/components/card/card.jsx b/src/components/card/card.jsx index 296d0c9..b89b66b 100644 --- a/src/components/card/card.jsx +++ b/src/components/card/card.jsx @@ -77,8 +77,10 @@ export const Card = ({ const defaultOnClick = () => { if (availableSpecialRoutes.includes(item.Type)) { navigate(`/${item.Type.toLocaleLowerCase()}/${item.Id}`); - } else if (!!item.Role) { + } else if (!!item.Role || item.Type == BaseItemKind.Person) { navigate(`/person/${item.Id}`); + } else if (item.Type == BaseItemKind.MusicArtist) { + navigate(`/artist/${item.Id}`); } else { navigate(`/item/${item.Id}`); } diff --git a/src/routes/album/index.jsx b/src/routes/album/index.jsx index 0aa2223..b4f2151 100644 --- a/src/routes/album/index.jsx +++ b/src/routes/album/index.jsx @@ -349,7 +349,7 @@ const MusicAlbumTitlePage = () => { {similarItems.data.TotalRecordCount > 0 && ( diff --git a/src/routes/boxset/index.jsx b/src/routes/boxset/index.jsx index e46b713..c7314d2 100644 --- a/src/routes/boxset/index.jsx +++ b/src/routes/boxset/index.jsx @@ -247,7 +247,7 @@ const BoxSetTitlePage = () => { )} {similarItems.data.TotalRecordCount > 0 && ( diff --git a/src/routes/item/index.jsx b/src/routes/item/index.jsx index a2a4f3e..a54f698 100644 --- a/src/routes/item/index.jsx +++ b/src/routes/item/index.jsx @@ -635,7 +635,7 @@ const ItemDetail = () => { )} {similarItems.data.TotalRecordCount > 0 && ( diff --git a/src/routes/library/index.jsx b/src/routes/library/index.jsx index 4d452a5..ed6a73f 100644 --- a/src/routes/library/index.jsx +++ b/src/routes/library/index.jsx @@ -446,8 +446,6 @@ const LibraryView = () => { setFilterButtonAnchorEl(null); }; - console.log(sortBy == "Random"); - const handleLiking = async (item) => { let result; if (item.UserData.isFavorite) { diff --git a/src/routes/person/index.jsx b/src/routes/person/index.jsx index da36f54..55d267e 100644 --- a/src/routes/person/index.jsx +++ b/src/routes/person/index.jsx @@ -7,6 +7,7 @@ import CircularProgress from "@mui/material/CircularProgress"; import Divider from "@mui/material/Divider"; import Tabs from "@mui/material/Tabs"; import Tab from "@mui/material/Tab"; +import Typography from "@mui/material/Typography"; import { AnimatePresence, motion } from "framer-motion"; @@ -165,6 +166,7 @@ const PersonTitlePage = () => { fields: ["SeasonUserData", "Overview"], sortBy: ["PremiereDate", "ProductionYear", "SortName"], excludeLocationTypes: [LocationType.Virtual], + limit: 24, }); return result.data; }, @@ -424,6 +426,19 @@ const PersonTitlePage = () => { }, )} + {tab.data.isSuccess && + tab.data.data + .TotalRecordCount > + 24 && ( + + And more... + + )} ); })} diff --git a/src/routes/playlist/index.jsx b/src/routes/playlist/index.jsx index 846014a..b840f7e 100644 --- a/src/routes/playlist/index.jsx +++ b/src/routes/playlist/index.jsx @@ -192,7 +192,7 @@ const PlaylistTitlePage = () => { {similarItems.data.TotalRecordCount > 0 && ( diff --git a/src/routes/series/index.jsx b/src/routes/series/index.jsx index 7a9b41f..a5b05f9 100644 --- a/src/routes/series/index.jsx +++ b/src/routes/series/index.jsx @@ -409,6 +409,8 @@ const SeriesTitlePage = () => { episode.ParentIndexNumber == 0 ? `${episode.SeasonName} - ${episode.Name}` + : !!episode.IndexNumberEnd + ? `${episode.IndexNumber}-${episode.IndexNumberEnd}. ${episode.Name}` : `${episode.IndexNumber}. ${episode.Name}` } cardCaption={ @@ -527,7 +529,7 @@ const SeriesTitlePage = () => { )} {similarItems.data.TotalRecordCount > 0 && (