From 6dbcc8c8c3ed094dde826152bdfdbc2cb3fc7cdc Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Fri, 3 Apr 2026 17:20:13 -0400 Subject: [PATCH] feat: add reader types to templates package - Add ReaderMetadata struct with media item details - Add ReadingProgress struct for progress tracking - Add Bookmark struct for user bookmarks --- templates/types.go | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/templates/types.go b/templates/types.go index 40d3eea..28a2a44 100644 --- a/templates/types.go +++ b/templates/types.go @@ -144,3 +144,41 @@ type UnsafeHTML string func (u UnsafeHTML) ToComponent() templ.Component { return templ.Raw(string(u)) } + +// Reader types +type ReaderMetadata struct { + MediaItemID string `json:"media_item_id"` + Title string `json:"title"` + Author string `json:"author"` + CoverImagePath string `json:"cover_image_path"` + LibraryType string `json:"library_type"` + MimeType string `json:"mime_type"` + FilePath string `json:"file_path"` + TotalPages int `json:"total_pages"` + ChapterCount int `json:"chapter_count"` +} + +type ReadingProgress struct { + ID string + MediaItemID string + UserID string + CurrentPage int + TotalPages int + Percentage float64 + EpubCfi string + CreatedAt time.Time + UpdatedAt time.Time +} + +type Bookmark struct { + ID string + MediaItemID string + UserID string + PageNumber *int + ChapterNumber *int + CfiPosition string + Title string + Position string + Notes string + CreatedAt time.Time +}