Skip to content

Commit

Permalink
Fix:Podcast pubDate parsing advplyr#1116
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Nov 6, 2022
1 parent 8319891 commit 3282ac6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions server/utils/podcastUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,11 @@ function extractEpisodeData(item) {
}

if (item['pubDate']) {
if (typeof item['pubDate'] === 'string') {
episode.pubDate = item['pubDate']
} else if (Array.isArray(item['pubDate'])) {
const pubDateObj = extractFirstArrayItem(item, 'pubDate')
if (pubDateObj && typeof pubDateObj._ === 'string') {
episode.pubDate = pubDateObj._
}
const pubDate = extractFirstArrayItem(item, 'pubDate')
if (typeof pubDate === 'string') {
episode.pubDate = pubDate
} else if (pubDate && typeof pubDate._ === 'string') {
episode.pubDate = pubDate._
} else {
Logger.error(`[podcastUtils] Invalid pubDate ${item['pubDate']} for ${episode.enclosure.url}`)
}
Expand Down

0 comments on commit 3282ac6

Please sign in to comment.