1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-21 22:05:43 -04:00

Fix an issue with the language on status labels for inCinemas and added translation to the movieStatus variable (#4986)

Fix issue where status text was not consistent across all 3 index views and the details
This commit is contained in:
nitsua
2020-09-10 11:04:52 -04:00
committed by GitHub
parent df96203914
commit 7019c8587b
6 changed files with 29 additions and 26 deletions
@@ -4,7 +4,6 @@ import ProgressBar from 'Components/ProgressBar';
import { sizes } from 'Helpers/Props';
import getProgressBarKind from 'Utilities/Movie/getProgressBarKind';
import getQueueStatusText from 'Utilities/Movie/getQueueStatusText';
import titleCase from 'Utilities/String/titleCase';
import translate from 'Utilities/String/translate';
import styles from './MovieIndexProgressBar.css';
@@ -13,6 +12,7 @@ function MovieIndexProgressBar(props) {
monitored,
status,
hasFile,
isAvailable,
posterWidth,
detailedProgressBar,
queueStatus,
@@ -24,21 +24,17 @@ function MovieIndexProgressBar(props) {
let movieStatus = (status === 'released' && hasFile) ? 'downloaded' : status;
if (movieStatus === 'deleted') {
movieStatus = 'announced';
movieStatus = 'Missing';
if (hasFile) {
movieStatus = 'downloaded';
} else {
movieStatus = 'released';
movieStatus = 'Downloaded';
}
}
if (movieStatus === 'announced') {
movieStatus = translate('NotAvailable');
}
if (movieStatus === 'released') {
movieStatus = translate('Missing');
} else if (hasFile) {
movieStatus = 'Downloaded';
} else if (isAvailable && !hasFile) {
movieStatus = 'Missing';
} else {
movieStatus = 'NotAvailable';
}
return (
@@ -46,11 +42,11 @@ function MovieIndexProgressBar(props) {
className={styles.progressBar}
containerClassName={styles.progress}
progress={progress}
kind={getProgressBarKind(status, monitored, hasFile, queueStatusText)}
kind={getProgressBarKind(status, monitored, hasFile, isAvailable, queueStatusText)}
size={detailedProgressBar ? sizes.MEDIUM : sizes.SMALL}
showText={detailedProgressBar}
width={posterWidth}
text={(queueStatusText) ? queueStatusText.shortText : titleCase(movieStatus)}
text={(queueStatusText) ? queueStatusText.shortText : translate(movieStatus)}
/>
);
}
@@ -58,6 +54,7 @@ function MovieIndexProgressBar(props) {
MovieIndexProgressBar.propTypes = {
monitored: PropTypes.bool.isRequired,
hasFile: PropTypes.bool.isRequired,
isAvailable: PropTypes.bool.isRequired,
status: PropTypes.string.isRequired,
posterWidth: PropTypes.number.isRequired,
detailedProgressBar: PropTypes.bool.isRequired,