Update BookProgress model and schemas

Updated book progress model in anticipation of the KOReader sync
feature.

Renamed properties:
 - renamed "progress" to "percentage"
 - renamed "pdf_loc" to "pdf_page"
 - renamed "epub_loc" to "epub_cfi"

New properties:
 - "epub_xpointer", marks the location of an epub in KOReader
 - "device", the device type that updated the progress
 - "device_id", the id of the device that updated the progress
This commit is contained in:
hiperman
2025-12-12 14:19:16 -05:00
parent 7ca0a21283
commit 766fca2c39
5 changed files with 25 additions and 15 deletions

View File

@@ -79,8 +79,8 @@
await fetch(`/api/books/progress/${bookId}`, {
method: 'POST',
body: JSON.stringify({
progress: currentProgress,
epub_loc: currentLocation,
percentage: currentProgress,
epub_cfi: currentLocation,
completed: currentProgress === 1
})
});

View File

@@ -38,9 +38,9 @@
: ''}"
/>
</a>
{#if book.progress?.progress && !selected && !darkened}
{#if book.progress?.percentage && !selected && !darkened}
<Progress
value={book.progress.progress}
value={book.progress.percentage}
max={1}
class="mt-[-8px] h-1 rounded {book.progress.completed
? '[&>div]:bg-green-600'

View File

@@ -68,9 +68,9 @@
class="h-full w-full overflow-hidden rounded object-cover"
/>
{#if book?.progress?.progress}
{#if book?.progress?.percentage}
<Progress
value={book?.progress.progress}
value={book?.progress.percentage}
max={1}
color={book?.progress.completed ? 'bg-green-600' : 'bg-yellow-500'}
class="mt-[-8px] h-2 rounded {book?.progress.completed