[scraper] fix type assignment if it's null in metadata

This commit is contained in:
TheBeastLT
2021-04-29 11:23:50 +02:00
parent 18e9890f7f
commit 7f81f72a47

View File

@@ -21,7 +21,7 @@ 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.ANIME && metadata && metadata.type !== torrent.type) {
if (torrent.type !== Type.ANIME && metadata && metadata.type && metadata.type !== torrent.type) {
// it's actually a movie/series
torrent.type = metadata.type;
}