Fix details tab save

This commit is contained in:
Mark Cooper 2021-09-06 16:11:37 -05:00
parent 41c391e87b
commit 1d7d2a1dac
5 changed files with 21 additions and 15 deletions

View File

@ -83,6 +83,10 @@
box-shadow: 2px 8px 6px #111111aa; box-shadow: 2px 8px 6px #111111aa;
} }
.box-shadow-sm-up {
box-shadow: 0px -5px 8px #11111122;
}
.box-shadow-md-up { .box-shadow-md-up {
box-shadow: 0px -8px 8px #11111144; box-shadow: 0px -8px 8px #11111144;
} }

View File

@ -1,7 +1,8 @@
<template> <template>
<div class="w-full h-full relative"> <div class="w-full h-full relative">
<div ref="formWrapper" class="px-4 py-6 details-form-wrapper w-full overflow-hidden overflow-y-auto"> <form class="w-full h-full" @submit.prevent="submitForm">
<!-- <div v-if="userProgress" class="bg-success bg-opacity-40 rounded-md w-full px-4 py-1 mb-4 border border-success border-opacity-50"> <div ref="formWrapper" class="px-4 py-6 details-form-wrapper w-full overflow-hidden overflow-y-auto">
<!-- <div v-if="userProgress" class="bg-success bg-opacity-40 rounded-md w-full px-4 py-1 mb-4 border border-success border-opacity-50">
<div class="w-full flex items-center"> <div class="w-full flex items-center">
<p> <p>
Your progress: <span class="font-mono text-lg">{{ (userProgress * 100).toFixed(0) }}%</span> Your progress: <span class="font-mono text-lg">{{ (userProgress * 100).toFixed(0) }}%</span>
@ -10,7 +11,7 @@
<ui-btn v-if="!resettingProgress" small :padding-x="2" class="-mr-3" @click="resetProgress">Reset</ui-btn> <ui-btn v-if="!resettingProgress" small :padding-x="2" class="-mr-3" @click="resetProgress">Reset</ui-btn>
</div> </div>
</div> --> </div> -->
<form @submit.prevent="submitForm">
<ui-text-input-with-label v-model="details.title" label="Title" /> <ui-text-input-with-label v-model="details.title" label="Title" />
<ui-text-input-with-label v-model="details.subtitle" label="Subtitle" class="mt-2" /> <ui-text-input-with-label v-model="details.subtitle" label="Subtitle" class="mt-2" />
@ -49,16 +50,16 @@
<ui-text-input-with-label v-model="details.narrarator" label="Narrarator" /> <ui-text-input-with-label v-model="details.narrarator" label="Narrarator" />
</div> </div>
</div> </div>
</form>
</div>
<div class="absolute bottom-0 left-0 w-full py-4 bg-bg" :class="isScrollable ? 'box-shadow-md-up' : 'border-t border-primary border-opacity-50'">
<div class="flex px-4">
<ui-btn color="error" type="button" small @click.stop.prevent="deleteAudiobook">Remove</ui-btn>
<div class="flex-grow" />
<ui-btn type="submit">Submit</ui-btn>
</div> </div>
</div>
<div class="absolute bottom-0 left-0 w-full py-4 bg-bg" :class="isScrollable ? 'box-shadow-md-up' : 'box-shadow-sm-up border-t border-primary border-opacity-50'">
<div class="flex px-4">
<ui-btn color="error" type="button" small @click.stop.prevent="deleteAudiobook">Remove</ui-btn>
<div class="flex-grow" />
<ui-btn type="submit">Submit</ui-btn>
</div>
</div>
</form>
</div> </div>
</template> </template>
@ -229,5 +230,6 @@ export default {
<style scoped> <style scoped>
.details-form-wrapper { .details-form-wrapper {
height: calc(100% - 70px); height: calc(100% - 70px);
max-height: calc(100% - 70px);
} }
</style> </style>

View File

@ -1,6 +1,6 @@
{ {
"name": "audiobookshelf-client", "name": "audiobookshelf-client",
"version": "1.0.6", "version": "1.0.7",
"description": "Audiobook manager and player", "description": "Audiobook manager and player",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -1,6 +1,6 @@
{ {
"name": "audiobookshelf", "name": "audiobookshelf",
"version": "1.0.6", "version": "1.0.7",
"description": "Self-hosted audiobook server for managing and playing audiobooks.", "description": "Self-hosted audiobook server for managing and playing audiobooks.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -63,7 +63,7 @@ function isNumber(val) {
} }
function getTrackNumberFromMeta(scanData) { function getTrackNumberFromMeta(scanData) {
return !isNaN(scanData.trackNumber) && scanData.trackNumber !== null ? Number(scanData.trackNumber) : null return !isNaN(scanData.trackNumber) && scanData.trackNumber !== null ? Math.trunc(Number(scanData.trackNumber)) : null
} }
function getTrackNumberFromFilename(title, author, series, publishYear, filename) { function getTrackNumberFromFilename(title, author, series, publishYear, filename) {