Skip to content

Commit

Permalink
Fix:RSS feed parser for episode metadata tags that have attributes #1996
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Oct 28, 2023
1 parent 2c9f2e0 commit 225dcde
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/utils/podcastUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function extractPodcastMetadata(channel) {
arrayFields.forEach((key) => {
const cleanKey = key.split(':').pop()
let value = extractFirstArrayItem(channel, key)
if (value && value['_']) value = value['_']
if (value?.['_']) value = value['_']
metadata[cleanKey] = value
})
return metadata
Expand Down Expand Up @@ -131,7 +131,9 @@ function extractEpisodeData(item) {
const arrayFields = ['title', 'itunes:episodeType', 'itunes:season', 'itunes:episode', 'itunes:author', 'itunes:duration', 'itunes:explicit', 'itunes:subtitle']
arrayFields.forEach((key) => {
const cleanKey = key.split(':').pop()
episode[cleanKey] = extractFirstArrayItem(item, key)
let value = extractFirstArrayItem(item, key)
if (value?.['_']) value = value['_']
episode[cleanKey] = value
})
return episode
}
Expand Down

0 comments on commit 225dcde

Please sign in to comment.