diff --git a/components/app/AudioPlayerContainer.vue b/components/app/AudioPlayerContainer.vue index 060a2878..2cd17531 100644 --- a/components/app/AudioPlayerContainer.vue +++ b/components/app/AudioPlayerContainer.vue @@ -188,6 +188,7 @@ export default { const libraryItemId = payload.libraryItemId const episodeId = payload.episodeId const startTime = payload.startTime + const startWhenReady = !payload.paused // When playing local library item and can also play this item from the server // then store the server library item id so it can be used if a cast is made @@ -223,7 +224,7 @@ export default { } console.log('Called playLibraryItem', libraryItemId) - const preparePayload = { libraryItemId, episodeId, playWhenReady: true, playbackRate } + const preparePayload = { libraryItemId, episodeId, playWhenReady: startWhenReady, playbackRate } if (startTime !== undefined && startTime !== null) preparePayload.startTime = startTime AbsAudioPlayer.prepareLibraryItem(preparePayload) .then((data) => { diff --git a/pages/bookshelf/index.vue b/pages/bookshelf/index.vue index 2eaffa05..8eb417e6 100644 --- a/pages/bookshelf/index.vue +++ b/pages/bookshelf/index.vue @@ -247,6 +247,15 @@ export default { return cat }) + // If we don't already have a player open + // Try opening the first book from continue-listening without playing it + if (!this.$store.state.playerLibraryItemId) { + const lastListening = categories.filter((cat) => cat.id === 'continue-listening')[0]?.entities?.[0]?.id + if (lastListening) { + this.$eventBus.$emit('play-item', { libraryItemId: lastListening, paused: true }) + } + } + // Only add the local shelf with the same media type const localShelves = localCategories.filter((cat) => cat.type === this.currentLibraryMediaType && !cat.localOnly) this.shelves.push(...localShelves)