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:
@@ -161,6 +161,8 @@ type ReaderMetadata struct {
|
|||||||
ReadingDirection string `json:"reading_direction"`
|
ReadingDirection string `json:"reading_direction"`
|
||||||
FileURL string `json:"file_url"`
|
FileURL string `json:"file_url"`
|
||||||
LibraryID string `json:"library_id"`
|
LibraryID string `json:"library_id"`
|
||||||
|
TotalCharacters int64 `json:"total_characters"`
|
||||||
|
EstimatedPages int `json:"estimated_pages"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadingProgress struct {
|
type ReadingProgress struct {
|
||||||
@@ -172,6 +174,9 @@ type ReadingProgress struct {
|
|||||||
Percentage float64
|
Percentage float64
|
||||||
EpubCfi string
|
EpubCfi string
|
||||||
LastReadAt time.Time
|
LastReadAt time.Time
|
||||||
|
Chapter int
|
||||||
|
ChapterProgress float64
|
||||||
|
FormatGroup string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Bookmark struct {
|
type Bookmark struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user