Fix:Podcast pubDate parsing #1116

This commit is contained in:
advplyr 2022-11-06 15:43:17 -06:00
parent 8319891c96
commit 3282ac67e4

View File

@ -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}`)
}