diff --git a/client/components/app/BookShelfRow.vue b/client/components/app/BookShelfRow.vue
index 56c0b95d..ea478c1e 100644
--- a/client/components/app/BookShelfRow.vue
+++ b/client/components/app/BookShelfRow.vue
@@ -7,6 +7,11 @@
+
+
+
+
+
@@ -70,11 +75,6 @@ export default {
selectedAuthor: null
}
},
- watch: {
- isSelectionMode(newVal) {
- this.updateSelectionMode(newVal)
- }
- },
computed: {
bookCoverHeight() {
return this.bookCoverWidth * this.bookCoverAspectRatio
@@ -103,9 +103,14 @@ export default {
this.$store.commit('setBookshelfBookIds', bookIds)
this.$store.commit('showEditModal', audiobook)
},
+ editEpisode({ libraryItem, episode }) {
+ this.$store.commit('setSelectedLibraryItem', libraryItem)
+ this.$store.commit('globals/setSelectedEpisode', episode)
+ this.$store.commit('globals/setShowEditPodcastEpisodeModal', true)
+ },
updateSelectionMode(val) {
var selectedLibraryItems = this.$store.state.selectedLibraryItems
- if (this.shelf.type === 'book') {
+ if (this.shelf.type === 'book' || this.shelf.type === 'podcast') {
this.shelf.entities.forEach((ent) => {
var component = this.$refs[`shelf-book-${ent.id}`]
if (!component || !component.length) return
@@ -113,10 +118,24 @@ export default {
component.setSelectionMode(val)
component.selected = selectedLibraryItems.includes(ent.id)
})
+ } else if (this.shelf.type === 'episode') {
+ this.shelf.entities.forEach((ent) => {
+ var component = this.$refs[`shelf-episode-${ent.recentEpisode.id}`]
+ if (!component || !component.length) return
+ component = component[0]
+ component.setSelectionMode(val)
+ component.selected = selectedLibraryItems.includes(ent.id)
+ })
}
},
selectItem(libraryItem) {
this.$store.commit('toggleLibraryItemSelected', libraryItem.id)
+ this.$nextTick(() => {
+ this.$eventBus.$emit('item-selected', libraryItem)
+ })
+ },
+ itemSelectedEvt() {
+ this.updateSelectionMode(this.isSelectionMode)
},
scrolled() {
clearTimeout(this.scrollTimer)
@@ -160,6 +179,12 @@ export default {
this.canScrollLeft = false
}
}
+ },
+ mounted() {
+ this.$eventBus.$on('item-selected', this.itemSelectedEvt)
+ },
+ beforeDestroy() {
+ this.$eventBus.$off('item-selected', this.itemSelectedEvt)
}
}
diff --git a/client/components/cards/LazyBookCard.vue b/client/components/cards/LazyBookCard.vue
index 9e31f50e..a51d720e 100644
--- a/client/components/cards/LazyBookCard.vue
+++ b/client/components/cards/LazyBookCard.vue
@@ -35,8 +35,8 @@
-
-
+
+
@@ -60,7 +60,7 @@
{{ selected ? 'radio_button_checked' : 'radio_button_unchecked' }}
-
@@ -77,13 +77,18 @@
-
+
+
+
+
Episode #{{ recentEpisodeNumber }}
+
+
-
@@ -190,6 +195,17 @@ export default {
processingBatch() {
return this.store.state.processingBatch
},
+ recentEpisode() {
+ // Only added to item when getting currently listening podcasts
+ return this._libraryItem.recentEpisode
+ },
+ recentEpisodeNumber() {
+ if (!this.recentEpisode) return null
+ if (this.recentEpisode.episode) {
+ return this.recentEpisode.episode.replace(/^#/, '')
+ }
+ return this.recentEpisode.index
+ },
collapsedSeries() {
// Only added to item object when collapseSeries is enabled
return this._libraryItem.collapsedSeries
@@ -240,7 +256,13 @@ export default {
if (this.orderBy === 'size') return 'Size: ' + this.$bytesPretty(this._libraryItem.size)
return null
},
+ episodeProgress() {
+ // Only used on home page currently listening podcast shelf
+ if (!this.recentEpisode) return null
+ return this.store.getters['user/getUserMediaProgress'](this.libraryItemId, this.recentEpisode.id)
+ },
userProgress() {
+ if (this.episodeProgress) return this.episodeProgress
return this.store.getters['user/getUserMediaProgress'](this.libraryItemId)
},
userProgressPercent() {
@@ -259,7 +281,7 @@ export default {
return !this.isSelectionMode && this.showExperimentalFeatures && !this.showPlayButton && this.hasEbook
},
showPlayButton() {
- return !this.isSelectionMode && !this.isMissing && !this.isInvalid && this.numTracks && !this.isStreaming
+ return !this.isSelectionMode && !this.isMissing && !this.isInvalid && !this.isStreaming && (this.numTracks || this.recentEpisode)
},
showSmallEBookIcon() {
return !this.isSelectionMode && this.showExperimentalFeatures && this.hasEbook
@@ -406,6 +428,9 @@ export default {
}
},
editClick() {
+ if (this.recentEpisode) {
+ return this.$emit('edit', { libraryItem: this.libraryItem, episode: this.recentEpisode })
+ }
this.$emit('edit', this.libraryItem)
},
toggleFinished() {
@@ -529,7 +554,8 @@ export default {
play() {
var eventBus = this.$eventBus || this.$nuxt.$eventBus
eventBus.$emit('play-item', {
- libraryItemId: this.libraryItemId
+ libraryItemId: this.libraryItemId,
+ episodeId: this.recentEpisode ? this.recentEpisode.id : null
})
},
mouseover() {
diff --git a/client/components/modals/podcast/EditEpisode.vue b/client/components/modals/podcast/EditEpisode.vue
index fe482f2f..8f0134f1 100644
--- a/client/components/modals/podcast/EditEpisode.vue
+++ b/client/components/modals/podcast/EditEpisode.vue
@@ -35,17 +35,6 @@