mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-12 15:52:43 +02:00
Support rich text book descriptions
This commit is contained in:
@@ -8,6 +8,7 @@ const AudiobookCovers = require('../providers/AudiobookCovers')
|
||||
const CustomProviderAdapter = require('../providers/CustomProviderAdapter')
|
||||
const Logger = require('../Logger')
|
||||
const { levenshteinDistance, escapeRegExp } = require('../utils/index')
|
||||
const htmlSanitizer = require('../utils/htmlSanitizer')
|
||||
|
||||
class BookFinder {
|
||||
#providerResponseTimeout = 30000
|
||||
@@ -463,6 +464,12 @@ class BookFinder {
|
||||
} else {
|
||||
books = await this.getGoogleBooksResults(title, author)
|
||||
}
|
||||
books.forEach((book) => {
|
||||
if (book.description) {
|
||||
book.description = htmlSanitizer.sanitize(book.description)
|
||||
book.descriptionPlain = htmlSanitizer.stripAllTags(book.description)
|
||||
}
|
||||
})
|
||||
return books
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user