diff --git a/components/tables/podcast/EpisodesTable.vue b/components/tables/podcast/EpisodesTable.vue
index c2a1949a..5a62ea52 100644
--- a/components/tables/podcast/EpisodesTable.vue
+++ b/components/tables/podcast/EpisodesTable.vue
@@ -50,7 +50,7 @@
-
+
@@ -79,9 +79,6 @@ export default {
episodesCopy: [],
showFiltersModal: false,
showSortModal: false,
- sortKey: this.$store.state.user.settings.podcastEpisodesOrderBy || 'publishedAt',
- sortDesc: this.$store.state.user.settings.podcastEpisodesOrderDesc,
- filterKey: this.$store.state.user.settings.podcastEpisodesFilterBy || 'incomplete',
fetchingRSSFeed: false,
podcastFeedEpisodes: [],
showPodcastEpisodeFeed: false,
@@ -223,6 +220,27 @@ export default {
if (!this.sortKey) return ''
const _sel = this.episodeSortItems.find((i) => i.value === this.sortKey)
return _sel?.text || ''
+ },
+ filterKey() {
+ return this.$store.getters['user/getUserSetting']('podcastEpisodesFilterBy') || 'incomplete'
+ },
+ sortKey: {
+ get() {
+ return this.$store.getters['user/getUserSetting']('podcastEpisodesOrderBy') || 'publishedAt'
+ },
+ set(val) {
+ this.$store.dispatch('user/updateUserSettings', { podcastEpisodesOrderBy: val })
+ }
+ },
+ sortDesc: {
+ get() {
+ const desc = this.$store.getters['user/getUserSetting']('podcastEpisodesOrderDesc')
+ if (desc === null || desc === undefined) return this.mediaMetadata.type === 'episodic'
+ return desc
+ },
+ set(val) {
+ this.$store.dispatch('user/updateUserSettings', { podcastEpisodesOrderDesc: val })
+ }
}
},
methods: {
@@ -277,13 +295,9 @@ export default {
this.$store.commit('globals/setShowPlaylistsAddCreateModal', true)
},
setFilter(filter) {
- this.filterKey = filter
this.showFiltersModal = false
this.$store.dispatch('user/updateUserSettings', { podcastEpisodesFilterBy: filter })
},
- saveSort() {
- this.$store.dispatch('user/updateUserSettings', { podcastEpisodesOrderBy: this.sortKey, podcastEpisodesOrderDesc: this.sortDesc })
- },
showFilters() {
this.showFiltersModal = true
},
@@ -318,12 +332,8 @@ export default {
}
},
mounted() {
- if (this.sortDesc === null || this.sortDesc === undefined) {
- this.sortDesc = this.mediaMetadata.type === 'episodic'
- }
-
if (this.$route.query['episodefilter'] === 'downloaded') {
- this.filterKey = 'downloaded'
+ this.$store.dispatch('user/updateUserSettings', { podcastEpisodesFilterBy: 'downloaded' })
}
this.$socket.$on('episode_download_queued', this.episodeDownloadQueued)
this.$socket.$on('episode_download_started', this.episodeDownloadStarted)