New: Added option to filter series by complete missing season

Closes #5037
This commit is contained in:
Mark McDowall 2022-12-19 22:51:01 -08:00
parent 62354dfac8
commit 9e694c7b06
2 changed files with 30 additions and 1 deletions

View File

@ -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);

View File

@ -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
}
];