Update Bookfinder.js : getAudibleResults : remove (unabridged)

cleantitle for search in audible as (unabridged) doesn't find anything
This commit is contained in:
Scott Bartuska 2022-06-04 15:56:25 -07:00 committed by GitHub
parent 3d821dacb7
commit 7602d374a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,7 +167,9 @@ class BookFinder {
}
async getAudibleResults(title, author, asin) {
var books = await this.audible.search(title, author, asin);
// cleantitle for search in audible as (unabridged) doesn't find anything
var cleanedTitle = title.replace(/ *\([^)]*\) */g, "")
var books = await this.audible.search(cleanedTitle, author, asin);
if (this.verbose) Logger.debug(`Audible Book Search Results: ${books.length || 0}`)
if (!books) return []
return books
@ -233,4 +235,4 @@ class BookFinder {
return this.audnexus.getChaptersByASIN(asin)
}
}
module.exports = BookFinder
module.exports = BookFinder