diff --git a/bot/roundupFirstSeen.js b/bot/roundupFirstSeen.js index 7a57eab..9f49382 100644 --- a/bot/roundupFirstSeen.js +++ b/bot/roundupFirstSeen.js @@ -1,9 +1,8 @@ import { PersistentMap } from "../utils/persistentMap.js"; -// Wider than the 7-day roundup window so an item filtered out one week is -// still remembered the following week (avoids it re-appearing as "new" if -// Sonarr does a second upgrade just past the 7-day mark). -const TTL_MS = 14 * 24 * 60 * 60 * 1000; +// Items already seen should never re-appear as "new" regardless of how many +// Sonarr/Radarr quality upgrades happen. ~5 years is effectively permanent. +const TTL_MS = 5 * 365 * 24 * 60 * 60 * 1000; const map = new PersistentMap("roundup-first-seen", TTL_MS, { validateValue: (v) => v && typeof v.firstSeenAt === "number", diff --git a/jellyfinWebhook.js b/jellyfinWebhook.js index fe5200f..af9c0ab 100644 --- a/jellyfinWebhook.js +++ b/jellyfinWebhook.js @@ -25,7 +25,7 @@ const debouncedSenders = new Map(); // re-notifies anything in the recently-added window via the next poll/WS reconnect). const sentNotifications = new PersistentMap( "sent-notifications", - 7 * 24 * 60 * 60 * 1000, // 7 days — survive Sonarr/Radarr upgrade cycles + 5 * 365 * 24 * 60 * 60 * 1000, // ~5 years — items already in the library never re-notify { validateValue: (v) => v && typeof v.level === "number" } ); @@ -1003,7 +1003,7 @@ export async function handleJellyfinWebhook(req, res, client, pendingRequests, o `[DUPLICATE CHECK] ${data.ItemType} "${ data.Name }" - SeriesId: ${SeriesId}, sentLevel: ${sentLevel}, currentLevel: ${currentLevel}, has debouncer: ${debouncedSenders.has( - SeriesId + seriesKey )}` );