mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[scraper] check if id is number when getting metadata
This commit is contained in:
@@ -16,7 +16,7 @@ function getMetadata(id, type = Type.SERIES) {
|
||||
return Promise.reject("no valid id provided");
|
||||
}
|
||||
|
||||
const key = id.match(/^\d+$/) ? `kitsu:${id}` : id;
|
||||
const key = Number.isInteger(id) || id.match(/^\d+$/) ? `kitsu:${id}` : id;
|
||||
const metaType = type === Type.MOVIE ? Type.MOVIE : Type.SERIES;
|
||||
return cacheWrapMetadata(key,
|
||||
() => _requestMetadata(`${KITSU_URL}/meta/${metaType}/${key}.json`)
|
||||
|
||||
Reference in New Issue
Block a user