[scraper] checks for torrent contents when updating existing torrent

This commit is contained in:
TheBeastLT
2020-05-06 11:59:53 +02:00
parent 0ad7324a6a
commit 9ce3f72e5d
12 changed files with 125 additions and 35 deletions

View File

@@ -4,7 +4,7 @@ const leetx = require('./1337x_api');
const { Type } = require('../../lib/types');
const repository = require('../../lib/repository');
const Promises = require('../../lib/promises');
const { createTorrentEntry, getStoredTorrentEntry, updateTorrentSeeders } = require('../../lib/torrentEntries');
const { createTorrentEntry, checkAndUpdateTorrent } = require('../../lib/torrentEntries');
const NAME = '1337x';
const UNTIL_PAGE = 10;
@@ -65,8 +65,8 @@ async function processTorrentRecord(record) {
console.warn(`Incorrect upload date for [${torrentFound.infoHash}] ${torrentFound.name}`);
return;
}
if (await getStoredTorrentEntry(torrentFound)) {
return updateTorrentSeeders(torrentFound);
if (await checkAndUpdateTorrent(torrentFound)) {
return torrentFound;
}
const torrent = {