+
Episode #{{ recentEpisodeNumber }}
@@ -129,7 +134,7 @@ export default {
return {
isHovering: false,
isMoreMenuOpen: false,
- isProcessingReadUpdate: false,
+ processing: false,
libraryItem: null,
imageReady: false,
rescanning: false,
@@ -490,6 +495,7 @@ export default {
this.libraryItem = libraryItem
},
clickCard(e) {
+ if (this.processing) return
if (this.isSelectionMode) {
e.stopPropagation()
e.preventDefault()
@@ -526,7 +532,7 @@ export default {
var updatePayload = {
isFinished: !this.itemIsFinished
}
- this.isProcessingReadUpdate = true
+ this.processing = true
var apiEndpoint = `/api/me/progress/${this.libraryItemId}`
if (this.recentEpisode) apiEndpoint += `/${this.recentEpisode.id}`
@@ -536,12 +542,12 @@ export default {
axios
.$patch(apiEndpoint, updatePayload)
.then(() => {
- this.isProcessingReadUpdate = false
+ this.processing = false
toast.success(`Item marked as ${updatePayload.isFinished ? 'Finished' : 'Not Finished'}`)
})
.catch((error) => {
console.error('Failed', error)
- this.isProcessingReadUpdate = false
+ this.processing = false
toast.error(`Failed to mark as ${updatePayload.isFinished ? 'Finished' : 'Not Finished'}`)
})
},
@@ -647,11 +653,44 @@ export default {
this.selected = !this.selected
this.$emit('select', this.libraryItem)
},
- play() {
+ async play() {
var eventBus = this.$eventBus || this.$nuxt.$eventBus
+
+ const queueItems = []
+ // Podcast episode load queue items
+ if (this.recentEpisode) {
+ const axios = this.$axios || this.$nuxt.$axios
+ this.processing = true
+ const fullLibraryItem = await axios.$get(`/api/items/${this.libraryItemId}`).catch((err) => {
+ console.error('Failed to fetch library item', err)
+ return null
+ })
+ this.processing = false
+
+ if (fullLibraryItem && fullLibraryItem.media.episodes) {
+ const episodes = fullLibraryItem.media.episodes || []
+ const episodeIndex = episodes.findIndex((ep) => ep.id === this.recentEpisode.id)
+ if (episodeIndex >= 0) {
+ for (let i = episodeIndex; i < episodes.length; i++) {
+ const episode = episodes[i]
+ const audioFile = episode.audioFile
+ queueItems.push({
+ libraryItemId: this.libraryItemId,
+ episodeId: episode.id,
+ title: episode.title,
+ subtitle: this.mediaMetadata.title,
+ duration: audioFile.duration || null,
+ coverPath: this.media.coverPath || null
+ })
+ }
+ }
+ }
+ }
+
eventBus.$emit('play-item', {
libraryItemId: this.libraryItemId,
- episodeId: this.recentEpisode ? this.recentEpisode.id : null
+ episodeId: this.recentEpisode ? this.recentEpisode.id : null,
+ queueItems
})
},
mouseover() {
diff --git a/client/components/widgets/LoadingSpinner.vue b/client/components/widgets/LoadingSpinner.vue
index 07fdc83e..a9c4ef47 100644
--- a/client/components/widgets/LoadingSpinner.vue
+++ b/client/components/widgets/LoadingSpinner.vue
@@ -147,6 +147,16 @@ export default {
margin-top: -2px;
margin-left: -2px;
}
+.la-ball-spin-clockwise.la-lg {
+ width: 32px;
+ height: 32px;
+}
+.la-ball-spin-clockwise.la-lg > div {
+ width: 8px;
+ height: 8px;
+ margin-top: -4px;
+ margin-left: -4px;
+}
.la-ball-spin-clockwise.la-2x {
width: 64px;
height: 64px;