Add:Select cover search provider, Add:Persist selected provider, Change:API routes for searching

This commit is contained in:
advplyr 2021-12-07 18:42:56 -06:00
parent bb1a5b2e6d
commit c5465ad8e0
4 changed files with 82 additions and 26 deletions

View file

@ -147,7 +147,7 @@ class BookFinder {
return booksFiltered
}
async getGoogleBooksResults(title, author, maxTitleDistance, maxAuthorDistance) {
async getGoogleBooksResults(title, author) {
var books = await this.googleBooks.search(title, author)
if (this.verbose) Logger.debug(`GoogleBooks Book Search Results: ${books.length || 0}`)
if (books.errorCode) {
@ -158,7 +158,7 @@ class BookFinder {
return books
}
async getAudibleResults(title, author, maxTitleDistance, maxAuthorDistance) {
async getAudibleResults(title, author) {
var books = await this.audible.search(title, author);
if (this.verbose) Logger.debug(`Audible Book Search Results: ${books.length || 0}`)
if (!books) return []
@ -172,9 +172,9 @@ class BookFinder {
Logger.debug(`Book Search: title: "${title}", author: "${author}", provider: ${provider}`)
if (provider === 'google') {
return this.getGoogleBooksResults(title, author, maxTitleDistance, maxAuthorDistance)
return this.getGoogleBooksResults(title, author)
} else if (provider === 'audible') {
return this.getAudibleResults(title, author, maxTitleDistance, maxAuthorDistance)
return this.getAudibleResults(title, author)
} else if (provider === 'libgen') {
books = await this.getLibGenResults(title, author, maxTitleDistance, maxAuthorDistance)
} else if (provider === 'openlibrary') {