• Processes a batch of manga entries for matching.

    Parameters

    • kenmeiMangaList: KenmeiManga[]

      The list of Kenmei manga entries to match.

    • anilistMangaMap: Map<string, AniListManga[]>

      A map of search keys to AniList manga entry arrays.

    • config: Partial<MatchEngineConfig> = {}

      Optional partial match engine configuration.

    Returns Promise<MangaMatchResult[]>

    A promise resolving to an array of MangaMatchResult objects.

    export async function processBatchMatches(
    kenmeiMangaList: KenmeiManga[],
    anilistMangaMap: Map<string, AniListManga[]>,
    config: Partial<MatchEngineConfig> = {},
    ): Promise<MangaMatchResult[]> {
    const results: MangaMatchResult[] = [];

    for (const kenmeiManga of kenmeiMangaList) {
    const searchKey = normalizeString(kenmeiManga.title).slice(0, 10);
    const potentialMatches = anilistMangaMap.get(searchKey) || [];

    // Find matches
    const matchResult = findBestMatches(kenmeiManga, potentialMatches, config);
    results.push(matchResult);
    }

    return results;
    }