mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-04 18:15:01 +02:00
Persist bookshelf list view setting, fix collections for new data model, add authors cards, update filters
This commit is contained in:
parent
f309e1fcf2
commit
9ad351f0d7
18 changed files with 296 additions and 67 deletions
|
@ -18,10 +18,6 @@
|
|||
</ui-btn>
|
||||
</div>
|
||||
|
||||
<!-- <ui-icon-btn icon="edit" class="mx-0.5" @click="editClick" />
|
||||
|
||||
<ui-icon-btn icon="delete" class="mx-0.5" @click="removeClick" /> -->
|
||||
|
||||
<div class="my-8 max-w-2xl">
|
||||
<p class="text-base text-gray-100">{{ description }}</p>
|
||||
</div>
|
||||
|
@ -75,7 +71,7 @@ export default {
|
|||
},
|
||||
playableBooks() {
|
||||
return this.bookItems.filter((book) => {
|
||||
return !book.isMissing && !book.isIncomplete && book.numTracks
|
||||
return !book.isMissing && !book.isInvalid && book.media.tracks.length
|
||||
})
|
||||
},
|
||||
streaming() {
|
||||
|
@ -83,28 +79,16 @@ export default {
|
|||
},
|
||||
showPlayButton() {
|
||||
return this.playableBooks.length
|
||||
},
|
||||
userAudiobooks() {
|
||||
return this.$store.state.user.user ? this.$store.state.user.user.audiobooks || {} : {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickPlay() {
|
||||
var nextBookNotRead = this.playableBooks.find((pb) => !this.userAudiobooks[pb.id] || !this.userAudiobooks[pb.id].isRead)
|
||||
var nextBookNotRead = this.playableBooks.find((pb) => {
|
||||
var prog = this.$store.getters['user/getUserMediaProgress'](pb.id)
|
||||
return !prog || !prog.isFinished
|
||||
})
|
||||
if (nextBookNotRead) {
|
||||
var dlObj = this.$store.getters['downloads/getDownload'](nextBookNotRead.id)
|
||||
|
||||
this.$store.commit('setPlayOnLoad', true)
|
||||
if (dlObj && !dlObj.isDownloading && !dlObj.isPreparing) {
|
||||
// Local
|
||||
console.log('[PLAYCLICK] Set Playing Local Download ' + nextBookNotRead.book.title)
|
||||
this.$store.commit('setPlayingDownload', dlObj)
|
||||
} else {
|
||||
// Stream
|
||||
console.log('[PLAYCLICK] Set Playing STREAM ' + nextBookNotRead.book.title)
|
||||
this.$store.commit('setStreamAudiobook', nextBookNotRead)
|
||||
this.$server.socket.emit('open_stream', nextBookNotRead.id)
|
||||
}
|
||||
this.$eventBus.$emit('play-item', nextBookNotRead.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue