mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-01 16:54:59 +02:00
Cleanup audiobookcovers.com addition
This commit is contained in:
parent
1342897858
commit
84839bea44
3 changed files with 10 additions and 14 deletions
|
@ -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 = {}) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue