Add custom format score to history details

This commit is contained in:
Bogdan 2023-09-12 17:31:35 +03:00
parent 703c251b5c
commit 50e2e9edef
1 changed files with 43 additions and 12 deletions

View File

@ -7,6 +7,7 @@ import DescriptionListItemTitle from 'Components/DescriptionList/DescriptionList
import Link from 'Components/Link/Link'; import Link from 'Components/Link/Link';
import formatDateTime from 'Utilities/Date/formatDateTime'; import formatDateTime from 'Utilities/Date/formatDateTime';
import formatAge from 'Utilities/Number/formatAge'; import formatAge from 'Utilities/Number/formatAge';
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
import translate from 'Utilities/String/translate'; import translate from 'Utilities/String/translate';
import styles from './HistoryDetails.css'; import styles from './HistoryDetails.css';
@ -24,10 +25,11 @@ function HistoryDetails(props) {
const { const {
indexer, indexer,
releaseGroup, releaseGroup,
movieMatchType,
customFormatScore,
nzbInfoUrl, nzbInfoUrl,
downloadClient, downloadClient,
downloadClientName, downloadClientName,
movieMatchType,
age, age,
ageHours, ageHours,
ageMinutes, ageMinutes,
@ -64,16 +66,11 @@ function HistoryDetails(props) {
} }
{ {
nzbInfoUrl ? customFormatScore && customFormatScore !== '0' ?
<span> <DescriptionListItem
<DescriptionListItemTitle> title={translate('CustomFormatScore')}
Info URL data={formatCustomFormatScore(customFormatScore)}
</DescriptionListItemTitle> /> :
<DescriptionListItemDescription>
<Link to={nzbInfoUrl}>{nzbInfoUrl}</Link>
</DescriptionListItemDescription>
</span> :
null null
} }
@ -87,6 +84,20 @@ function HistoryDetails(props) {
null null
} }
{
nzbInfoUrl ?
<span>
<DescriptionListItemTitle>
Info URL
</DescriptionListItemTitle>
<DescriptionListItemDescription>
<Link to={nzbInfoUrl}>{nzbInfoUrl}</Link>
</DescriptionListItemDescription>
</span> :
null
}
{ {
downloadClientNameInfo ? downloadClientNameInfo ?
<DescriptionListItem <DescriptionListItem
@ -162,6 +173,7 @@ function HistoryDetails(props) {
if (eventType === 'downloadFolderImported') { if (eventType === 'downloadFolderImported') {
const { const {
customFormatScore,
droppedPath, droppedPath,
importedPath importedPath
} = data; } = data;
@ -193,13 +205,23 @@ function HistoryDetails(props) {
/> : /> :
null null
} }
{
customFormatScore && customFormatScore !== '0' ?
<DescriptionListItem
title={translate('CustomFormatScore')}
data={formatCustomFormatScore(customFormatScore)}
/> :
null
}
</DescriptionList> </DescriptionList>
); );
} }
if (eventType === 'movieFileDeleted') { if (eventType === 'movieFileDeleted') {
const { const {
reason reason,
customFormatScore
} = data; } = data;
let reasonMessage = ''; let reasonMessage = '';
@ -229,6 +251,15 @@ function HistoryDetails(props) {
title={translate('Reason')} title={translate('Reason')}
data={reasonMessage} data={reasonMessage}
/> />
{
customFormatScore && customFormatScore !== '0' ?
<DescriptionListItem
title={translate('CustomFormatScore')}
data={formatCustomFormatScore(customFormatScore)}
/> :
null
}
</DescriptionList> </DescriptionList>
); );
} }