• Returns whether a match violates the configured confidence range.

    Parameters

    Returns boolean

    True if confidence is outside the allowed range.

    export function failsConfidenceFilter(
    match: MangaMatchResult,
    filters: AdvancedMatchFilters,
    ): boolean {
    const selectedEntry = match.selectedMatch
    ? match.anilistMatches?.find((m) => m.manga?.id === match.selectedMatch?.id)
    : match.anilistMatches?.[0];

    const matchConfidence = selectedEntry?.confidence;

    if (matchConfidence == null) {
    return false;
    }

    return (
    matchConfidence < filters.confidence.min ||
    matchConfidence > filters.confidence.max
    );
    }