New: Added option to filter series by complete missing season
Closes #5037
This commit is contained in:
parent
62354dfac8
commit
9e694c7b06
|
@ -210,7 +210,7 @@ class FilterBuilderRow extends Component {
|
|||
key: availablePropFilter.name,
|
||||
value: availablePropFilter.label
|
||||
};
|
||||
});
|
||||
}).sort((a, b) => a.value.localeCompare(b.value));
|
||||
|
||||
const ValueComponent = getRowValueConnector(selectedFilterBuilderProp);
|
||||
|
||||
|
|
|
@ -164,6 +164,30 @@ export const filterPredicates = {
|
|||
0;
|
||||
|
||||
return predicate(sizeOnDisk, filterValue);
|
||||
},
|
||||
|
||||
hasMissingSeason: function(item, filterValue, type) {
|
||||
const { seasons = [] } = item;
|
||||
|
||||
return seasons.some((season) => {
|
||||
const {
|
||||
seasonNumber,
|
||||
statistics = {}
|
||||
} = season;
|
||||
|
||||
const {
|
||||
episodeFileCount = 0,
|
||||
episodeCount = 0,
|
||||
totalEpisodeCount = 0
|
||||
} = statistics;
|
||||
|
||||
return (
|
||||
seasonNumber > 0 &&
|
||||
totalEpisodeCount > 0 &&
|
||||
episodeCount === totalEpisodeCount &&
|
||||
episodeFileCount === 0
|
||||
);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -318,6 +342,11 @@ export const filterBuilderProps = [
|
|||
name: 'useSceneNumbering',
|
||||
label: 'Scene Numbering',
|
||||
type: filterBuilderTypes.EXACT
|
||||
},
|
||||
{
|
||||
name: 'hasMissingSeason',
|
||||
label: 'Has Missing Season',
|
||||
type: filterBuilderTypes.EXACT
|
||||
}
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in New Issue