mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-17 00:08:55 +01:00
Trim podcast descriptions #3720
This commit is contained in:
parent
858d697d0f
commit
63b3f22504
@ -59,8 +59,8 @@ function extractPodcastMetadata(channel) {
|
|||||||
|
|
||||||
if (channel['description']) {
|
if (channel['description']) {
|
||||||
const rawDescription = extractFirstArrayItem(channel, 'description') || ''
|
const rawDescription = extractFirstArrayItem(channel, 'description') || ''
|
||||||
metadata.description = htmlSanitizer.sanitize(rawDescription)
|
metadata.description = htmlSanitizer.sanitize(rawDescription.trim())
|
||||||
metadata.descriptionPlain = htmlSanitizer.stripAllTags(rawDescription)
|
metadata.descriptionPlain = htmlSanitizer.stripAllTags(rawDescription.trim())
|
||||||
}
|
}
|
||||||
|
|
||||||
const arrayFields = ['title', 'language', 'itunes:explicit', 'itunes:author', 'pubDate', 'link', 'itunes:type']
|
const arrayFields = ['title', 'language', 'itunes:explicit', 'itunes:author', 'pubDate', 'link', 'itunes:type']
|
||||||
@ -103,8 +103,8 @@ function extractEpisodeData(item) {
|
|||||||
// Supposed to be the plaintext description but not always followed
|
// Supposed to be the plaintext description but not always followed
|
||||||
if (item['description']) {
|
if (item['description']) {
|
||||||
const rawDescription = extractFirstArrayItem(item, 'description') || ''
|
const rawDescription = extractFirstArrayItem(item, 'description') || ''
|
||||||
if (!episode.description) episode.description = htmlSanitizer.sanitize(rawDescription)
|
if (!episode.description) episode.description = htmlSanitizer.sanitize(rawDescription.trim())
|
||||||
episode.descriptionPlain = htmlSanitizer.stripAllTags(rawDescription)
|
episode.descriptionPlain = htmlSanitizer.stripAllTags(rawDescription.trim())
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item['pubDate']) {
|
if (item['pubDate']) {
|
||||||
|
Loading…
Reference in New Issue
Block a user