mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-30 18:48:55 +01:00
Update:Max levenshtein distance for matching author names to 3 #572
This commit is contained in:
parent
f34ebdc016
commit
2103edfcdc
@ -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) {
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user