[scraper] check if id is number when getting metadata
This commit is contained in:
parent
6c502b714a
commit
c5271c8490
1 changed files with 1 additions and 1 deletions
|
|
@ -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`)
|
||||
|
|
|
|||
Loading…
Reference in a new issue