remove rd infringing items from cache
Some checks are pending
Deploy Addon / build (SSH_HOST_2, SSH_KEY_2) (push) Waiting to run
Deploy Addon / build (SSH_HOST_3, SSH_KEY_3) (push) Waiting to run
Deploy Addon / build (SSH_HOST_4, SSH_KEY_4) (push) Waiting to run
Deploy Addon / build (SSH_HOST_5, SSH_KEY_5) (push) Waiting to run

This commit is contained in:
TheBeastLT 2026-05-12 22:29:56 +03:00
parent fc5eeec654
commit e99fedb494
2 changed files with 4 additions and 0 deletions

View file

@ -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 => {

View file

@ -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)) {