Only consider an Audible ASIN query successful if the response contains an author

This commit is contained in:
Selfhost Alt 2022-04-16 11:55:58 -07:00
parent d6c5b6e8c6
commit cdcfd01da2

View File

@ -50,7 +50,7 @@ class Audible {
var url = `https://api.audible.com/1.0/catalog/products/${asin}?${queryString}`
Logger.debug(`[Audible] ASIN url: ${url}`)
return axios.get(url).then((res) => {
if (!res || !res.data || !res.data.product) return []
if (!res || !res.data || !res.data.product || !res.data.product.authors) return []
return [res.data.product]
}).catch(error => {
Logger.error('[Audible] search error', error)