mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Remove formatPreferredWordScore
This commit is contained in:
parent
6ad9ebb19e
commit
7bb9250877
@ -10,7 +10,7 @@ import MovieFormats from 'Movie/MovieFormats';
|
|||||||
import MovieLanguage from 'Movie/MovieLanguage';
|
import MovieLanguage from 'Movie/MovieLanguage';
|
||||||
import MovieQuality from 'Movie/MovieQuality';
|
import MovieQuality from 'Movie/MovieQuality';
|
||||||
import MovieTitleLink from 'Movie/MovieTitleLink';
|
import MovieTitleLink from 'Movie/MovieTitleLink';
|
||||||
import formatPreferredWordScore from 'Utilities/Number/formatPreferredWordScore';
|
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
|
||||||
import HistoryDetailsModal from './Details/HistoryDetailsModal';
|
import HistoryDetailsModal from './Details/HistoryDetailsModal';
|
||||||
import HistoryEventTypeCell from './HistoryEventTypeCell';
|
import HistoryEventTypeCell from './HistoryEventTypeCell';
|
||||||
import styles from './HistoryRow.css';
|
import styles from './HistoryRow.css';
|
||||||
@ -178,7 +178,7 @@ class HistoryRow extends Component {
|
|||||||
className={styles.customFormatScore}
|
className={styles.customFormatScore}
|
||||||
>
|
>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
anchor={formatPreferredWordScore(
|
anchor={formatCustomFormatScore(
|
||||||
customFormatScore,
|
customFormatScore,
|
||||||
customFormats.length
|
customFormats.length
|
||||||
)}
|
)}
|
||||||
|
@ -16,7 +16,7 @@ import MovieLanguage from 'Movie/MovieLanguage';
|
|||||||
import MovieQuality from 'Movie/MovieQuality';
|
import MovieQuality from 'Movie/MovieQuality';
|
||||||
import MovieTitleLink from 'Movie/MovieTitleLink';
|
import MovieTitleLink from 'Movie/MovieTitleLink';
|
||||||
import formatBytes from 'Utilities/Number/formatBytes';
|
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 translate from 'Utilities/String/translate';
|
||||||
import QueueStatusCell from './QueueStatusCell';
|
import QueueStatusCell from './QueueStatusCell';
|
||||||
import RemoveQueueItemModal from './RemoveQueueItemModal';
|
import RemoveQueueItemModal from './RemoveQueueItemModal';
|
||||||
@ -211,7 +211,7 @@ class QueueRow extends Component {
|
|||||||
className={styles.customFormatScore}
|
className={styles.customFormatScore}
|
||||||
>
|
>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
anchor={formatPreferredWordScore(
|
anchor={formatCustomFormatScore(
|
||||||
customFormatScore,
|
customFormatScore,
|
||||||
customFormats.length
|
customFormats.length
|
||||||
)}
|
)}
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
|
|
||||||
function formatPreferredWordScore(input, customFormatsLength = 0) {
|
|
||||||
const score = Number(input);
|
|
||||||
|
|
||||||
if (score > 0) {
|
|
||||||
return `+${score}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (score < 0) {
|
|
||||||
return score;
|
|
||||||
}
|
|
||||||
|
|
||||||
return customFormatsLength > 0 ? '+0' : '';
|
|
||||||
}
|
|
||||||
|
|
||||||
export default formatPreferredWordScore;
|
|
Loading…
Reference in New Issue
Block a user