Fix: data recovery, Fix: Create bookmark when no user audiobook data exists #115, Fix: Book cover padding covering progress bar

This commit is contained in:
advplyr 2021-11-03 19:39:49 -05:00
parent cf8984a96a
commit 411409d67e
3 changed files with 7 additions and 6 deletions

View File

@ -4,7 +4,7 @@
<div class="w-full h-full" :style="{ marginTop: sizeMultiplier + 'rem' }">
<div v-if="shelf.books" class="flex items-center -mb-2">
<template v-for="entity in shelf.books">
<cards-book-card :key="entity.id" :width="bookCoverWidth" :user-progress="userAudiobooks[entity.id]" :audiobook="entity" @hook:updated="updatedBookCard" @edit="editBook" />
<cards-book-card :key="entity.id" :width="bookCoverWidth" :user-progress="userAudiobooks[entity.id]" :audiobook="entity" @hook:updated="updatedBookCard" :padding-y="24" @edit="editBook" />
</template>
</div>
<div v-else-if="shelf.series" class="flex items-center -mb-2">

View File

@ -255,7 +255,8 @@ class Db {
console.log('Data recovery successful -- unlinking old')
await fs.unlink(orphanOld)
var orphanOldPath = Path.join(dbdatadir, orphanOld)
await fs.unlink(orphanOldPath)
console.log('Removed .old file')
var lockdirpath = Path.join(dbdatadir, `data.${dbnum}.lock`)
await fs.rmdir(lockdirpath)

View File

@ -280,10 +280,10 @@ class User {
}
createBookmark({ audiobookId, time, title }) {
if (!this.audiobooks || !this.audiobooks[audiobookId]) {
return {
error: 'Invalid Audiobook'
}
if (!this.audiobooks) this.audiobooks = {}
if (!this.audiobooks[audiobookId]) {
this.audiobooks[audiobookId] = new UserAudiobookData()
this.audiobooks[audiobookId].audiobookId = audiobookId
}
if (this.audiobooks[audiobookId].checkBookmarkExists(time)) {
return {