From 67fbeeeb6c3f1a12980d9849e3193f280344263b Mon Sep 17 00:00:00 2001 From: Andrei Costescu Date: Sat, 18 Jul 2026 18:07:14 +0200 Subject: [PATCH 1/4] Remember sort & filter options for podcast episodes --- components/tables/podcast/EpisodesTable.vue | 17 ++++++++++++----- store/user.js | 5 ++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/components/tables/podcast/EpisodesTable.vue b/components/tables/podcast/EpisodesTable.vue index dad3e06c..c2a1949a 100644 --- a/components/tables/podcast/EpisodesTable.vue +++ b/components/tables/podcast/EpisodesTable.vue @@ -50,7 +50,7 @@ - + @@ -79,9 +79,9 @@ export default { episodesCopy: [], showFiltersModal: false, showSortModal: false, - sortKey: 'publishedAt', - sortDesc: true, - filterKey: 'incomplete', + 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, @@ -279,6 +279,10 @@ export default { 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 @@ -291,7 +295,6 @@ export default { return this.$store.getters['user/getUserMediaProgress'](this.libraryItemId, episode.id) }, init() { - this.sortDesc = this.mediaMetadata.type === 'episodic' this.episodesCopy = this.episodes.map((ep) => { return { ...ep } }) @@ -315,6 +318,10 @@ 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' } diff --git a/store/user.js b/store/user.js index 5b9951c9..bf13390f 100644 --- a/store/user.js +++ b/store/user.js @@ -12,7 +12,10 @@ export const state = () => ({ mobileFilterBy: 'all', playbackRate: 1, collapseSeries: false, - collapseBookSeries: false + collapseBookSeries: false, + podcastEpisodesOrderBy: 'publishedAt', + podcastEpisodesOrderDesc: null, + podcastEpisodesFilterBy: 'incomplete' } }) From 77261920083c96994babc2d7a1e2fefacf311ae9 Mon Sep 17 00:00:00 2001 From: Andrei Costescu Date: Tue, 21 Jul 2026 20:53:58 +0200 Subject: [PATCH 2/4] Align with codebase --- components/tables/podcast/EpisodesTable.vue | 36 +++++++++++++-------- 1 file changed, 23 insertions(+), 13 deletions(-) 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) From 9562e8f25271693116060a77dc1d309c081a5a0e Mon Sep 17 00:00:00 2001 From: Andrei Costescu Date: Tue, 21 Jul 2026 21:05:27 +0200 Subject: [PATCH 3/4] Fix ascending bug --- components/tables/podcast/EpisodesTable.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/tables/podcast/EpisodesTable.vue b/components/tables/podcast/EpisodesTable.vue index 5a62ea52..a33f58df 100644 --- a/components/tables/podcast/EpisodesTable.vue +++ b/components/tables/podcast/EpisodesTable.vue @@ -234,7 +234,7 @@ export default { }, sortDesc: { get() { - const desc = this.$store.getters['user/getUserSetting']('podcastEpisodesOrderDesc') + const desc = this.$store.state.user.settings.podcastEpisodesOrderDesc if (desc === null || desc === undefined) return this.mediaMetadata.type === 'episodic' return desc }, From 8b70d023326f96c9da21ab3f2e83e1e25d274ab9 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sun, 2 Aug 2026 17:43:45 -0500 Subject: [PATCH 4/4] Fix getUserSetting incorrectly returning null for all falsy values --- components/tables/podcast/EpisodesTable.vue | 4 ++-- store/user.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/tables/podcast/EpisodesTable.vue b/components/tables/podcast/EpisodesTable.vue index a33f58df..5603e863 100644 --- a/components/tables/podcast/EpisodesTable.vue +++ b/components/tables/podcast/EpisodesTable.vue @@ -234,8 +234,8 @@ export default { }, sortDesc: { get() { - const desc = this.$store.state.user.settings.podcastEpisodesOrderDesc - if (desc === null || desc === undefined) return this.mediaMetadata.type === 'episodic' + const desc = this.$store.getters['user/getUserSetting']('podcastEpisodesOrderDesc') + if (desc == null) return this.mediaMetadata.type === 'episodic' return desc }, set(val) { diff --git a/store/user.js b/store/user.js index bf13390f..e4765142 100644 --- a/store/user.js +++ b/store/user.js @@ -48,7 +48,7 @@ export const getters = { return state.user.bookmarks.filter((bm) => bm.libraryItemId === libraryItemId) }, getUserSetting: (state) => (key) => { - return state.settings?.[key] || null + return state.settings?.[key] ?? null }, getUserCanUpdate: (state) => { return !!state.user?.permissions?.update