+
diff --git a/server/finders/BookFinder.js b/server/finders/BookFinder.js
index 7716301f..94981d14 100644
--- a/server/finders/BookFinder.js
+++ b/server/finders/BookFinder.js
@@ -163,12 +163,8 @@ class BookFinder {
async getAudiobookCoversResults(search) {
const covers = await this.audiobookCovers.search(search)
- if (this.verbose) Logger.debug(`AudiobookCovers Book Search Results: ${books.length || 0}`)
- if (covers.errorCode) {
- Logger.error(`AusiobookCovers Search Error ${books.errorCode}`)
- return []
- }
- return covers
+ if (this.verbose) Logger.debug(`AudiobookCovers Search Results: ${covers.length || 0}`)
+ return covers || []
}
async getiTunesAudiobooksResults(title, author) {
@@ -206,8 +202,6 @@ class BookFinder {
books = await this.getGoogleBooksResults(title, author)
}
- console.log(books)
-
if (!books.length && !options.currentlyTryingCleaned) {
var cleanedTitle = this.cleanTitleForCompares(title)
var cleanedAuthor = this.cleanAuthorForCompares(author)
@@ -218,11 +212,13 @@ class BookFinder {
return this.search(provider, cleanedTitle, cleanedAuthor, isbn, asin, options)
}
- if (["google", "audible", "itunes", 'fantlab'].includes(provider)) return books
+ if (provider === 'openlibrary') {
+ books.sort((a, b) => {
+ return a.totalDistance - b.totalDistance
+ })
+ }
- return books.sort((a, b) => {
- return a.totalDistance - b.totalDistance
- })
+ return books
}
async findCovers(provider, title, author, options = {}) {
diff --git a/server/providers/AudiobookCovers.js b/server/providers/AudiobookCovers.js
index ea03a9d2..edb1b199 100644
--- a/server/providers/AudiobookCovers.js
+++ b/server/providers/AudiobookCovers.js
@@ -14,7 +14,7 @@ class AudiobookCovers {
Logger.error('[AudiobookCovers] Cover search error', error)
return []
})
- return items.map(item => { return { cover: item.filename } })
+ return items.map(item => ({ cover: item.filename }))
}
}