From 96cd91a385b37f1296bca70d0e3e401249999ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rasmus=20Kr=C3=A4mer?= Date: Sat, 9 Apr 2022 11:44:31 +0200 Subject: [PATCH] Added select all episodes option to episode feed --- .../components/modals/podcast/EpisodeFeed.vue | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/client/components/modals/podcast/EpisodeFeed.vue b/client/components/modals/podcast/EpisodeFeed.vue index a37f0ea2..8ca563c7 100644 --- a/client/components/modals/podcast/EpisodeFeed.vue +++ b/client/components/modals/podcast/EpisodeFeed.vue @@ -29,6 +29,14 @@
+
+
+ +
+
+

Select all episodes

+
+
{{ buttonText }}
@@ -67,6 +75,20 @@ export default { if (!this.libraryItem) return '' return this.libraryItem.media.metadata.title || 'Unknown' }, + allSelected() { + try { + const values = Object.values(this.selectedEpisodes).filter((_, index) => !(this.episodes[index].enclosure && this.itemEpisodeMap[this.episodes[index].enclosure.url])) + + if(!values.length) return false + return values.filter(episode => !episode).length === 0 + } catch(error) { + console.error("Error while filtering selected episodes", error); + return false + } + }, + allDownloaded() { + return Object.values(this.episodes).filter(episode => !(episode.enclosure && this.itemEpisodeMap[episode.enclosure.url])).length === 0 + }, episodesSelected() { return Object.keys(this.selectedEpisodes).filter((key) => !!this.selectedEpisodes[key]) },