diff --git a/services/comicvine.service.ts b/services/comicvine.service.ts index b4ea703..8b6eef1 100644 --- a/services/comicvine.service.ts +++ b/services/comicvine.service.ts @@ -1,8 +1,5 @@ "use strict"; -import { createWriteStream } from "fs"; -import path from "path"; -import https from "https"; import { Service, ServiceBroker, Context } from "moleculer"; import axios from "axios"; import leven from "leven"; diff --git a/utils/searchmatchscorer.utils.ts b/utils/searchmatchscorer.utils.ts index bd81cf4..37b82bd 100644 --- a/utils/searchmatchscorer.utils.ts +++ b/utils/searchmatchscorer.utils.ts @@ -35,7 +35,7 @@ import { createWriteStream } from "fs"; import path from "path"; import https from "https"; import stringSimilarity from "string-similarity"; -import { each, isNil, map, isNull, isUndefined } from "lodash"; +import { isNil, map, isUndefined } from "lodash"; import leven from "leven"; const imghash = require("imghash"); @@ -100,14 +100,14 @@ const calculateLevenshteinDistance = async (match: any, rawFileDetails: any) => if (!isUndefined(hash1) && !isUndefined(hash2)) { const levenshteinDistance = leven(hash1, hash2); if (levenshteinDistance === 0) { - match.score += 4; + match.score += 2; } else if ( levenshteinDistance > 0 && levenshteinDistance <= 2 ) { - match.score += 2; + match.score += 1; } else { - match.score -= 4; + match.score -= 2; } resolve(match); } else {