Rename formatPreferredWordScore to formatCustomFormatScore
This commit is contained in:
parent
ae3dd5730e
commit
3937545e15
|
@ -7,7 +7,7 @@ import DescriptionListItemTitle from 'Components/DescriptionList/DescriptionList
|
|||
import Link from 'Components/Link/Link';
|
||||
import formatDateTime from 'Utilities/Date/formatDateTime';
|
||||
import formatAge from 'Utilities/Number/formatAge';
|
||||
import formatPreferredWordScore from 'Utilities/Number/formatPreferredWordScore';
|
||||
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
|
||||
import styles from './HistoryDetails.css';
|
||||
|
||||
function HistoryDetails(props) {
|
||||
|
@ -68,7 +68,7 @@ function HistoryDetails(props) {
|
|||
customFormatScore && customFormatScore !== '0' ?
|
||||
<DescriptionListItem
|
||||
title="Custom Format Score"
|
||||
data={formatPreferredWordScore(customFormatScore)}
|
||||
data={formatCustomFormatScore(customFormatScore)}
|
||||
/> :
|
||||
null
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ function HistoryDetails(props) {
|
|||
customFormatScore && customFormatScore !== '0' ?
|
||||
<DescriptionListItem
|
||||
title="Custom Format Score"
|
||||
data={formatPreferredWordScore(customFormatScore)}
|
||||
data={formatCustomFormatScore(customFormatScore)}
|
||||
/> :
|
||||
null
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ function HistoryDetails(props) {
|
|||
customFormatScore && customFormatScore !== '0' ?
|
||||
<DescriptionListItem
|
||||
title="Custom Format Score"
|
||||
data={formatPreferredWordScore(customFormatScore)}
|
||||
data={formatCustomFormatScore(customFormatScore)}
|
||||
/> :
|
||||
null
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import EpisodeTitleLink from 'Episode/EpisodeTitleLink';
|
|||
import SeasonEpisodeNumber from 'Episode/SeasonEpisodeNumber';
|
||||
import { icons, tooltipPositions } from 'Helpers/Props';
|
||||
import SeriesTitleLink from 'Series/SeriesTitleLink';
|
||||
import formatPreferredWordScore from 'Utilities/Number/formatPreferredWordScore';
|
||||
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
|
||||
import HistoryDetailsModal from './Details/HistoryDetailsModal';
|
||||
import HistoryEventTypeCell from './HistoryEventTypeCell';
|
||||
import styles from './HistoryRow.css';
|
||||
|
@ -212,7 +212,7 @@ class HistoryRow extends Component {
|
|||
className={styles.customFormatScore}
|
||||
>
|
||||
<Tooltip
|
||||
anchor={formatPreferredWordScore(
|
||||
anchor={formatCustomFormatScore(
|
||||
customFormatScore,
|
||||
customFormats.length
|
||||
)}
|
||||
|
|
|
@ -18,7 +18,7 @@ import { icons, kinds, tooltipPositions } from 'Helpers/Props';
|
|||
import InteractiveImportModal from 'InteractiveImport/InteractiveImportModal';
|
||||
import SeriesTitleLink from 'Series/SeriesTitleLink';
|
||||
import formatBytes from 'Utilities/Number/formatBytes';
|
||||
import formatPreferredWordScore from 'Utilities/Number/formatPreferredWordScore';
|
||||
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
|
||||
import QueueStatusCell from './QueueStatusCell';
|
||||
import RemoveQueueItemModal from './RemoveQueueItemModal';
|
||||
import TimeleftCell from './TimeleftCell';
|
||||
|
@ -269,7 +269,7 @@ class QueueRow extends Component {
|
|||
className={styles.customFormatScore}
|
||||
>
|
||||
<Tooltip
|
||||
anchor={formatPreferredWordScore(
|
||||
anchor={formatCustomFormatScore(
|
||||
customFormatScore,
|
||||
customFormats.length
|
||||
)}
|
||||
|
|
|
@ -14,7 +14,7 @@ import EpisodeFormats from 'Episode/EpisodeFormats';
|
|||
import EpisodeLanguages from 'Episode/EpisodeLanguages';
|
||||
import EpisodeQuality from 'Episode/EpisodeQuality';
|
||||
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
|
||||
import formatPreferredWordScore from 'Utilities/Number/formatPreferredWordScore';
|
||||
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
|
||||
import styles from './EpisodeHistoryRow.css';
|
||||
|
||||
function getTitle(eventType) {
|
||||
|
@ -126,7 +126,7 @@ class EpisodeHistoryRow extends Component {
|
|||
<TableRowCell className={styles.customFormatScore}>
|
||||
<Tooltip
|
||||
anchor={
|
||||
formatPreferredWordScore(customFormatScore, customFormats.length)
|
||||
formatCustomFormatScore(customFormatScore, customFormats.length)
|
||||
}
|
||||
tooltip={<EpisodeFormats formats={customFormats} />}
|
||||
position={tooltipPositions.BOTTOM}
|
||||
|
|
|
@ -30,7 +30,7 @@ import {
|
|||
import { SelectStateInputProps } from 'typings/props';
|
||||
import Rejection from 'typings/Rejection';
|
||||
import formatBytes from 'Utilities/Number/formatBytes';
|
||||
import formatPreferredWordScore from 'Utilities/Number/formatPreferredWordScore';
|
||||
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import InteractiveImportRowCellPlaceholder from './InteractiveImportRowCellPlaceholder';
|
||||
import styles from './InteractiveImportRow.css';
|
||||
|
@ -431,7 +431,7 @@ function InteractiveImportRow(props: InteractiveImportRowProps) {
|
|||
<TableRowCell>
|
||||
{customFormats?.length ? (
|
||||
<Popover
|
||||
anchor={formatPreferredWordScore(customFormatScore)}
|
||||
anchor={formatCustomFormatScore(customFormatScore)}
|
||||
title={translate('CustomFormats')}
|
||||
body={
|
||||
<div className={styles.customFormatTooltip}>
|
||||
|
|
|
@ -19,7 +19,7 @@ import CustomFormat from 'typings/CustomFormat';
|
|||
import formatDateTime from 'Utilities/Date/formatDateTime';
|
||||
import formatAge from 'Utilities/Number/formatAge';
|
||||
import formatBytes from 'Utilities/Number/formatBytes';
|
||||
import formatPreferredWordScore from 'Utilities/Number/formatPreferredWordScore';
|
||||
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
|
||||
import OverrideMatchModal from './OverrideMatch/OverrideMatchModal';
|
||||
import Peers from './Peers';
|
||||
import ReleaseEpisode from './ReleaseEpisode';
|
||||
|
@ -236,7 +236,7 @@ function InteractiveSearchRow(props: InteractiveSearchRowProps) {
|
|||
|
||||
<TableRowCell className={styles.customFormatScore}>
|
||||
<Tooltip
|
||||
anchor={formatPreferredWordScore(
|
||||
anchor={formatCustomFormatScore(
|
||||
customFormatScore,
|
||||
customFormats.length
|
||||
)}
|
||||
|
|
|
@ -15,7 +15,7 @@ import MediaInfoConnector from 'EpisodeFile/MediaInfoConnector';
|
|||
import * as mediaInfoTypes from 'EpisodeFile/mediaInfoTypes';
|
||||
import { tooltipPositions } from 'Helpers/Props';
|
||||
import formatBytes from 'Utilities/Number/formatBytes';
|
||||
import formatPreferredWordScore from 'Utilities/Number/formatPreferredWordScore';
|
||||
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
|
||||
import formatRuntime from 'Utilities/Number/formatRuntime';
|
||||
import styles from './EpisodeRow.css';
|
||||
|
||||
|
@ -204,7 +204,7 @@ class EpisodeRow extends Component {
|
|||
className={styles.customFormatScore}
|
||||
>
|
||||
<Tooltip
|
||||
anchor={formatPreferredWordScore(
|
||||
anchor={formatCustomFormatScore(
|
||||
customFormatScore,
|
||||
customFormats.length
|
||||
)}
|
||||
|
|
|
@ -16,7 +16,7 @@ import EpisodeNumber from 'Episode/EpisodeNumber';
|
|||
import EpisodeQuality from 'Episode/EpisodeQuality';
|
||||
import SeasonEpisodeNumber from 'Episode/SeasonEpisodeNumber';
|
||||
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
|
||||
import formatPreferredWordScore from 'Utilities/Number/formatPreferredWordScore';
|
||||
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
|
||||
import styles from './SeriesHistoryRow.css';
|
||||
|
||||
function getTitle(eventType) {
|
||||
|
@ -146,7 +146,7 @@ class SeriesHistoryRow extends Component {
|
|||
<TableRowCell className={styles.customFormatScore}>
|
||||
<Tooltip
|
||||
anchor={
|
||||
formatPreferredWordScore(customFormatScore, customFormats.length)
|
||||
formatCustomFormatScore(customFormatScore, customFormats.length)
|
||||
}
|
||||
tooltip={<EpisodeFormats formats={customFormats} />}
|
||||
position={tooltipPositions.BOTTOM}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
|
||||
function formatPreferredWordScore(input, customFormatsLength = 0) {
|
||||
function formatCustomFormatScore(
|
||||
input?: number,
|
||||
customFormatsLength = 0
|
||||
): string {
|
||||
const score = Number(input);
|
||||
|
||||
if (score > 0) {
|
||||
|
@ -7,10 +9,10 @@ function formatPreferredWordScore(input, customFormatsLength = 0) {
|
|||
}
|
||||
|
||||
if (score < 0) {
|
||||
return score;
|
||||
return `${score}`;
|
||||
}
|
||||
|
||||
return customFormatsLength > 0 ? '+0' : '';
|
||||
}
|
||||
|
||||
export default formatPreferredWordScore;
|
||||
export default formatCustomFormatScore;
|
Loading…
Reference in New Issue