Fixed: History details incorrect when preferred word score was 0

Closes #4328
This commit is contained in:
Mark McDowall 2021-02-16 22:35:07 -08:00
parent 28ba037630
commit 062e47e27e
1 changed files with 42 additions and 28 deletions

View File

@ -42,32 +42,35 @@ function HistoryDetails(props) {
/> />
{ {
!!indexer && indexer ?
<DescriptionListItem <DescriptionListItem
title="Indexer" title="Indexer"
data={indexer} data={indexer}
/> /> :
null
} }
{ {
!!releaseGroup && releaseGroup ?
<DescriptionListItem <DescriptionListItem
descriptionClassName={styles.description} descriptionClassName={styles.description}
title="Release Group" title="Release Group"
data={releaseGroup} data={releaseGroup}
/> /> :
null
} }
{ {
!!preferredWordScore && preferredWordScore && preferredWordScore !== '0' ?
<DescriptionListItem <DescriptionListItem
title="Preferred Word Score" title="Preferred Word Score"
data={formatPreferredWordScore(preferredWordScore)} data={formatPreferredWordScore(preferredWordScore)}
/> /> :
null
} }
{ {
!!nzbInfoUrl && nzbInfoUrl ?
<span> <span>
<DescriptionListItemTitle> <DescriptionListItemTitle>
Info URL Info URL
@ -76,39 +79,44 @@ function HistoryDetails(props) {
<DescriptionListItemDescription> <DescriptionListItemDescription>
<Link to={nzbInfoUrl}>{nzbInfoUrl}</Link> <Link to={nzbInfoUrl}>{nzbInfoUrl}</Link>
</DescriptionListItemDescription> </DescriptionListItemDescription>
</span> </span> :
null
} }
{ {
!!downloadClient && downloadClient ?
<DescriptionListItem <DescriptionListItem
title="Download Client" title="Download Client"
data={downloadClient} data={downloadClient}
/> /> :
null
} }
{ {
!!downloadId && downloadId ?
<DescriptionListItem <DescriptionListItem
title="Grab ID" title="Grab ID"
data={downloadId} data={downloadId}
/> /> :
null
} }
{ {
!!(age || ageHours || ageMinutes) && age || ageHours || ageMinutes ?
<DescriptionListItem <DescriptionListItem
title="Age (when grabbed)" title="Age (when grabbed)"
data={formatAge(age, ageHours, ageMinutes)} data={formatAge(age, ageHours, ageMinutes)}
/> /> :
null
} }
{ {
!!publishedDate && publishedDate ?
<DescriptionListItem <DescriptionListItem
title="Published Date" title="Published Date"
data={formatDateTime(publishedDate, shortDateFormat, timeFormat, { includeSeconds: true })} data={formatDateTime(publishedDate, shortDateFormat, timeFormat, { includeSeconds: true })}
/> /> :
null
} }
</DescriptionList> </DescriptionList>
); );
@ -128,11 +136,12 @@ function HistoryDetails(props) {
/> />
{ {
!!message && message ?
<DescriptionListItem <DescriptionListItem
title="Message" title="Message"
data={message} data={message}
/> /> :
null
} }
</DescriptionList> </DescriptionList>
); );
@ -154,29 +163,32 @@ function HistoryDetails(props) {
/> />
{ {
!!droppedPath && droppedPath ?
<DescriptionListItem <DescriptionListItem
descriptionClassName={styles.description} descriptionClassName={styles.description}
title="Source" title="Source"
data={droppedPath} data={droppedPath}
/> /> :
null
} }
{ {
!!importedPath && importedPath ?
<DescriptionListItem <DescriptionListItem
descriptionClassName={styles.description} descriptionClassName={styles.description}
title="Imported To" title="Imported To"
data={importedPath} data={importedPath}
/> /> :
null
} }
{ {
!!preferredWordScore && preferredWordScore && preferredWordScore !== '0' ?
<DescriptionListItem <DescriptionListItem
title="Preferred Word Score" title="Preferred Word Score"
data={formatPreferredWordScore(preferredWordScore)} data={formatPreferredWordScore(preferredWordScore)}
/> /> :
null
} }
</DescriptionList> </DescriptionList>
); );
@ -217,11 +229,12 @@ function HistoryDetails(props) {
/> />
{ {
!!preferredWordScore && preferredWordScore && preferredWordScore !== '0' ?
<DescriptionListItem <DescriptionListItem
title="Preferred Word Score" title="Preferred Word Score"
data={formatPreferredWordScore(preferredWordScore)} data={formatPreferredWordScore(preferredWordScore)}
/> /> :
null
} }
</DescriptionList> </DescriptionList>
); );
@ -274,11 +287,12 @@ function HistoryDetails(props) {
/> />
{ {
!!message && message ?
<DescriptionListItem <DescriptionListItem
title="Message" title="Message"
data={message} data={message}
/> /> :
null
} }
</DescriptionList> </DescriptionList>
); );