Add support for seasonal podcasts

Podcasts such as [Command Line Heroes](https://podcasts.apple.com/us/podcast/command-line-heroes/id1319947289) have multiple seasons in which each has it's own , . This seaks to add support for such podcast series.
This commit is contained in:
jflattery 2022-05-04 14:14:09 +00:00
parent ef0243f1d7
commit cc285bb685
5 changed files with 17 additions and 1 deletions

View file

@ -9,6 +9,7 @@ class PodcastEpisode {
this.id = null
this.index = null
this.season = null
this.episode = null
this.episodeType = null
this.title = null
@ -31,6 +32,7 @@ class PodcastEpisode {
this.libraryItemId = episode.libraryItemId
this.id = episode.id
this.index = episode.index
this.season = episode.season
this.episode = episode.episode
this.episodeType = episode.episodeType
this.title = episode.title
@ -51,6 +53,7 @@ class PodcastEpisode {
libraryItemId: this.libraryItemId,
id: this.id,
index: this.index,
season: this.season,
episode: this.episode,
episodeType: this.episodeType,
title: this.title,
@ -70,6 +73,7 @@ class PodcastEpisode {
libraryItemId: this.libraryItemId,
id: this.id,
index: this.index,
season: this.season,
episode: this.episode,
episodeType: this.episodeType,
title: this.title,
@ -117,6 +121,7 @@ class PodcastEpisode {
this.pubDate = data.pubDate || ''
this.description = data.description || ''
this.enclosure = data.enclosure ? { ...data.enclosure } : null
this.season = data.season || ''
this.episode = data.episode || ''
this.episodeType = data.episodeType || ''
this.publishedAt = data.publishedAt || 0

View file

@ -85,7 +85,7 @@ function extractEpisodeData(item) {
episode.descriptionPlain = stripHtml(episode.description || '').result
}
var arrayFields = ['title', 'pubDate', 'itunes:episodeType', 'itunes:episode', 'itunes:author', 'itunes:duration', 'itunes:explicit', 'itunes:subtitle']
var arrayFields = ['title', 'pubDate', 'itunes:episodeType', 'season', 'itunes:episode', 'itunes:author', 'itunes:duration', 'itunes:explicit', 'itunes:subtitle']
arrayFields.forEach((key) => {
var cleanKey = key.split(':').pop()
episode[cleanKey] = extractFirstArrayItem(item, key)
@ -101,6 +101,7 @@ function cleanEpisodeData(data) {
descriptionPlain: data.descriptionPlain || '',
pubDate: data.pubDate || '',
episodeType: data.episodeType || '',
season: data.season || '',
episode: data.episode || '',
author: data.author || '',
duration: data.duration || '',