+
diff --git a/client/components/app/StreamContainer.vue b/client/components/app/StreamContainer.vue
index 20418103..d7f7cdbf 100644
--- a/client/components/app/StreamContainer.vue
+++ b/client/components/app/StreamContainer.vue
@@ -133,6 +133,10 @@ export default {
}
},
methods: {
+ setPlaying(isPlaying) {
+ this.isPlaying = isPlaying
+ this.$store.commit('setIsPlaying', isPlaying)
+ },
setSleepTimer(seconds) {
this.sleepTimerSet = true
this.sleepTimerTime = seconds
@@ -221,7 +225,7 @@ export default {
},
closePlayer() {
this.playerHandler.closePlayer()
- this.$store.commit('setLibraryItemStream', null)
+ this.$store.commit('setMediaPlaying', null)
},
streamProgress(data) {
if (!data.numSegments) return
@@ -234,7 +238,10 @@ export default {
}
},
sessionOpen(session) {
- this.$store.commit('setLibraryItemStream', session.libraryItem)
+ this.$store.commit('setMediaPlaying', {
+ libraryItem: session.libraryItem,
+ episodeId: session.episodeId
+ })
this.playerHandler.prepareOpenSession(session)
},
streamClosed(streamId) {
@@ -271,24 +278,40 @@ export default {
this.playerHandler.switchPlayer()
}
},
- async playLibraryItem(libraryItemId) {
+ async playLibraryItem(payload) {
+ var libraryItemId = payload.libraryItemId
+ var episodeId = payload.episodeId || null
+
+ if (this.playerHandler.libraryItemId == libraryItemId && this.playerHandler.episodeId == episodeId) {
+ this.playerHandler.play()
+ return
+ }
+
var libraryItem = await this.$axios.$get(`/api/items/${libraryItemId}?expanded=1`).catch((error) => {
console.error('Failed to fetch full item', error)
return null
})
if (!libraryItem) return
- this.$store.commit('setLibraryItemStream', libraryItem)
+ this.$store.commit('setMediaPlaying', {
+ libraryItem,
+ episodeId
+ })
- this.playerHandler.load(libraryItem, true)
+ this.playerHandler.load(libraryItem, episodeId, true)
+ },
+ pauseItem() {
+ this.playerHandler.pause()
}
},
mounted() {
this.$eventBus.$on('cast-session-active', this.castSessionActive)
this.$eventBus.$on('play-item', this.playLibraryItem)
+ this.$eventBus.$on('pause-item', this.pauseItem)
},
beforeDestroy() {
this.$eventBus.$off('cast-session-active', this.castSessionActive)
this.$eventBus.$off('play-item', this.playLibraryItem)
+ this.$eventBus.$off('pause-item', this.pauseItem)
}
}
diff --git a/client/components/cards/LazyBookCard.vue b/client/components/cards/LazyBookCard.vue
index 39da7c3f..9b80cb84 100644
--- a/client/components/cards/LazyBookCard.vue
+++ b/client/components/cards/LazyBookCard.vue
@@ -527,7 +527,9 @@ export default {
},
play() {
var eventBus = this.$eventBus || this.$nuxt.$eventBus
- eventBus.$emit('play-item', this.libraryItemId)
+ eventBus.$emit('play-item', {
+ libraryItemId: this.libraryItemId
+ })
},
mouseover() {
this.isHovering = true
diff --git a/client/components/modals/item/EditModal.vue b/client/components/modals/item/EditModal.vue
index 8ed90ddb..af3ab8a0 100644
--- a/client/components/modals/item/EditModal.vue
+++ b/client/components/modals/item/EditModal.vue
@@ -123,8 +123,9 @@ export default {
if (!this.userCanUpdate && !this.userCanDownload) return []
return this.tabs.filter((tab) => {
if (tab.id === 'download' && this.isMissing) return false
- if (tab.id === 'chapters' && this.mediaType !== 'book') return false
- if (tab.id === 'episodes' && this.mediaType !== 'podcast') return false
+ if (this.mediaType == 'podcast' && (tab.id == 'match' || tab.id == 'chapters')) return false
+ if (this.mediaType == 'book' && tab.id == 'episodes') return false
+
if ((tab.id === 'download' || tab.id === 'files') && this.userCanDownload) return true
if (tab.id !== 'download' && tab.id !== 'files' && this.userCanUpdate) return true
if (tab.id === 'match' && this.userCanUpdate && this.showExperimentalFeatures) return true
diff --git a/client/components/tables/LibraryFilesTable.vue b/client/components/tables/LibraryFilesTable.vue
index 25a66926..15890127 100644
--- a/client/components/tables/LibraryFilesTable.vue
+++ b/client/components/tables/LibraryFilesTable.vue
@@ -35,7 +35,7 @@
- download
+ download
|
diff --git a/client/components/tables/TracksTable.vue b/client/components/tables/TracksTable.vue
index fb888619..4df9050f 100644
--- a/client/components/tables/TracksTable.vue
+++ b/client/components/tables/TracksTable.vue
@@ -38,7 +38,7 @@
{{ $secondsToTimestamp(track.duration) }}
- download
+ download
|
diff --git a/client/components/tables/collection/BookTableRow.vue b/client/components/tables/collection/BookTableRow.vue
index 1e26b335..747b4cda 100644
--- a/client/components/tables/collection/BookTableRow.vue
+++ b/client/components/tables/collection/BookTableRow.vue
@@ -27,11 +27,6 @@
radio_button_unchecked