From 2de63a1212e6010a6b7edfdf0648fd6eb7fe0e9d Mon Sep 17 00:00:00 2001 From: jeffvli Date: Mon, 22 Nov 2021 18:47:27 -0800 Subject: [PATCH] Remove subtitle on artist card for jellyfin - No available albumCount property --- src/components/library/ArtistList.tsx | 11 +++++++---- src/components/search/SearchView.tsx | 11 +++++++---- src/components/viewtypes/GridViewType.tsx | 5 ++++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/components/library/ArtistList.tsx b/src/components/library/ArtistList.tsx index e3f0ce2..e77a761 100644 --- a/src/components/library/ArtistList.tsx +++ b/src/components/library/ArtistList.tsx @@ -19,6 +19,7 @@ import { import GridViewType from '../viewtypes/GridViewType'; import { RefreshButton } from '../shared/ToolbarButtons'; import { apiController } from '../../api/controller'; +import { Server } from '../../types'; const ArtistList = () => { const dispatch = useAppDispatch(); @@ -167,10 +168,12 @@ const ArtistList = () => { property: 'title', urlProperty: 'id', }} - cardSubtitle={{ - property: 'albumCount', - unit: ' albums', - }} + cardSubtitle={ + config.serverType === Server.Subsonic && { + property: 'albumCount', + unit: ' albums', + } + } playClick={{ type: 'artist', idProperty: 'id' }} size={config.lookAndFeel.gridView.cardSize} cacheType="artist" diff --git a/src/components/search/SearchView.tsx b/src/components/search/SearchView.tsx index 64b79ef..7f976b7 100644 --- a/src/components/search/SearchView.tsx +++ b/src/components/search/SearchView.tsx @@ -20,6 +20,7 @@ import { setStatus } from '../../redux/playerSlice'; import ListViewTable from '../viewtypes/ListViewTable'; import { SectionTitle, SectionTitleWrapper, StyledPanel } from '../shared/styled'; import { apiController } from '../../api/controller'; +import { Server } from '../../types'; const SearchView = () => { const dispatch = useAppDispatch(); @@ -195,10 +196,12 @@ const SearchView = () => { property: 'title', urlProperty: 'id', }} - cardSubtitle={{ - property: 'albumCount', - unit: ' albums', - }} + cardSubtitle={ + config.serverType === Server.Subsonic && { + property: 'albumCount', + unit: ' albums', + } + } cardSize={config.lookAndFeel.gridView.cardSize} type="artist" handleFavorite={handleArtistFavorite} diff --git a/src/components/viewtypes/GridViewType.tsx b/src/components/viewtypes/GridViewType.tsx index 720f55e..4d38bdf 100644 --- a/src/components/viewtypes/GridViewType.tsx +++ b/src/components/viewtypes/GridViewType.tsx @@ -29,7 +29,10 @@ const GridCard = ({ data, index, style }: any) => { >