Align with codebase

This commit is contained in:
Andrei Costescu
2026-07-21 20:53:58 +02:00
parent 67fbeeeb6c
commit 7726192008
+23 -13
View File
@@ -50,7 +50,7 @@
<modals-podcast-episodes-feed-modal v-model="showPodcastEpisodeFeed" :library-item="libraryItem" :episodes="podcastFeedEpisodes" />
<modals-order-modal v-model="showSortModal" :order-by.sync="sortKey" :descending.sync="sortDesc" episodes @change="saveSort" />
<modals-order-modal v-model="showSortModal" :order-by.sync="sortKey" :descending.sync="sortDesc" episodes />
</div>
</template>
@@ -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)