Add:Downloaded filter for podcast episodes #959

Fix:More menu button not working for podcasts with some episodes downloaded
This commit is contained in:
advplyr 2023-11-25 12:56:29 -06:00
parent 257a1ceb51
commit 579785d2c6
3 changed files with 15 additions and 8 deletions

View file

@ -165,7 +165,7 @@ export default {
},
localEpisode() {
if (this.isLocal) return this.episode
return this.episode.localEpisode
return this.episode?.localEpisode
},
localEpisodeId() {
return this.localEpisode?.id || null

View file

@ -132,10 +132,10 @@ export default {
}
},
itemProgressPercent() {
return this.itemProgress ? this.itemProgress.progress : 0
return this.itemProgress?.progress || 0
},
userIsFinished() {
return this.itemProgress ? !!this.itemProgress.isFinished : false
return !!this.itemProgress?.isFinished
},
timeRemaining() {
if (this.streamIsPlaying) return 'Playing'
@ -151,7 +151,7 @@ export default {
return this.$store.getters['globals/getDownloadItem'](this.libraryItemId, this.episode.id)
},
localEpisodeId() {
return this.localEpisode ? this.localEpisode.id : null
return this.localEpisode?.id || null
}
},
methods: {

View file

@ -116,6 +116,10 @@ export default {
{
text: 'Complete',
value: 'complete'
},
{
text: 'Downloaded',
value: 'downloaded'
}
],
fetchingRSSFeed: false,
@ -141,10 +145,10 @@ export default {
return this.$store.state.networkConnected
},
libraryItemId() {
return this.libraryItem ? this.libraryItem.id : null
return this.libraryItem?.id || null
},
media() {
return this.libraryItem ? this.libraryItem.media || {} : {}
return this.libraryItem?.media || {}
},
mediaMetadata() {
return this.media.metadata || {}
@ -154,11 +158,14 @@ export default {
},
episodesFiltered() {
return this.episodesCopy.filter((ep) => {
if (this.filterKey === 'downloaded') {
return !!this.localEpisodeMap[ep.id]
}
var mediaProgress = this.getEpisodeProgress(ep)
if (this.filterKey === 'incomplete') {
return !mediaProgress || !mediaProgress.isFinished
return !mediaProgress?.isFinished
} else if (this.filterKey === 'complete') {
return mediaProgress && mediaProgress.isFinished
return mediaProgress?.isFinished
} else if (this.filterKey === 'inProgress') {
return mediaProgress && !mediaProgress.isFinished
} else if (this.filterKey === 'all') {