mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-04 01:54:33 +02:00
Easy way to play current audiobook
This patch implements a generic way of re-opening the player for the book you last listened to. This is especially handy when first opening the app and you can restart playback with a single click. The player is opened only if no other book is already open in the player. It will not overwrite or replace playbacks or player already in progress. The player is opened paused. No automatic playback since that could be really annoying. This closes #494
This commit is contained in:
parent
5e0c740f02
commit
ec704bf501
2 changed files with 11 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue