[scraper] small torrent type detection adjustments

This commit is contained in:
TheBeastLT
2021-03-22 21:50:18 +01:00
parent 63c4d62523
commit ba0d426e6e
2 changed files with 4 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ const { isPackTorrent } = require('./parseHelper')
async function createTorrentEntry(torrent, overwrite = false) {
const titleInfo = parse(torrent.title);
if (titleInfo.seasons && torrent.type === Type.MOVIE) {
if ((titleInfo.seasons || torrent.title.match(/\[\d+-\d+/)) && torrent.type === Type.MOVIE) {
// sometimes series torrent might be put into movies category
torrent.type = Type.SERIES;
}

View File

@@ -21,9 +21,9 @@ async function parseTorrentFiles(torrent) {
// if (metadata && metadata.type !== torrent.type && torrent.type !== Type.ANIME) {
// throw new Error(`Mismatching entry type for ${torrent.name}: ${torrent.type}!=${metadata.type}`);
// }
if (torrent.type === Type.SERIES && metadata && metadata.type === Type.MOVIE) {
// it's actually a movie
torrent.type = Type.MOVIE;
if (torrent.type !== Type.ANIME && metadata && metadata.type !== torrent.type) {
// it's actually a movie/series
torrent.type = metadata.type;
}
if (torrent.type === Type.MOVIE && (!parsedTorrentName.seasons ||