mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-10-04 11:19:29 +02:00
Reduce provider timout to 10 secs, Shorten error message
This commit is contained in:
parent
03da194953
commit
a164c17d38
@ -11,7 +11,7 @@ const { levenshteinDistance, levenshteinSimilarity, escapeRegExp, isValidASIN }
|
||||
const htmlSanitizer = require('../utils/htmlSanitizer')
|
||||
|
||||
class BookFinder {
|
||||
#providerResponseTimeout = 30000
|
||||
#providerResponseTimeout = 10000
|
||||
|
||||
constructor() {
|
||||
this.openLibrary = new OpenLibrary()
|
||||
|
@ -3,7 +3,7 @@ const Logger = require('../Logger')
|
||||
const { isValidASIN } = require('../utils/index')
|
||||
|
||||
class Audible {
|
||||
#responseTimeout = 30000
|
||||
#responseTimeout = 10000
|
||||
|
||||
constructor() {
|
||||
this.regionMap = {
|
||||
@ -106,7 +106,7 @@ class Audible {
|
||||
return res.data
|
||||
})
|
||||
.catch((error) => {
|
||||
Logger.error('[Audible] ASIN search error', error)
|
||||
Logger.error('[Audible] ASIN search error', error.message)
|
||||
return null
|
||||
})
|
||||
}
|
||||
@ -158,7 +158,7 @@ class Audible {
|
||||
return Promise.all(res.data.products.map((result) => this.asinSearch(result.asin, region, timeout)))
|
||||
})
|
||||
.catch((error) => {
|
||||
Logger.error('[Audible] query search error', error)
|
||||
Logger.error('[Audible] query search error', error.message)
|
||||
return []
|
||||
})
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ const axios = require('axios')
|
||||
const Logger = require('../Logger')
|
||||
|
||||
class AudiobookCovers {
|
||||
#responseTimeout = 30000
|
||||
#responseTimeout = 10000
|
||||
|
||||
constructor() {}
|
||||
|
||||
@ -24,7 +24,7 @@ class AudiobookCovers {
|
||||
})
|
||||
.then((res) => res?.data || [])
|
||||
.catch((error) => {
|
||||
Logger.error('[AudiobookCovers] Cover search error', error)
|
||||
Logger.error('[AudiobookCovers] Cover search error', error.message)
|
||||
return []
|
||||
})
|
||||
return items.map((item) => ({ cover: item.versions.png.original }))
|
||||
|
@ -55,7 +55,7 @@ class Audnexus {
|
||||
return this._processRequest(this.limiter(() => axios.get(authorRequestUrl)))
|
||||
.then((res) => res.data || [])
|
||||
.catch((error) => {
|
||||
Logger.error(`[Audnexus] Author ASIN request failed for ${name}`, error)
|
||||
Logger.error(`[Audnexus] Author ASIN request failed for ${name}`, error.message)
|
||||
return []
|
||||
})
|
||||
}
|
||||
@ -82,7 +82,7 @@ class Audnexus {
|
||||
return this._processRequest(this.limiter(() => axios.get(authorRequestUrl.toString())))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
Logger.error(`[Audnexus] Author request failed for ${asin}`, error)
|
||||
Logger.error(`[Audnexus] Author request failed for ${asin}`, error.message)
|
||||
return null
|
||||
})
|
||||
}
|
||||
@ -158,7 +158,7 @@ class Audnexus {
|
||||
return this._processRequest(this.limiter(() => axios.get(chaptersRequestUrl.toString())))
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
Logger.error(`[Audnexus] Chapter ASIN request failed for ${asin}/${region}`, error)
|
||||
Logger.error(`[Audnexus] Chapter ASIN request failed for ${asin}/${region}`, error.message)
|
||||
return null
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user