The manga match result to evaluate.
Advanced filters including year bounds.
True if year is outside the allowed range or missing.
export function failsYearFilter(
match: MangaMatchResult,
filters: AdvancedMatchFilters,
): boolean {
if (!filters.yearRange) {
return false;
}
if (filters.yearRange.min === null && filters.yearRange.max === null) {
return false;
}
const matchManga = match.selectedMatch || match.anilistMatches?.[0]?.manga;
const year = matchManga?.startDate?.year;
if (year == null) {
return false;
}
if (filters.yearRange.min !== null && year < filters.yearRange.min) {
return true;
}
if (filters.yearRange.max !== null && year > filters.yearRange.max) {
return true;
}
return false;
}
Returns whether a match violates the configured release year range.