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
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user