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-book {
box-shadow: 4px 1px 8px #11111166, -4px 1px 8px #11111166, 1px -4px 8px #11111166; 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-book3d {
box-shadow: 4px 1px 8px #11111166, 1px -4px 8px #11111166; 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"> <!-- <div class="absolute top-0 left-0 bottom-0 p-4 z-10">
<p class="text-white text-2xl">{{ shelf }}</p> <p class="text-white text-2xl">{{ shelf }}</p>
</div> --> </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> </div>
</template> </template>
@ -146,9 +146,6 @@ export default {
// Includes margin // Includes margin
return this.entityWidth + 24 return this.entityWidth + 24
}, },
booksPerPage() {
return this.shelvesPerPage * this.entitiesPerShelf
},
selectedAudiobooks() { selectedAudiobooks() {
return this.$store.state.selectedAudiobooks || [] return this.$store.state.selectedAudiobooks || []
} }
@ -226,7 +223,7 @@ export default {
return return
} }
if (payload) { if (payload) {
console.log('Received payload', payload) // console.log('Received payload', payload)
if (!this.initialized) { if (!this.initialized) {
this.initialized = true this.initialized = true
this.totalEntities = payload.total this.totalEntities = payload.total

View File

@ -1,5 +1,6 @@
<template> <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"> <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" /> <covers-collection-cover ref="cover" :book-items="books" :width="width" :height="height" :book-cover-aspect-ratio="bookCoverAspectRatio" />
</div> </div>

View File

@ -1,5 +1,6 @@
<template> <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"> <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" /> <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> </div>

View File

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