Fixed: Prevent UI errors for authors with invalid quality and metadata profiles

pull/3723/head^2
Bogdan 2 months ago
parent e0d904fa69
commit b8bd645560

@ -5,6 +5,7 @@ import dimensions from 'Styles/Variables/dimensions';
import formatDateTime from 'Utilities/Date/formatDateTime'; import formatDateTime from 'Utilities/Date/formatDateTime';
import getRelativeDate from 'Utilities/Date/getRelativeDate'; import getRelativeDate from 'Utilities/Date/getRelativeDate';
import formatBytes from 'Utilities/Number/formatBytes'; import formatBytes from 'Utilities/Number/formatBytes';
import translate from 'Utilities/String/translate';
import AuthorIndexOverviewInfoRow from './AuthorIndexOverviewInfoRow'; import AuthorIndexOverviewInfoRow from './AuthorIndexOverviewInfoRow';
import styles from './AuthorIndexOverviewInfo.css'; import styles from './AuthorIndexOverviewInfo.css';
@ -76,9 +77,9 @@ function getInfoRowProps(row, props) {
}; };
} }
if (name === 'qualityProfileId') { if (name === 'qualityProfileId' && !!props.qualityProfile?.name) {
return { return {
title: 'Quality Profile', title: translate('QualityProfile'),
iconName: icons.PROFILE, iconName: icons.PROFILE,
label: props.qualityProfile.name label: props.qualityProfile.name
}; };

@ -235,12 +235,12 @@ class AuthorIndexPoster extends Component {
</div> </div>
} }
{ {showQualityProfile && !!qualityProfile?.name ? (
showQualityProfile && <div className={styles.title} title={translate('QualityProfile')}>
<div className={styles.title}>
{qualityProfile.name} {qualityProfile.name}
</div> </div>
} ) : null}
{ {
nextAiring && nextAiring &&
<div className={styles.nextAiring}> <div className={styles.nextAiring}>

@ -209,7 +209,7 @@ class AuthorIndexRow extends Component {
key={name} key={name}
className={styles[name]} className={styles[name]}
> >
{qualityProfile.name} {qualityProfile?.name ?? ''}
</VirtualTableRowCell> </VirtualTableRowCell>
); );
} }
@ -220,7 +220,7 @@ class AuthorIndexRow extends Component {
key={name} key={name}
className={styles[name]} className={styles[name]}
> >
{metadataProfile.name} {metadataProfile?.name ?? ''}
</VirtualTableRowCell> </VirtualTableRowCell>
); );
} }

@ -5,6 +5,7 @@ import dimensions from 'Styles/Variables/dimensions';
import formatDateTime from 'Utilities/Date/formatDateTime'; import formatDateTime from 'Utilities/Date/formatDateTime';
import getRelativeDate from 'Utilities/Date/getRelativeDate'; import getRelativeDate from 'Utilities/Date/getRelativeDate';
import formatBytes from 'Utilities/Number/formatBytes'; import formatBytes from 'Utilities/Number/formatBytes';
import translate from 'Utilities/String/translate';
import BookIndexOverviewInfoRow from './BookIndexOverviewInfoRow'; import BookIndexOverviewInfoRow from './BookIndexOverviewInfoRow';
import styles from './BookIndexOverviewInfo.css'; import styles from './BookIndexOverviewInfo.css';
@ -71,9 +72,9 @@ function getInfoRowProps(row, props) {
}; };
} }
if (name === 'qualityProfileId') { if (name === 'qualityProfileId' && !!props.qualityProfile?.name) {
return { return {
title: 'Quality Profile', title: translate('QualityProfile'),
iconName: icons.PROFILE, iconName: icons.PROFILE,
label: props.qualityProfile.name label: props.qualityProfile.name
}; };

@ -250,12 +250,12 @@ class BookIndexPoster extends Component {
</div> </div>
} }
{ {showQualityProfile && !!qualityProfile?.name ? (
showQualityProfile && <div className={styles.title} title={translate('QualityProfile')}>
<div className={styles.title}>
{qualityProfile.name} {qualityProfile.name}
</div> </div>
} ) : null}
{ {
nextAiring && nextAiring &&
<div className={styles.nextAiring}> <div className={styles.nextAiring}>

@ -195,7 +195,7 @@ class BookIndexRow extends Component {
key={name} key={name}
className={styles[name]} className={styles[name]}
> >
{qualityProfile.name} {qualityProfile?.name ?? ''}
</VirtualTableRowCell> </VirtualTableRowCell>
); );
} }

Loading…
Cancel
Save