Add:Experimental collapse series for library option #322

This commit is contained in:
advplyr 2022-01-24 18:03:54 -06:00
parent 5bd6c8f553
commit d8cc0b57a5
8 changed files with 96 additions and 50 deletions

View file

@ -12,6 +12,8 @@
<p class="truncate text-gray-400" :style="{ fontSize: 0.8 * sizeMultiplier + 'rem' }">{{ authorFL }}</p>
</div>
<div v-if="booksInSeries" class="absolute z-20 top-1.5 right-1.5 rounded-md leading-3 text-sm p-1 font-semibold text-white flex items-center justify-center" style="background-color: #cd9d49dd">{{ booksInSeries }}</div>
<div class="w-full h-full absolute top-0 left-0 rounded overflow-hidden z-10">
<div v-show="audiobook && !imageReady" class="absolute top-0 left-0 w-full h-full flex items-center justify-center" :style="{ padding: sizeMultiplier * 0.5 + 'rem' }">
<p :style="{ fontSize: sizeMultiplier * 0.8 + 'rem' }" class="font-book text-gray-300 text-center">{{ title }}</p>
@ -113,6 +115,9 @@ export default {
_audiobook() {
return this.audiobook || {}
},
book() {
return this._audiobook.book || {}
},
placeholderUrl() {
return '/book_placeholder.jpg'
},
@ -122,6 +127,12 @@ export default {
audiobookId() {
return this._audiobook.id
},
series() {
return this.book.series
},
libraryId() {
return this._audiobook.libraryId
},
hasEbook() {
return this._audiobook.numEbooks
},
@ -131,8 +142,9 @@ export default {
processingBatch() {
return this.store.state.processingBatch
},
book() {
return this._audiobook.book || {}
booksInSeries() {
// Only added to audiobook object when collapseSeries is enabled
return this._audiobook.booksInSeries
},
hasCover() {
return !!this.book.cover
@ -321,7 +333,10 @@ export default {
this.selectBtnClick()
} else {
var router = this.$router || this.$nuxt.$router
if (router) router.push(`/audiobook/${this.audiobookId}`)
if (router) {
if (this.booksInSeries) router.push(`/library/${this.libraryId}/series/${this.$encode(this.series)}`)
else router.push(`/audiobook/${this.audiobookId}`)
}
}
},
editClick() {