From f9dd8188eec8d4f2a496c772f68a6163c3c0accb Mon Sep 17 00:00:00 2001 From: advplyr Date: Sat, 25 Nov 2023 13:09:43 -0600 Subject: [PATCH] Update:Clicking local podcast from home page will filter by downloaded episodes #958 --- components/tables/podcast/EpisodesTable.vue | 3 +++ pages/item/_id/index.vue | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/tables/podcast/EpisodesTable.vue b/components/tables/podcast/EpisodesTable.vue index 518a1d06..29383c2e 100644 --- a/components/tables/podcast/EpisodesTable.vue +++ b/components/tables/podcast/EpisodesTable.vue @@ -297,6 +297,9 @@ export default { } }, mounted() { + if (this.$route.query['episodefilter'] === 'downloaded') { + this.filterKey = 'downloaded' + } this.$socket.$on('episode_download_queued', this.episodeDownloadQueued) this.$socket.$on('episode_download_started', this.episodeDownloadStarted) this.$socket.$on('episode_download_finished', this.episodeDownloadFinished) diff --git a/pages/item/_id/index.vue b/pages/item/_id/index.vue index 2a2533cc..52cf2d0b 100644 --- a/pages/item/_id/index.vue +++ b/pages/item/_id/index.vue @@ -162,7 +162,7 @@ import { AbsFileSystem, AbsDownloader } from '@/plugins/capacitor' import { FastAverageColor } from 'fast-average-color' export default { - async asyncData({ store, params, redirect, app }) { + async asyncData({ store, params, redirect, app, query }) { const libraryItemId = params.id let libraryItem = null if (libraryItemId.startsWith('local')) { @@ -170,7 +170,9 @@ export default { console.log('Got lli', libraryItemId) // If library item is linked to the currently connected server then redirect to the page using the server library item id if (libraryItem?.libraryItemId && libraryItem?.serverAddress === store.getters['user/getServerAddress'] && store.state.networkConnected) { - return redirect(`/item/${libraryItem.libraryItemId}`) + let query = '' + if (libraryItem.mediaType === 'podcast') query = '?episodefilter=downloaded' // Filter by downloaded when redirecting from the local copy + return redirect(`/item/${libraryItem.libraryItemId}${query}`) } } else if (store.state.user.serverConnectionConfig) { libraryItem = await app.$nativeHttp.get(`/api/items/${libraryItemId}?expanded=1&include=rssfeed`).catch((error) => {