This commit is contained in:
Vito0912 2025-03-19 20:44:55 +01:00
parent a6422bb3fc
commit ad2c5c29e1
No known key found for this signature in database
GPG key ID: 29A3D509FE70B237
3 changed files with 13 additions and 13 deletions

View file

@ -205,8 +205,7 @@ class BookFinder {
*/
async getAudiMetaResults(title, author, asin, provider) {
// Ensure provider is a string (See CodeQL) even though it should be a string anyway
const providerStr = (typeof provider === 'string' ? provider :
(Array.isArray(provider) ? provider[0]?.toString() || '' : '')).toString()
const providerStr = (typeof provider === 'string' ? provider : Array.isArray(provider) ? provider[0]?.toString() || '' : '').toString()
const region = providerStr.includes('.') ? providerStr.split('.').pop() : ''
const books = await this.audiMeta.search(title, author, asin, region, this.#providerResponseTimeout)

View file

@ -41,7 +41,7 @@ class AudiMeta {
}
cleanResult(item) {
const { title, subtitle, asin, authors, narrators, publisherName, summary, releaseDate, imageUrl, genres, series, language, lengthMinutes, bookFormat } = item
const { title, subtitle, asin, authors, narrators, publisherName, summary, releaseDate, imageUrl, genres, series, language, lengthMinutes, bookFormat } = item
const seriesList = []
@ -50,7 +50,7 @@ class AudiMeta {
series: s.name,
sequence: this.cleanSeriesSequence(s.name, (s.position || '').toString())
})
});
})
// Tags and Genres are flipped for AudiMeta
const genresFiltered = genres ? genres.filter((g) => g.type == 'Tags').map((g) => g.name) : []
@ -147,7 +147,8 @@ class AudiMeta {
items = await axios
.get(url, {
timeout
}).then((res) => {
})
.then((res) => {
return res.data
})
.catch((error) => {