From ee8897a088543e0ea9cc2796499e45c1b0ff5d84 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Sat, 28 Mar 2020 23:58:31 +0100 Subject: [PATCH] [scraper] do not escape hyphen when searching for id --- package-lock.json | 4 ++-- package.json | 2 +- scraper/lib/metadata.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index b56a307..9367c5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1620,8 +1620,8 @@ } }, "parse-torrent-title": { - "version": "git://github.com/TheBeastLT/parse-torrent-title.git#826ee1a8a832e8c18fcc0703f5b56a8b9acd4283", - "from": "git://github.com/TheBeastLT/parse-torrent-title.git#826ee1a8a832e8c18fcc0703f5b56a8b9acd4283", + "version": "git://github.com/TheBeastLT/parse-torrent-title.git#299b6818907542086ce5d88f11f9359efa145928", + "from": "git://github.com/TheBeastLT/parse-torrent-title.git#299b6818907542086ce5d88f11f9359efa145928", "requires": { "moment": "^2.24.0" } diff --git a/package.json b/package.json index 5fbf3b0..da75343 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "node-schedule": "^1.3.2", "nodejs-bing": "^0.1.0", "parse-torrent": "^6.1.2", - "parse-torrent-title": "git://github.com/TheBeastLT/parse-torrent-title.git#826ee1a8a832e8c18fcc0703f5b56a8b9acd4283", + "parse-torrent-title": "git://github.com/TheBeastLT/parse-torrent-title.git#299b6818907542086ce5d88f11f9359efa145928", "peer-search": "^0.6.x", "pg": "^7.8.2", "pg-hstore": "^2.3.2", diff --git a/scraper/lib/metadata.js b/scraper/lib/metadata.js index 1916f0a..fcb6397 100644 --- a/scraper/lib/metadata.js +++ b/scraper/lib/metadata.js @@ -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}`;