Update:Max levenshtein distance for matching author names to 3 #572

This commit is contained in:
advplyr 2022-05-07 20:01:29 -05:00
parent f34ebdc016
commit 2103edfcdc
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ class AuthorFinder {
async findAuthorByName(name, options = {}) {
if (!name) return null
const maxLevenshtein = !isNaN(options.maxLevenshtein) ? Number(options.maxLevenshtein) : 2
const maxLevenshtein = !isNaN(options.maxLevenshtein) ? Number(options.maxLevenshtein) : 3
var author = await this.audnexus.findAuthorByName(name, maxLevenshtein)
if (!author || !author.name) {

View File

@ -27,7 +27,7 @@ class Audnexus {
})
}
async findAuthorByName(name, maxLevenshtein = 2) {
async findAuthorByName(name, maxLevenshtein = 3) {
Logger.debug(`[Audnexus] Looking up author by name ${name}`)
var asins = await this.authorASINsRequest(name)
var matchingAsin = asins.find(obj => levenshteinDistance(obj.name, name) <= maxLevenshtein)