From cc285bb685299909cfa05d5805d6c93fb1e601df Mon Sep 17 00:00:00 2001
From: jflattery <6561797+jflattery@users.noreply.github.com>
Date: Wed, 4 May 2022 14:14:09 +0000
Subject: [PATCH 1/2] 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.
---
client/components/controls/EpisodeSortSelect.vue | 4 ++++
client/components/modals/podcast/EditEpisode.vue | 5 +++++
client/components/tables/podcast/EpisodeTableRow.vue | 1 +
server/objects/entities/PodcastEpisode.js | 5 +++++
server/utils/podcastUtils.js | 3 ++-
5 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/client/components/controls/EpisodeSortSelect.vue b/client/components/controls/EpisodeSortSelect.vue
index 0a1981fc..27aced3f 100644
--- a/client/components/controls/EpisodeSortSelect.vue
+++ b/client/components/controls/EpisodeSortSelect.vue
@@ -40,6 +40,10 @@ export default {
text: 'Title',
value: 'title'
},
+ {
+ text: 'Season',
+ value: 'season'
+ },
{
text: 'Episode',
value: 'episode'
diff --git a/client/components/modals/podcast/EditEpisode.vue b/client/components/modals/podcast/EditEpisode.vue
index 8f0134f1..57b946b4 100644
--- a/client/components/modals/podcast/EditEpisode.vue
+++ b/client/components/modals/podcast/EditEpisode.vue
@@ -7,6 +7,9 @@
+
+
+
@@ -39,6 +42,7 @@ export default {
return {
processing: false,
newEpisode: {
+ season: null,
episode: null,
episodeType: null,
title: null,
@@ -92,6 +96,7 @@ export default {
}
},
init() {
+ this.newEpisode.season = this.episode.season || ''
this.newEpisode.episode = this.episode.episode || ''
this.newEpisode.episodeType = this.episode.episodeType || ''
this.newEpisode.title = this.episode.title || ''
diff --git a/client/components/tables/podcast/EpisodeTableRow.vue b/client/components/tables/podcast/EpisodeTableRow.vue
index da71524f..bcb64ecc 100644
--- a/client/components/tables/podcast/EpisodeTableRow.vue
+++ b/client/components/tables/podcast/EpisodeTableRow.vue
@@ -20,6 +20,7 @@
+
Season #{{ episode.season }}
Episode #{{ episode.episode }}
Published {{ $formatDate(publishedAt, 'MMM do, yyyy') }}
diff --git a/server/objects/entities/PodcastEpisode.js b/server/objects/entities/PodcastEpisode.js
index 6c6b956b..28c232d2 100644
--- a/server/objects/entities/PodcastEpisode.js
+++ b/server/objects/entities/PodcastEpisode.js
@@ -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
diff --git a/server/utils/podcastUtils.js b/server/utils/podcastUtils.js
index 69cc2459..839aeadb 100644
--- a/server/utils/podcastUtils.js
+++ b/server/utils/podcastUtils.js
@@ -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 || '',
From 6b98baafdf97d9343b84735b8435870dacbc6137 Mon Sep 17 00:00:00 2001
From: jflattery <6561797+jflattery@users.noreply.github.com>
Date: Thu, 5 May 2022 13:38:00 +0000
Subject: [PATCH 2/2] Resolve @advplyr's feedback
Add 'itunes' tag to 'season' and fix display formating
---
client/components/modals/podcast/EditEpisode.vue | 8 ++++----
server/utils/podcastUtils.js | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/client/components/modals/podcast/EditEpisode.vue b/client/components/modals/podcast/EditEpisode.vue
index 57b946b4..dbf76bf7 100644
--- a/client/components/modals/podcast/EditEpisode.vue
+++ b/client/components/modals/podcast/EditEpisode.vue
@@ -7,16 +7,16 @@
-
+
-
+
-
+
-
+
diff --git a/server/utils/podcastUtils.js b/server/utils/podcastUtils.js
index 839aeadb..28c874cc 100644
--- a/server/utils/podcastUtils.js
+++ b/server/utils/podcastUtils.js
@@ -85,7 +85,7 @@ function extractEpisodeData(item) {
episode.descriptionPlain = stripHtml(episode.description || '').result
}
- var arrayFields = ['title', 'pubDate', 'itunes:episodeType', 'season', 'itunes:episode', 'itunes:author', 'itunes:duration', 'itunes:explicit', 'itunes:subtitle']
+ var arrayFields = ['title', 'pubDate', 'itunes:episodeType', 'itunes:season', 'itunes:episode', 'itunes:author', 'itunes:duration', 'itunes:explicit', 'itunes:subtitle']
arrayFields.forEach((key) => {
var cleanKey = key.split(':').pop()
episode[cleanKey] = extractFirstArrayItem(item, key)