mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Cutoff Status and Filter on MovieIndex
This commit is contained in:
@@ -4,7 +4,7 @@ import formatBytes from 'Utilities/Number/formatBytes';
|
||||
import { kinds } from 'Helpers/Props';
|
||||
import Label from 'Components/Label';
|
||||
|
||||
function getTooltip(title, quality, size) {
|
||||
function getTooltip(title, quality, size, isMonitored, isCutoffNotMet) {
|
||||
const revision = quality.revision;
|
||||
|
||||
if (revision.real && revision.real > 0) {
|
||||
@@ -19,6 +19,12 @@ function getTooltip(title, quality, size) {
|
||||
title += ` - ${formatBytes(size)}`;
|
||||
}
|
||||
|
||||
if (!isMonitored) {
|
||||
title += ' [Not Monitored]';
|
||||
} else if (isCutoffNotMet) {
|
||||
title += ' [Cutoff Not Met]';
|
||||
}
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
@@ -28,14 +34,22 @@ function MovieQuality(props) {
|
||||
title,
|
||||
quality,
|
||||
size,
|
||||
isMonitored,
|
||||
isCutoffNotMet
|
||||
} = props;
|
||||
|
||||
let kind = kinds.DEFAULT;
|
||||
if (!isMonitored) {
|
||||
kind = kinds.DISABLED;
|
||||
} else if (isCutoffNotMet) {
|
||||
kind = kinds.INVERSE;
|
||||
}
|
||||
|
||||
return (
|
||||
<Label
|
||||
className={className}
|
||||
kind={isCutoffNotMet ? kinds.INVERSE : kinds.DEFAULT}
|
||||
title={getTooltip(title, quality, size)}
|
||||
kind={kind}
|
||||
title={getTooltip(title, quality, size, isMonitored, isCutoffNotMet)}
|
||||
>
|
||||
{quality.quality.name}
|
||||
</Label>
|
||||
@@ -47,11 +61,13 @@ MovieQuality.propTypes = {
|
||||
title: PropTypes.string,
|
||||
quality: PropTypes.object.isRequired,
|
||||
size: PropTypes.number,
|
||||
isMonitored: PropTypes.bool,
|
||||
isCutoffNotMet: PropTypes.bool
|
||||
};
|
||||
|
||||
MovieQuality.defaultProps = {
|
||||
title: ''
|
||||
title: '',
|
||||
isMonitored: true
|
||||
};
|
||||
|
||||
export default MovieQuality;
|
||||
|
@@ -4,28 +4,10 @@ import { icons, kinds, sizes } from 'Helpers/Props';
|
||||
import Icon from 'Components/Icon';
|
||||
import ProgressBar from 'Components/ProgressBar';
|
||||
import QueueDetails from 'Activity/Queue/QueueDetails';
|
||||
import formatBytes from 'Utilities/Number/formatBytes';
|
||||
import MovieQuality from 'Movie/MovieQuality';
|
||||
import Label from 'Components/Label';
|
||||
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) {
|
||||
const {
|
||||
inCinemas,
|
||||
@@ -76,32 +58,18 @@ function MovieStatus(props) {
|
||||
);
|
||||
}
|
||||
|
||||
if (hasMovieFile && monitored) {
|
||||
const quality = movieFile.quality;
|
||||
// TODO: Fix on Backend
|
||||
// const isCutoffNotMet = movieFile.qualityCutoffNotMet;
|
||||
|
||||
return (
|
||||
<div className={styles.center}>
|
||||
<Label
|
||||
kind={kinds.SUCCESS}
|
||||
title={getTooltip('Movie Downloaded', quality, movieFile.size)}
|
||||
>
|
||||
{quality.quality.name}
|
||||
</Label>
|
||||
</div>
|
||||
);
|
||||
} else if (hasMovieFile && !monitored) {
|
||||
if (hasMovieFile) {
|
||||
const quality = movieFile.quality;
|
||||
|
||||
return (
|
||||
<div className={styles.center}>
|
||||
<Label
|
||||
kind={kinds.DISABLED}
|
||||
title={getTooltip('Movie Downloaded', quality, movieFile.size)}
|
||||
>
|
||||
{quality.quality.name}
|
||||
</Label>
|
||||
<MovieQuality
|
||||
title={quality.quality.name}
|
||||
size={movieFile.size}
|
||||
quality={quality}
|
||||
isMonitored={monitored}
|
||||
isCutoffNotMet={movieFile.qualityCutoffNotMet}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@@ -97,7 +97,7 @@ export const filters = [
|
||||
type: filterTypes.EQUAL
|
||||
},
|
||||
{
|
||||
key: 'movieFile.qualityCutoffNotMet',
|
||||
key: 'qualityCutoffNotMet',
|
||||
value: true,
|
||||
type: filterTypes.EQUAL
|
||||
}
|
||||
@@ -106,12 +106,6 @@ export const filters = [
|
||||
];
|
||||
|
||||
export const filterPredicates = {
|
||||
missing: function(item) {
|
||||
const { statistics = {} } = item;
|
||||
|
||||
return statistics.episodeCount - statistics.episodeFileCount > 0;
|
||||
},
|
||||
|
||||
added: function(item, filterValue, type) {
|
||||
return dateFilterPredicate(item.added, filterValue, type);
|
||||
},
|
||||
@@ -128,6 +122,12 @@ export const filterPredicates = {
|
||||
const predicate = filterTypePredicates[type];
|
||||
|
||||
return predicate(item.ratings.value * 10, filterValue);
|
||||
},
|
||||
|
||||
qualityCutoffNotMet: function(item) {
|
||||
const { movieFile = {} } = item;
|
||||
|
||||
return movieFile.qualityCutoffNotMet;
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user