Update:Clicking local podcast from home page will filter by downloaded episodes #958

This commit is contained in:
advplyr 2023-11-25 13:09:43 -06:00
parent 579785d2c6
commit f9dd8188ee
2 changed files with 7 additions and 2 deletions

View file

@ -297,6 +297,9 @@ export default {
} }
}, },
mounted() { mounted() {
if (this.$route.query['episodefilter'] === 'downloaded') {
this.filterKey = 'downloaded'
}
this.$socket.$on('episode_download_queued', this.episodeDownloadQueued) this.$socket.$on('episode_download_queued', this.episodeDownloadQueued)
this.$socket.$on('episode_download_started', this.episodeDownloadStarted) this.$socket.$on('episode_download_started', this.episodeDownloadStarted)
this.$socket.$on('episode_download_finished', this.episodeDownloadFinished) this.$socket.$on('episode_download_finished', this.episodeDownloadFinished)

View file

@ -162,7 +162,7 @@ import { AbsFileSystem, AbsDownloader } from '@/plugins/capacitor'
import { FastAverageColor } from 'fast-average-color' import { FastAverageColor } from 'fast-average-color'
export default { export default {
async asyncData({ store, params, redirect, app }) { async asyncData({ store, params, redirect, app, query }) {
const libraryItemId = params.id const libraryItemId = params.id
let libraryItem = null let libraryItem = null
if (libraryItemId.startsWith('local')) { if (libraryItemId.startsWith('local')) {
@ -170,7 +170,9 @@ export default {
console.log('Got lli', libraryItemId) 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 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) { 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) { } else if (store.state.user.serverConnectionConfig) {
libraryItem = await app.$nativeHttp.get(`/api/items/${libraryItemId}?expanded=1&include=rssfeed`).catch((error) => { libraryItem = await app.$nativeHttp.get(`/api/items/${libraryItemId}?expanded=1&include=rssfeed`).catch((error) => {