Fix:RSS feed parser for episode metadata tags that have attributes #1996

This commit is contained in:
advplyr 2023-10-28 16:11:15 -05:00
parent 2c9f2e0d68
commit 225dcdeafd

View File

@ -66,7 +66,7 @@ function extractPodcastMetadata(channel) {
arrayFields.forEach((key) => { arrayFields.forEach((key) => {
const cleanKey = key.split(':').pop() const cleanKey = key.split(':').pop()
let value = extractFirstArrayItem(channel, key) let value = extractFirstArrayItem(channel, key)
if (value && value['_']) value = value['_'] if (value?.['_']) value = value['_']
metadata[cleanKey] = value metadata[cleanKey] = value
}) })
return metadata return metadata
@ -131,7 +131,9 @@ function extractEpisodeData(item) {
const arrayFields = ['title', 'itunes:episodeType', 'itunes:season', 'itunes:episode', 'itunes:author', 'itunes:duration', 'itunes:explicit', 'itunes:subtitle'] const arrayFields = ['title', 'itunes:episodeType', 'itunes:season', 'itunes:episode', 'itunes:author', 'itunes:duration', 'itunes:explicit', 'itunes:subtitle']
arrayFields.forEach((key) => { arrayFields.forEach((key) => {
const cleanKey = key.split(':').pop() const cleanKey = key.split(':').pop()
episode[cleanKey] = extractFirstArrayItem(item, key) let value = extractFirstArrayItem(item, key)
if (value?.['_']) value = value['_']
episode[cleanKey] = value
}) })
return episode return episode
} }