feat(templates): expand reader and progress template types for format-aware display
Add fields to ReaderMetadata and ReadingProgress template types to support KOReader-like progress display: ReaderMetadata: - TotalCharacters: from media item, used for estimated page calculation - EstimatedPages: computed via sync.EstimatedPages() ReadingProgress: - Chapter: current chapter index from reading_progress - ChapterProgress: within-chapter progress (0-100, multiplied from DB fraction) - FormatGroup: item format for conditional display logic These fields enable format-aware progress display (pages for comics/PDFs, estimated pages for reflowable, percentage for all).
This commit is contained in:
+13
-8
@@ -161,17 +161,22 @@ type ReaderMetadata struct {
|
||||
ReadingDirection string `json:"reading_direction"`
|
||||
FileURL string `json:"file_url"`
|
||||
LibraryID string `json:"library_id"`
|
||||
TotalCharacters int64 `json:"total_characters"`
|
||||
EstimatedPages int `json:"estimated_pages"`
|
||||
}
|
||||
|
||||
type ReadingProgress struct {
|
||||
ID string
|
||||
MediaItemID string
|
||||
UserID string
|
||||
CurrentPage int
|
||||
TotalPages int
|
||||
Percentage float64
|
||||
EpubCfi string
|
||||
LastReadAt time.Time
|
||||
ID string
|
||||
MediaItemID string
|
||||
UserID string
|
||||
CurrentPage int
|
||||
TotalPages int
|
||||
Percentage float64
|
||||
EpubCfi string
|
||||
LastReadAt time.Time
|
||||
Chapter int
|
||||
ChapterProgress float64
|
||||
FormatGroup string
|
||||
}
|
||||
|
||||
type Bookmark struct {
|
||||
|
||||
Reference in New Issue
Block a user