mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-06 07:59:43 +00:00
fixed CodeQL
This commit is contained in:
parent
e59225190e
commit
a6422bb3fc
1 changed files with 5 additions and 1 deletions
|
|
@ -204,7 +204,11 @@ class BookFinder {
|
||||||
* @returns {Promise<Object[]>}
|
* @returns {Promise<Object[]>}
|
||||||
*/
|
*/
|
||||||
async getAudiMetaResults(title, author, asin, provider) {
|
async getAudiMetaResults(title, author, asin, provider) {
|
||||||
const region = provider.includes('.') ? provider.split('.').pop() : ''
|
// 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 region = providerStr.includes('.') ? providerStr.split('.').pop() : ''
|
||||||
const books = await this.audiMeta.search(title, author, asin, region, this.#providerResponseTimeout)
|
const books = await this.audiMeta.search(title, author, asin, region, this.#providerResponseTimeout)
|
||||||
if (this.verbose) Logger.debug(`Audible Book Search Results: ${books.length || 0}`)
|
if (this.verbose) Logger.debug(`Audible Book Search Results: ${books.length || 0}`)
|
||||||
if (!books) return []
|
if (!books) return []
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue