mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[scraper] add tpb fake torrent removal
This commit is contained in:
@@ -170,7 +170,11 @@ function getTorrent(torrent) {
|
||||
}
|
||||
|
||||
function getTorrentsBasedOnTitle(titleQuery, type) {
|
||||
return Torrent.findAll({ where: { title: { [Op.regexp]: `${titleQuery}` }, type: type } });
|
||||
return getTorrentsBasedOnQuery({ title: { [Op.regexp]: `${titleQuery}` }, type: type });
|
||||
}
|
||||
|
||||
function getTorrentsBasedOnQuery(where) {
|
||||
return Torrent.findAll({ where: where });
|
||||
}
|
||||
|
||||
function getTorrentsWithoutSize() {
|
||||
@@ -219,6 +223,10 @@ function setTorrentSeeders(torrent, seeders) {
|
||||
);
|
||||
}
|
||||
|
||||
function deleteTorrent(torrent) {
|
||||
return Torrent.destroy({ where: { infoHash: torrent.infoHash } })
|
||||
}
|
||||
|
||||
function createFile(file) {
|
||||
if (file.id) {
|
||||
return (file.dataValues ? file.save() : File.upsert(file))
|
||||
@@ -304,6 +312,8 @@ module.exports = {
|
||||
setTorrentSeeders,
|
||||
getTorrent,
|
||||
getTorrentsBasedOnTitle,
|
||||
getTorrentsBasedOnQuery,
|
||||
deleteTorrent,
|
||||
getUpdateSeedersTorrents,
|
||||
getNoContentsTorrents,
|
||||
createFile,
|
||||
@@ -319,4 +329,4 @@ module.exports = {
|
||||
getSkipTorrent,
|
||||
createSkipTorrent,
|
||||
getTorrentsWithoutSize
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user