[scraper] extract isPack to a function

This commit is contained in:
TheBeastLT
2021-01-31 19:19:56 +01:00
parent 2543a09bdd
commit 3aa36ab681
3 changed files with 27 additions and 15 deletions

View File

@@ -5,6 +5,7 @@ const repository = require('./repository');
const { getImdbId, getKitsuId } = require('./metadata');
const { parseTorrentFiles } = require('./torrentFiles');
const { assignSubtitles } = require('./torrentSubtitles');
const { isPackTorrent } = require('./parseHelper')
async function createTorrentEntry(torrent, overwrite = false) {
const titleInfo = parse(torrent.title);
@@ -30,7 +31,7 @@ async function createTorrentEntry(torrent, overwrite = false) {
.catch(() => undefined);
}
if (!torrent.imdbId && !torrent.kitsuId && !titleInfo.complete && typeof titleInfo.year !== 'string') {
if (!torrent.imdbId && !torrent.kitsuId && !isPackTorrent(torrent)) {
console.log(`imdbId or kitsuId not found: ${torrent.provider} ${torrent.title}`);
return;
}