[scraper] do not escape hyphen when searching for id

This commit is contained in:
TheBeastLT
2020-03-28 23:58:31 +01:00
parent 34486230ea
commit ee8897a088
3 changed files with 6 additions and 6 deletions

View File

@@ -83,8 +83,8 @@ function escapeTitle(title) {
.normalize('NFKD') // normalize non-ASCII characters
.replace(/[\u0300-\u036F]/g, '')
.replace(/&/g, 'and')
.replace(/[;, ~\-]+/g, ' ') // replace dots, commas or underscores with spaces
.replace(/[^\w ()+#@!']+/g, '') // remove all non-alphanumeric chars
.replace(/[;, ~]+/g, ' ') // replace dots, commas or underscores with spaces
.replace(/[^\w \-()+#@!']+/g, '') // remove all non-alphanumeric chars
.trim();
}
@@ -119,7 +119,7 @@ async function getImdbId(info, type) {
async function getKitsuId(info) {
const title = escapeTitle(info.title);
const year = info.year ? ` ${info.year} ` : '';
const year = info.year ? ` ${info.year}` : '';
const season = info.season > 1 ? ` S${info.season}` : '';
const query = `${title}${year}${season}`;