From e99fedb4943d4b26f5f0470c53060fbfdea38d29 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Tue, 12 May 2026 22:29:56 +0300 Subject: [PATCH] remove rd infringing items from cache --- addon/lib/cache.js | 3 +++ addon/moch/realdebrid.js | 1 + 2 files changed, 4 insertions(+) diff --git a/addon/lib/cache.js b/addon/lib/cache.js index d9f3bd8..e7ec184 100644 --- a/addon/lib/cache.js +++ b/addon/lib/cache.js @@ -77,6 +77,9 @@ export function cacheAvailabilityResults(infoHash, fileIds) { export function removeAvailabilityResults(infoHash, fileIds) { const key = `${AVAILABILITY_KEY_PREFIX}:${infoHash}`; + if (fileIds === undefined) { + return mongoCache.delete(key); + } const fileIdsString = fileIds.toString(); return mongoCache.get(key) .then(result => { diff --git a/addon/moch/realdebrid.js b/addon/moch/realdebrid.js index e50bc59..9b77d53 100644 --- a/addon/moch/realdebrid.js +++ b/addon/moch/realdebrid.js @@ -126,6 +126,7 @@ export async function resolve({ ip, isBrowser, apiKey, infoHash, fileIndex }) { } if (isInfringingFileError(error)) { console.log(`Infringing file removed from RealDebrid ${infoHash} [${fileIndex}]`); + removeAvailabilityResults(infoHash); return StaticResponse.FAILED_INFRINGEMENT; } if (isLimitExceededError(error)) {