mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-28 06:14:00 +02:00
Remember sort & filter options for podcast episodes
This commit is contained in:
@@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
<modals-podcast-episodes-feed-modal v-model="showPodcastEpisodeFeed" :library-item="libraryItem" :episodes="podcastFeedEpisodes" />
|
<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 />
|
<modals-order-modal v-model="showSortModal" :order-by.sync="sortKey" :descending.sync="sortDesc" episodes @change="saveSort" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -79,9 +79,9 @@ export default {
|
|||||||
episodesCopy: [],
|
episodesCopy: [],
|
||||||
showFiltersModal: false,
|
showFiltersModal: false,
|
||||||
showSortModal: false,
|
showSortModal: false,
|
||||||
sortKey: 'publishedAt',
|
sortKey: this.$store.state.user.settings.podcastEpisodesOrderBy || 'publishedAt',
|
||||||
sortDesc: true,
|
sortDesc: this.$store.state.user.settings.podcastEpisodesOrderDesc,
|
||||||
filterKey: 'incomplete',
|
filterKey: this.$store.state.user.settings.podcastEpisodesFilterBy || 'incomplete',
|
||||||
fetchingRSSFeed: false,
|
fetchingRSSFeed: false,
|
||||||
podcastFeedEpisodes: [],
|
podcastFeedEpisodes: [],
|
||||||
showPodcastEpisodeFeed: false,
|
showPodcastEpisodeFeed: false,
|
||||||
@@ -279,6 +279,10 @@ export default {
|
|||||||
setFilter(filter) {
|
setFilter(filter) {
|
||||||
this.filterKey = filter
|
this.filterKey = filter
|
||||||
this.showFiltersModal = false
|
this.showFiltersModal = false
|
||||||
|
this.$store.dispatch('user/updateUserSettings', { podcastEpisodesFilterBy: filter })
|
||||||
|
},
|
||||||
|
saveSort() {
|
||||||
|
this.$store.dispatch('user/updateUserSettings', { podcastEpisodesOrderBy: this.sortKey, podcastEpisodesOrderDesc: this.sortDesc })
|
||||||
},
|
},
|
||||||
showFilters() {
|
showFilters() {
|
||||||
this.showFiltersModal = true
|
this.showFiltersModal = true
|
||||||
@@ -291,7 +295,6 @@ export default {
|
|||||||
return this.$store.getters['user/getUserMediaProgress'](this.libraryItemId, episode.id)
|
return this.$store.getters['user/getUserMediaProgress'](this.libraryItemId, episode.id)
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.sortDesc = this.mediaMetadata.type === 'episodic'
|
|
||||||
this.episodesCopy = this.episodes.map((ep) => {
|
this.episodesCopy = this.episodes.map((ep) => {
|
||||||
return { ...ep }
|
return { ...ep }
|
||||||
})
|
})
|
||||||
@@ -315,6 +318,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
if (this.sortDesc === null || this.sortDesc === undefined) {
|
||||||
|
this.sortDesc = this.mediaMetadata.type === 'episodic'
|
||||||
|
}
|
||||||
|
|
||||||
if (this.$route.query['episodefilter'] === 'downloaded') {
|
if (this.$route.query['episodefilter'] === 'downloaded') {
|
||||||
this.filterKey = 'downloaded'
|
this.filterKey = 'downloaded'
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -12,7 +12,10 @@ export const state = () => ({
|
|||||||
mobileFilterBy: 'all',
|
mobileFilterBy: 'all',
|
||||||
playbackRate: 1,
|
playbackRate: 1,
|
||||||
collapseSeries: false,
|
collapseSeries: false,
|
||||||
collapseBookSeries: false
|
collapseBookSeries: false,
|
||||||
|
podcastEpisodesOrderBy: 'publishedAt',
|
||||||
|
podcastEpisodesOrderDesc: null,
|
||||||
|
podcastEpisodesFilterBy: 'incomplete'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user