mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-16 01:57:48 +02:00
Add:HTML sanitizer lib to support html in podcasts and replace strip html lib
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
const axios = require('axios')
|
||||
const Logger = require('../Logger')
|
||||
const { stripHtml } = require('string-strip-html')
|
||||
const htmlSanitizer = require('../utils/htmlSanitizer')
|
||||
|
||||
class iTunes {
|
||||
constructor() { }
|
||||
|
||||
@ -64,7 +65,7 @@ class iTunes {
|
||||
artistId: data.artistId,
|
||||
title: data.collectionName,
|
||||
author: data.artistName,
|
||||
description: stripHtml(data.description || '').result,
|
||||
description: htmlSanitizer.stripAllTags(data.description || ''),
|
||||
publishedYear: data.releaseDate ? data.releaseDate.split('-')[0] : null,
|
||||
genres: data.primaryGenreName ? [data.primaryGenreName] : [],
|
||||
cover: this.getCoverArtwork(data)
|
||||
@ -83,7 +84,8 @@ class iTunes {
|
||||
artistId: data.artistId || null,
|
||||
title: data.collectionName,
|
||||
artistName: data.artistName,
|
||||
description: stripHtml(data.description || '').result,
|
||||
description: htmlSanitizer.sanitize(data.description || ''),
|
||||
descriptionPlain: htmlSanitizer.stripAllTags(data.description || ''),
|
||||
releaseDate: data.releaseDate,
|
||||
genres: data.genres || [],
|
||||
cover: this.getCoverArtwork(data),
|
||||
|
Reference in New Issue
Block a user