mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-03 21:54:53 -04:00
[enhancement] Reduce spurious matches in validateAuthor
This commit is contained in:
parent
bf9f3895db
commit
b0b7a0a618
@ -279,9 +279,10 @@ class BookFinder {
|
|||||||
if (cleanAuthor) this.candidates.add(cleanAuthor)
|
if (cleanAuthor) this.candidates.add(cleanAuthor)
|
||||||
}
|
}
|
||||||
|
|
||||||
validateAuthor(name, region = '', maxLevenshtein = 3) {
|
validateAuthor(name, region = '', maxLevenshtein = 2) {
|
||||||
return this.bookFinder.audnexus.authorASINsRequest(name, region).then((asins) => {
|
return this.bookFinder.audnexus.authorASINsRequest(name, region).then((asins) => {
|
||||||
for (const asin of asins) {
|
for (const [i, asin] of asins.entries()) {
|
||||||
|
if (i > 10) break
|
||||||
let cleanName = this.bookFinder.cleanAuthorForCompares(asin.name)
|
let cleanName = this.bookFinder.cleanAuthorForCompares(asin.name)
|
||||||
if (!cleanName) continue
|
if (!cleanName) continue
|
||||||
if (cleanName.includes(name)) return name
|
if (cleanName.includes(name)) return name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user