mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
adds metadata type check for anime movies to bypass file fetching
This commit is contained in:
@@ -19,7 +19,7 @@ function getMetadata(id, type = Type.SERIES) {
|
|||||||
() => _requestMetadata(`${KITSU_URL}/meta/${metaType}/${key}.json`)
|
() => _requestMetadata(`${KITSU_URL}/meta/${metaType}/${key}.json`)
|
||||||
.catch(() => _requestMetadata(`${CINEMETA_URL}/meta/${metaType}/${key}.json`))
|
.catch(() => _requestMetadata(`${CINEMETA_URL}/meta/${metaType}/${key}.json`))
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
throw new Error(`failed metadata query ${kitsuId} due: ${error.message}`);
|
throw new Error(`failed metadata query ${key} due: ${error.message}`);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,6 +31,7 @@ function _requestMetadata(url) {
|
|||||||
return {
|
return {
|
||||||
kitsuId: body.meta.kitsu_id,
|
kitsuId: body.meta.kitsu_id,
|
||||||
imdbId: body.meta.imdb_id,
|
imdbId: body.meta.imdb_id,
|
||||||
|
type: body.meta.type,
|
||||||
title: body.meta.name,
|
title: body.meta.name,
|
||||||
year: body.meta.year,
|
year: body.meta.year,
|
||||||
country: body.meta.country,
|
country: body.meta.country,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ async function parseTorrentFiles(torrent) {
|
|||||||
// throw new Error(`Mismatching entry type for ${torrent.name}: ${torrent.type}!=${metadata.type}`);
|
// throw new Error(`Mismatching entry type for ${torrent.name}: ${torrent.type}!=${metadata.type}`);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (torrent.type === Type.MOVIE && !parsedTorrentName.seasons) {
|
if (torrent.type === Type.MOVIE && !parsedTorrentName.seasons || metadata.type === Type.MOVIE) {
|
||||||
if (parsedTorrentName.complete) {
|
if (parsedTorrentName.complete) {
|
||||||
return torrentFiles(torrent)
|
return torrentFiles(torrent)
|
||||||
.then(files => files.filter(file => file.size > MIN_SIZE))
|
.then(files => files.filter(file => file.size > MIN_SIZE))
|
||||||
|
|||||||
Reference in New Issue
Block a user