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
pull/4997/head
nitsua 4 years ago committed by GitHub
parent df96203914
commit 7019c8587b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,7 +25,7 @@ function getMovieStatus(hasFile, isMonitored, isAvailable, queueDetails = false)
return translate('Missing'); return translate('Missing');
} }
return translate('Unreleased'); return translate('NotAvailable');
} }
function MovieStatusLabel(props) { function MovieStatusLabel(props) {

@ -92,6 +92,7 @@ class MovieIndexOverview extends Component {
overview, overview,
monitored, monitored,
hasFile, hasFile,
isAvailable,
status, status,
titleSlug, titleSlug,
images, images,
@ -169,6 +170,7 @@ class MovieIndexOverview extends Component {
<MovieIndexProgressBar <MovieIndexProgressBar
monitored={monitored} monitored={monitored}
hasFile={hasFile} hasFile={hasFile}
isAvailable={isAvailable}
status={status} status={status}
posterWidth={posterWidth} posterWidth={posterWidth}
detailedProgressBar={overviewOptions.detailedProgressBar} detailedProgressBar={overviewOptions.detailedProgressBar}
@ -281,6 +283,7 @@ MovieIndexOverview.propTypes = {
overview: PropTypes.string.isRequired, overview: PropTypes.string.isRequired,
monitored: PropTypes.bool.isRequired, monitored: PropTypes.bool.isRequired,
hasFile: PropTypes.bool.isRequired, hasFile: PropTypes.bool.isRequired,
isAvailable: PropTypes.bool.isRequired,
status: PropTypes.string.isRequired, status: PropTypes.string.isRequired,
titleSlug: PropTypes.string.isRequired, titleSlug: PropTypes.string.isRequired,
images: PropTypes.arrayOf(PropTypes.object).isRequired, images: PropTypes.arrayOf(PropTypes.object).isRequired,

@ -87,6 +87,7 @@ class MovieIndexPoster extends Component {
title, title,
monitored, monitored,
hasFile, hasFile,
isAvailable,
status, status,
titleSlug, titleSlug,
images, images,
@ -228,6 +229,7 @@ class MovieIndexPoster extends Component {
detailedProgressBar={detailedProgressBar} detailedProgressBar={detailedProgressBar}
queueStatus={queueStatus} queueStatus={queueStatus}
queueState={queueState} queueState={queueState}
isAvailable={isAvailable}
/> />
{ {
@ -282,6 +284,7 @@ MovieIndexPoster.propTypes = {
title: PropTypes.string.isRequired, title: PropTypes.string.isRequired,
monitored: PropTypes.bool.isRequired, monitored: PropTypes.bool.isRequired,
hasFile: PropTypes.bool.isRequired, hasFile: PropTypes.bool.isRequired,
isAvailable: PropTypes.bool.isRequired,
status: PropTypes.string.isRequired, status: PropTypes.string.isRequired,
titleSlug: PropTypes.string.isRequired, titleSlug: PropTypes.string.isRequired,
images: PropTypes.arrayOf(PropTypes.object).isRequired, images: PropTypes.arrayOf(PropTypes.object).isRequired,

@ -4,7 +4,6 @@ import ProgressBar from 'Components/ProgressBar';
import { sizes } from 'Helpers/Props'; import { sizes } from 'Helpers/Props';
import getProgressBarKind from 'Utilities/Movie/getProgressBarKind'; import getProgressBarKind from 'Utilities/Movie/getProgressBarKind';
import getQueueStatusText from 'Utilities/Movie/getQueueStatusText'; import getQueueStatusText from 'Utilities/Movie/getQueueStatusText';
import titleCase from 'Utilities/String/titleCase';
import translate from 'Utilities/String/translate'; import translate from 'Utilities/String/translate';
import styles from './MovieIndexProgressBar.css'; import styles from './MovieIndexProgressBar.css';
@ -13,6 +12,7 @@ function MovieIndexProgressBar(props) {
monitored, monitored,
status, status,
hasFile, hasFile,
isAvailable,
posterWidth, posterWidth,
detailedProgressBar, detailedProgressBar,
queueStatus, queueStatus,
@ -24,21 +24,17 @@ function MovieIndexProgressBar(props) {
let movieStatus = (status === 'released' && hasFile) ? 'downloaded' : status; let movieStatus = (status === 'released' && hasFile) ? 'downloaded' : status;
if (movieStatus === 'deleted') { if (movieStatus === 'deleted') {
movieStatus = 'announced'; movieStatus = 'Missing';
if (hasFile) { if (hasFile) {
movieStatus = 'downloaded'; movieStatus = 'Downloaded';
} else {
movieStatus = 'released';
}
}
if (movieStatus === 'announced') {
movieStatus = translate('NotAvailable');
} }
} else if (hasFile) {
if (movieStatus === 'released') { movieStatus = 'Downloaded';
movieStatus = translate('Missing'); } else if (isAvailable && !hasFile) {
movieStatus = 'Missing';
} else {
movieStatus = 'NotAvailable';
} }
return ( return (
@ -46,11 +42,11 @@ function MovieIndexProgressBar(props) {
className={styles.progressBar} className={styles.progressBar}
containerClassName={styles.progress} containerClassName={styles.progress}
progress={progress} progress={progress}
kind={getProgressBarKind(status, monitored, hasFile, queueStatusText)} kind={getProgressBarKind(status, monitored, hasFile, isAvailable, queueStatusText)}
size={detailedProgressBar ? sizes.MEDIUM : sizes.SMALL} size={detailedProgressBar ? sizes.MEDIUM : sizes.SMALL}
showText={detailedProgressBar} showText={detailedProgressBar}
width={posterWidth} width={posterWidth}
text={(queueStatusText) ? queueStatusText.shortText : titleCase(movieStatus)} text={(queueStatusText) ? queueStatusText.shortText : translate(movieStatus)}
/> />
); );
} }
@ -58,6 +54,7 @@ function MovieIndexProgressBar(props) {
MovieIndexProgressBar.propTypes = { MovieIndexProgressBar.propTypes = {
monitored: PropTypes.bool.isRequired, monitored: PropTypes.bool.isRequired,
hasFile: PropTypes.bool.isRequired, hasFile: PropTypes.bool.isRequired,
isAvailable: PropTypes.bool.isRequired,
status: PropTypes.string.isRequired, status: PropTypes.string.isRequired,
posterWidth: PropTypes.number.isRequired, posterWidth: PropTypes.number.isRequired,
detailedProgressBar: PropTypes.bool.isRequired, detailedProgressBar: PropTypes.bool.isRequired,

@ -57,7 +57,7 @@ function MovieFileStatus(props) {
title={translate('NotMonitored')} title={translate('NotMonitored')}
kind={kinds.WARNING} kind={kinds.WARNING}
> >
Not Monitored {translate('NotMonitored')}
</Label> </Label>
</div> </div>
); );
@ -70,7 +70,7 @@ function MovieFileStatus(props) {
title={translate('MovieAvailableButMissing')} title={translate('MovieAvailableButMissing')}
kind={kinds.DANGER} kind={kinds.DANGER}
> >
Missing {translate('Missing')}
</Label> </Label>
</div> </div>
); );
@ -82,7 +82,7 @@ function MovieFileStatus(props) {
title={translate('NotAvailable')} title={translate('NotAvailable')}
kind={kinds.INFO} kind={kinds.INFO}
> >
Not Available {translate('NotAvailable')}
</Label> </Label>
</div> </div>
); );

@ -1,14 +1,10 @@
import { kinds } from 'Helpers/Props'; import { kinds } from 'Helpers/Props';
function getProgressBarKind(status, monitored, hasFile, queue = false) { function getProgressBarKind(status, monitored, hasFile, isAvailable, queue = false) {
if (queue) { if (queue) {
return kinds.QUEUE; return kinds.QUEUE;
} }
if (status === 'announced') {
return kinds.PRIMARY;
}
if (hasFile && monitored) { if (hasFile && monitored) {
return kinds.SUCCESS; return kinds.SUCCESS;
} }
@ -17,11 +13,15 @@ function getProgressBarKind(status, monitored, hasFile, queue = false) {
return kinds.DEFAULT; return kinds.DEFAULT;
} }
if (monitored) { if (isAvailable) {
return kinds.DANGER; return kinds.DANGER;
} }
if (!monitored) {
return kinds.WARNING; return kinds.WARNING;
}
return kinds.PRIMARY;
} }
export default getProgressBarKind; export default getProgressBarKind;

Loading…
Cancel
Save