[scraper] small torrent type detection adjustments
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 ||
|
||||
|
||||
Reference in New Issue
Block a user