Fix:Bookshelf shadow,Fix:Series volume sort

This commit is contained in:
advplyr 2021-12-04 16:21:10 -06:00
parent 9423727f89
commit 0c1a0f5d01
5 changed files with 12 additions and 15 deletions

View File

@ -148,6 +148,9 @@ input[type=number] {
.box-shadow-book {
box-shadow: 4px 1px 8px #11111166, -4px 1px 8px #11111166, 1px -4px 8px #11111166;
}
.shadow-height {
height: calc(100% - 4px);
}
.box-shadow-book3d {
box-shadow: 4px 1px 8px #11111166, 1px -4px 8px #11111166;

View File

@ -5,7 +5,7 @@
<!-- <div class="absolute top-0 left-0 bottom-0 p-4 z-10">
<p class="text-white text-2xl">{{ shelf }}</p>
</div> -->
<div class="bookshelfDivider w-full absolute bottom-0 left-0 right-0 z-10" :class="`h-${shelfDividerHeightIndex}`" />
<div class="bookshelfDivider w-full absolute bottom-0 left-0 right-0 z-20" :class="`h-${shelfDividerHeightIndex}`" />
</div>
</template>
@ -146,9 +146,6 @@ export default {
// Includes margin
return this.entityWidth + 24
},
booksPerPage() {
return this.shelvesPerPage * this.entitiesPerShelf
},
selectedAudiobooks() {
return this.$store.state.selectedAudiobooks || []
}
@ -226,7 +223,7 @@ export default {
return
}
if (payload) {
console.log('Received payload', payload)
// console.log('Received payload', payload)
if (!this.initialized) {
this.initialized = true
this.totalEntities = payload.total

View File

@ -1,5 +1,6 @@
<template>
<div ref="card" :id="`collection-card-${index}`" :style="{ width: width + 'px', height: height + 'px' }" class="absolute top-0 left-0 rounded-sm z-10 cursor-pointer box-shadow-book" @mousedown.prevent @mouseup.prevent @mousemove.prevent @mouseover="mouseover" @mouseleave="mouseleave" @click="clickCard">
<div ref="card" :id="`collection-card-${index}`" :style="{ width: width + 'px', height: height + 'px' }" class="absolute top-0 left-0 rounded-sm z-30 cursor-pointer" @mousedown.prevent @mouseup.prevent @mousemove.prevent @mouseover="mouseover" @mouseleave="mouseleave" @click="clickCard">
<div class="absolute top-0 left-0 w-full box-shadow-book shadow-height" />
<div class="w-full h-full bg-primary relative rounded overflow-hidden">
<covers-collection-cover ref="cover" :book-items="books" :width="width" :height="height" :book-cover-aspect-ratio="bookCoverAspectRatio" />
</div>

View File

@ -1,5 +1,6 @@
<template>
<div ref="card" :id="`series-card-${index}`" :style="{ width: width + 'px', height: height + 'px' }" class="absolute top-0 left-0 rounded-sm z-10 cursor-pointer box-shadow-book" @mousedown.prevent @mouseup.prevent @mousemove.prevent @mouseover="mouseover" @mouseleave="mouseleave" @click="clickCard">
<div ref="card" :id="`series-card-${index}`" :style="{ width: width + 'px', height: height + 'px' }" class="absolute top-0 left-0 rounded-sm z-30 cursor-pointer" @mousedown.prevent @mouseup.prevent @mousemove.prevent @mouseover="mouseover" @mouseleave="mouseleave" @click="clickCard">
<div class="absolute top-0 left-0 w-full box-shadow-book shadow-height" />
<div class="w-full h-full bg-primary relative rounded overflow-hidden">
<covers-group-cover v-if="series" ref="cover" :id="seriesId" :name="title" :book-items="books" :width="width" :height="height" :book-cover-aspect-ratio="bookCoverAspectRatio" :group-to="seriesBooksRoute" />
</div>

View File

@ -135,18 +135,12 @@ class LibraryController {
if (payload.sortBy) {
var orderByNumber = payload.sortBy === 'book.volumeNumber'
var direction = payload.sortDesc ? 'desc' : 'asc'
// if (req.query.sort === 'size') {
// console.warn('1SORTING BY SIZE', audiobooks[0])
// }
audiobooks = sort(audiobooks)[direction]((ab) => {
// Supports dot notation strings i.e. "book.title"
var value = payload.sortBy.split('.').reduce((a, b) => a[b], ab)
if (orderByNumber && !isNaN(value)) return Number(value)
return value
})
// if (req.query.sort === 'size') {
// console.warn('2SORTING BY SIZE', audiobooks[0])
// }
}
if (payload.limit) {
@ -194,6 +188,7 @@ class LibraryController {
return res.status(404).send('Series not found')
}
audiobooks = sort(audiobooks).asc(ab => {
if (!isNaN(ab.book.volumeNumber) && ab.book.volumeNumber !== null) return Number(ab.book.volumeNumber)
return ab.book.volumeNumber
})
res.json({