mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-05-13 10:10:41 +00:00
remove rd infringing items from cache
Some checks are pending
Some checks are pending
This commit is contained in:
parent
fc5eeec654
commit
e99fedb494
2 changed files with 4 additions and 0 deletions
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue