Updated matching with latest changes, Added override toggle for quickmatch, added asin and isbn to quickmatch query, updated audible provider to use audnexus

This commit is contained in:
Kaldigo 2022-05-23 03:56:51 +01:00
parent f2e16017f6
commit d15264832d
8 changed files with 192 additions and 98 deletions

View file

@ -166,14 +166,14 @@ class BookFinder {
return this.iTunesApi.searchAudiobooks(title)
}
async getAudibleResults(title, author) {
var books = await this.audible.search(title, author);
async getAudibleResults(title, author, asin) {
var books = await this.audible.search(title, author, asin);
if (this.verbose) Logger.debug(`Audible Book Search Results: ${books.length || 0}`)
if (!books) return []
return books
}
async search(provider, title, author, options = {}) {
async search(provider, title, author, isbn, asin, options = {}) {
var books = []
var maxTitleDistance = !isNaN(options.titleDistance) ? Number(options.titleDistance) : 4
var maxAuthorDistance = !isNaN(options.authorDistance) ? Number(options.authorDistance) : 4
@ -182,7 +182,7 @@ class BookFinder {
if (provider === 'google') {
return this.getGoogleBooksResults(title, author)
} else if (provider === 'audible') {
return this.getAudibleResults(title, author)
return this.getAudibleResults(title, author, asin)
} else if (provider === 'itunes') {
return this.getiTunesAudiobooksResults(title, author)
} else if (provider === 'libgen') {