Fixed: Status Cell Working

pull/2/head
Qstick 5 years ago
parent 2af273a4a1
commit a2cad761b9

@ -1,5 +1,4 @@
.center { .center {
display: flex; display: flex;
justify-content: center; justify-content: center;
} }

@ -5,9 +5,28 @@ import { icons, kinds, sizes } from 'Helpers/Props';
import Icon from 'Components/Icon'; import Icon from 'Components/Icon';
import ProgressBar from 'Components/ProgressBar'; import ProgressBar from 'Components/ProgressBar';
import QueueDetails from 'Activity/Queue/QueueDetails'; import QueueDetails from 'Activity/Queue/QueueDetails';
import MovieQuality from './MovieQuality'; import formatBytes from 'Utilities/Number/formatBytes';
import Label from 'Components/Label';
import styles from './MovieStatus.css'; import styles from './MovieStatus.css';
function getTooltip(title, quality, size) {
const revision = quality.revision;
if (revision.real && revision.real > 0) {
title += ' [REAL]';
}
if (revision.version && revision.version > 1) {
title += ' [PROPER]';
}
if (size) {
title += ` - ${formatBytes(size)}`;
}
return title;
}
function MovieStatus(props) { function MovieStatus(props) {
const { const {
inCinemas, inCinemas,
@ -19,7 +38,7 @@ function MovieStatus(props) {
const hasMovieFile = !!movieFile; const hasMovieFile = !!movieFile;
const isQueued = !!queueItem; const isQueued = !!queueItem;
const hasAired = isBefore(inCinemas); const hasReleased = isBefore(inCinemas);
if (isQueued) { if (isQueued) {
const { const {
@ -59,16 +78,17 @@ function MovieStatus(props) {
if (hasMovieFile) { if (hasMovieFile) {
const quality = movieFile.quality; const quality = movieFile.quality;
const isCutoffNotMet = movieFile.qualityCutoffNotMet; // TODO: Fix on Backend
// const isCutoffNotMet = movieFile.qualityCutoffNotMet;
return ( return (
<div className={styles.center}> <div className={styles.center}>
<MovieQuality <Label
quality={quality} kind={kinds.SUCCESS}
size={movieFile.size} title={getTooltip('Movie Downloaded', quality, movieFile.size)}
isCutoffNotMet={isCutoffNotMet} >
title="Movie Downloaded" {quality.quality.name}
/> </Label>
</div> </div>
); );
} }
@ -87,32 +107,37 @@ function MovieStatus(props) {
if (!monitored) { if (!monitored) {
return ( return (
<div className={styles.center}> <div className={styles.center}>
<Icon <Label
name={icons.UNMONITORED} title="Announced"
kind={kinds.DISABLED} kind={kinds.WARNING}
title="Movie is not monitored" >
/> Not Monitored
</Label>
</div> </div>
); );
} }
if (hasAired) { if (hasReleased) {
return ( return (
<div className={styles.center}> <div className={styles.center}>
<Icon <Label
name={icons.MISSING} title="Movie Available, but Missing"
title="Movie missing from disk" kind={kinds.DANGER}
/> >
Missing
</Label>
</div> </div>
); );
} }
return ( return (
<div className={styles.center}> <div className={styles.center}>
<Icon <Label
name={icons.NOT_AIRED} title="Announced"
title="Movie has not aired" kind={kinds.INFO}
/> >
Not Available
</Label>
</div> </div>
); );
} }

Loading…
Cancel
Save