mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-26 00:14:49 +01:00
Fix audible match if title or author has special characters
This commit is contained in:
parent
f4ee2889fe
commit
6fb5352ed5
@ -57,9 +57,16 @@ class Audible {
|
|||||||
var items = await this.asinSearch(title)
|
var items = await this.asinSearch(title)
|
||||||
if (items.length > 0) return items.map(item => this.cleanResult(item))
|
if (items.length > 0) return items.map(item => this.cleanResult(item))
|
||||||
}
|
}
|
||||||
var queryString = `response_groups=rating,series,contributors,product_desc,media,product_extended_attrs` +
|
|
||||||
`&image_sizes=500,1024,2000&num_results=25&products_sort_by=Relevance&title=${title}`;
|
var queryObj = {
|
||||||
if (author) queryString += `&author=${author}`
|
response_groups: 'rating,series,contributors,product_desc,media,product_extended_attrs',
|
||||||
|
image_sizes: '500,1024,2000',
|
||||||
|
num_results: '25',
|
||||||
|
products_sort_by: 'Relevance',
|
||||||
|
title: title
|
||||||
|
};
|
||||||
|
if (author) queryObj.author = author
|
||||||
|
var queryString = (new URLSearchParams(queryObj)).toString();
|
||||||
var url = `https://api.audible.com/1.0/catalog/products?${queryString}`
|
var url = `https://api.audible.com/1.0/catalog/products?${queryString}`
|
||||||
Logger.debug(`[Audible] Search url: ${url}`)
|
Logger.debug(`[Audible] Search url: ${url}`)
|
||||||
var items = await axios.get(url).then((res) => {
|
var items = await axios.get(url).then((res) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user