adds kickass scrapper

This commit is contained in:
TheBeastLT
2020-03-08 20:06:32 +01:00
parent 853c21472a
commit 6cc0c5dc64
11 changed files with 404 additions and 56 deletions

View File

@@ -69,7 +69,7 @@ function getProvider(provider) {
}
function updateProvider(provider) {
return Provider.update(provider);
return Provider.update(provider, { where: { name: { [Op.eq]: provider.name } } });
}
function getTorrent(torrent) {

View File

@@ -47,4 +47,16 @@ async function getStoredTorrentEntry(torrent) {
.catch(() => undefined);
}
module.exports = { createTorrentEntry, createSkipTorrentEntry, getStoredTorrentEntry };
async function updateTorrentSeeders(torrent) {
if (torrent.seeders === undefined) {
return;
}
return repository.getTorrent(torrent)
.then(stored => {
stored.seeders = torrent.seeders;
return stored.save();
}).catch(() => undefined);
}
module.exports = { createTorrentEntry, createSkipTorrentEntry, getStoredTorrentEntry, updateTorrentSeeders };