mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-10-04 11:19:29 +02:00
Shorten timeout and error message for remaining providers
This commit is contained in:
parent
26f949b9ba
commit
c6dabd2620
@ -4,7 +4,7 @@ const Logger = require('../Logger')
|
|||||||
const htmlSanitizer = require('../utils/htmlSanitizer')
|
const htmlSanitizer = require('../utils/htmlSanitizer')
|
||||||
|
|
||||||
class CustomProviderAdapter {
|
class CustomProviderAdapter {
|
||||||
#responseTimeout = 30000
|
#responseTimeout = 10000
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ class CustomProviderAdapter {
|
|||||||
return res.data.matches
|
return res.data.matches
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
Logger.error('[CustomMetadataProvider] Search error', error)
|
Logger.error('[CustomMetadataProvider] Search error', error.message)
|
||||||
return []
|
return []
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ const axios = require('axios')
|
|||||||
const Logger = require('../Logger')
|
const Logger = require('../Logger')
|
||||||
|
|
||||||
class FantLab {
|
class FantLab {
|
||||||
#responseTimeout = 30000
|
#responseTimeout = 10000
|
||||||
// 7 - other
|
// 7 - other
|
||||||
// 11 - essay
|
// 11 - essay
|
||||||
// 12 - article
|
// 12 - article
|
||||||
@ -48,7 +48,7 @@ class FantLab {
|
|||||||
return res.data || []
|
return res.data || []
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
Logger.error('[FantLab] search error', error)
|
Logger.error('[FantLab] search error', error.message)
|
||||||
return []
|
return []
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ class FantLab {
|
|||||||
return resp.data || null
|
return resp.data || null
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
Logger.error(`[FantLab] work info request for url "${url}" error`, error)
|
Logger.error(`[FantLab] work info request for url "${url}" error`, error.message)
|
||||||
return null
|
return null
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ class FantLab {
|
|||||||
return resp.data || null
|
return resp.data || null
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
Logger.error(`[FantLab] search cover from edition with url "${url}" error`, error)
|
Logger.error(`[FantLab] search cover from edition with url "${url}" error`, error.message)
|
||||||
return null
|
return null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ const axios = require('axios')
|
|||||||
const Logger = require('../Logger')
|
const Logger = require('../Logger')
|
||||||
|
|
||||||
class GoogleBooks {
|
class GoogleBooks {
|
||||||
#responseTimeout = 30000
|
#responseTimeout = 10000
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ class GoogleBooks {
|
|||||||
return res.data.items
|
return res.data.items
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
Logger.error('[GoogleBooks] Volume search error', error)
|
Logger.error('[GoogleBooks] Volume search error', error.message)
|
||||||
return []
|
return []
|
||||||
})
|
})
|
||||||
return items.map((item) => this.cleanResult(item))
|
return items.map((item) => this.cleanResult(item))
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
const axios = require('axios').default
|
const axios = require('axios').default
|
||||||
|
|
||||||
class OpenLibrary {
|
class OpenLibrary {
|
||||||
#responseTimeout = 30000
|
#responseTimeout = 10000
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.baseUrl = 'https://openlibrary.org'
|
this.baseUrl = 'https://openlibrary.org'
|
||||||
@ -23,7 +23,7 @@ class OpenLibrary {
|
|||||||
return res.data
|
return res.data
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Failed', error)
|
console.error('Failed', error.message)
|
||||||
return null
|
return null
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ const htmlSanitizer = require('../utils/htmlSanitizer')
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class iTunes {
|
class iTunes {
|
||||||
#responseTimeout = 30000
|
#responseTimeout = 10000
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ class iTunes {
|
|||||||
return response.data.results || []
|
return response.data.results || []
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
Logger.error(`[iTunes] search request error`, error)
|
Logger.error(`[iTunes] search request error`, error.message)
|
||||||
return []
|
return []
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user