handles series type mismatch if is in movie category

This commit is contained in:
TheBeastLT
2020-02-26 00:31:13 +01:00
parent 23880d4fb2
commit 149b24fbf0
5 changed files with 43 additions and 15 deletions

View File

@@ -8,6 +8,10 @@ async function createTorrentEntry(torrent) {
const titleInfo = parse(torrent.title);
const searchTitle = escapeTitle(titleInfo.title).toLowerCase();
if (titleInfo.seasons && torrent.type === Type.MOVIE) {
// sometimes series torrent might be put into movies category
torrent.type = Type.SERIES;
}
if (!torrent.imdbId && torrent.type !== Type.ANIME) {
torrent.imdbId = await getImdbId({ name: searchTitle, year: titleInfo.year, type: torrent.type })
.catch(() => undefined);