Remove subtitle on artist card for jellyfin

- No available albumCount property
This commit is contained in:
jeffvli
2021-11-22 18:47:27 -08:00
committed by Jeff
parent 547b4ad976
commit 2de63a1212
3 changed files with 18 additions and 9 deletions

View File

@@ -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"

View File

@@ -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}

View File

@@ -29,7 +29,10 @@ const GridCard = ({ data, index, style }: any) => {
>
<Card
title={data.data[i][data.cardTitle.property]}
subtitle={`${data.data[i][data.cardSubtitle.property]}${data.cardSubtitle.unit}`}
subtitle={
data.data[i][data.cardSubtitle.property] &&
`${data.data[i][data.cardSubtitle.property]}${data.cardSubtitle.unit}`
}
coverArt={data.data[i].image}
size={data.size}
url={