[scraper] fix null imdbid search result

This commit is contained in:
TheBeastLT
2020-03-16 09:34:49 +01:00
parent 70c279d7d7
commit b6e2fceeee

View File

@@ -113,7 +113,7 @@ async function getImdbId(info, type) {
.find(result => result.includes('imdb.com/title/')))
.then(result => result && result.match(/imdb\.com\/title\/(tt\d+)/))
.then(match => match && match[1])))
.then(imdbId => 'tt' + imdbId.replace(/tt0*([1-9][0-9]*)$/, '$1').padStart(7, '0'));
.then(imdbId => imdbId && 'tt' + imdbId.replace(/tt0*([1-9][0-9]*)$/, '$1').padStart(7, '0'));
}
async function getKitsuId(info) {