• Adds an AniList entry to the ignored duplicates list.

    Parameters

    • anilistId: number

      The AniList ID to ignore.

    • anilistTitle: string

      The AniList title for reference.

    Returns void

    export function addIgnoredDuplicate(
    anilistId: number,
    anilistTitle: string,
    ): void {
    try {
    const ignored = getIgnoredDuplicates();

    // Check if already ignored
    if (ignored.some((item) => item.anilistId === anilistId)) {
    return;
    }

    // Add new ignored entry
    ignored.push({
    anilistId,
    anilistTitle,
    ignoredAt: Date.now(),
    });

    if (ignored.length > MAX_IGNORED_DUPLICATES) {
    const excess = ignored.length - MAX_IGNORED_DUPLICATES;
    ignored.splice(0, excess);
    }

    storage.setItem(STORAGE_KEYS.IGNORED_DUPLICATES, JSON.stringify(ignored));
    } catch (error) {
    console.error("[Storage] Error saving ignored duplicate to storage", error);
    }
    }