Skip to content

Commit

Permalink
Update:Clicking local podcast from home page will filter by downloade…
Browse files Browse the repository at this point in the history
…d episodes #958
  • Loading branch information
advplyr committed Nov 25, 2023
1 parent 579785d commit f9dd818
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions components/tables/podcast/EpisodesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions pages/item/_id/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,17 @@ 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')) {
libraryItem = await app.$db.getLocalLibraryItem(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 (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) => {
Expand Down

0 comments on commit f9dd818

Please sign in to comment.