Add support to podcast type

This commit is contained in:
mfcar
2023-02-22 18:22:52 +00:00
parent 8c84640484
commit b1ee54522a
16 changed files with 77 additions and 22 deletions

View File

@ -46,7 +46,8 @@ function extractPodcastMetadata(channel) {
categories: extractCategories(channel),
feedUrl: null,
description: null,
descriptionPlain: null
descriptionPlain: null,
type: null
}
if (channel['itunes:new-feed-url']) {
@ -61,7 +62,7 @@ function extractPodcastMetadata(channel) {
metadata.descriptionPlain = htmlSanitizer.stripAllTags(rawDescription)
}
var arrayFields = ['title', 'language', 'itunes:explicit', 'itunes:author', 'pubDate', 'link']
var arrayFields = ['title', 'language', 'itunes:explicit', 'itunes:author', 'pubDate', 'link', 'itunes:type']
arrayFields.forEach((key) => {
var cleanKey = key.split(':').pop()
metadata[cleanKey] = extractFirstArrayItem(channel, key)
@ -258,4 +259,4 @@ module.exports.findMatchingEpisodesInFeed = (feed, searchTitle) => {
}
})
return matches.sort((a, b) => a.levenshtein - b.levenshtein)
}
}