mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-02-19 00:18:56 +01:00
Use region for author queries
This commit is contained in:
parent
2ae3ea346f
commit
a3e63e03d2
@ -9,7 +9,8 @@ class Audnexus {
|
|||||||
|
|
||||||
authorASINsRequest(name) {
|
authorASINsRequest(name) {
|
||||||
name = encodeURIComponent(name);
|
name = encodeURIComponent(name);
|
||||||
return axios.get(`${this.baseUrl}/authors?name=${name}`).then((res) => {
|
var regionQuery = region ? `®ion=${region}` : ''
|
||||||
|
return axios.get(`${this.baseUrl}/authors?name=${name}${regionQuery}`).then((res) => {
|
||||||
return res.data || []
|
return res.data || []
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
Logger.error(`[Audnexus] Author ASIN request failed for ${name}`, error)
|
Logger.error(`[Audnexus] Author ASIN request failed for ${name}`, error)
|
||||||
@ -19,7 +20,8 @@ class Audnexus {
|
|||||||
|
|
||||||
authorRequest(asin) {
|
authorRequest(asin) {
|
||||||
asin = encodeURIComponent(asin);
|
asin = encodeURIComponent(asin);
|
||||||
return axios.get(`${this.baseUrl}/authors/${asin}`).then((res) => {
|
var regionQuery = region ? `?region=${region}` : ''
|
||||||
|
return axios.get(`${this.baseUrl}/authors/${asin}${regionQuery}`).then((res) => {
|
||||||
return res.data
|
return res.data
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
Logger.error(`[Audnexus] Author request failed for ${asin}`, error)
|
Logger.error(`[Audnexus] Author request failed for ${asin}`, error)
|
||||||
|
Loading…
Reference in New Issue
Block a user