Phase 1 Week 3: Core Progress APIs
- Create internal/handlers/progress.go with universal progress endpoints - GET /api/progress/:id - Get progress with all location references - POST /api/progress/:id - Update progress with automatic conversion - GET /api/progress/:id/history - Get reading session history - Progress response includes: - format_group (reflowable, fixed_layout, comic_archive) - percentage (0.0-1.0) - location_references (page, epubcfi, chapter, character) - device_sync information - UpdateUniversalProgress accepts multiple input formats: - percentage directly - page/total_pages (auto-converts to percentage) - epubcfi for EPUBs - chapter/chapter_progress - Uses sync package for format conversion - Backward compatible with existing progress endpoints - Add routes to SetupRoutes in ebook.go - Fixes pgtype wrapper type access (.Float64, .Int32, .Int64)
This commit is contained in:
@@ -76,10 +76,17 @@ func SetupRoutes(g *echo.Group, db *database.Queries) *Handler {
|
||||
g.GET("/media-items/:id/rating", h.GetMediaRating)
|
||||
g.PUT("/media-items/:id/rating", h.UpdateMediaRating)
|
||||
g.DELETE("/media-items/:id/rating", h.DeleteMediaRating)
|
||||
|
||||
// Legacy progress routes (deprecated - use universal progress instead)
|
||||
g.GET("/media-items/:id/progress", h.GetMediaReadingProgress)
|
||||
g.PUT("/media-items/:id/progress", h.UpdateMediaReadingProgress)
|
||||
g.DELETE("/media-items/:id/progress", h.DeleteMediaReadingProgress)
|
||||
|
||||
// Universal Progress routes (Phase 1)
|
||||
g.GET("/progress/:id", h.GetUniversalProgress)
|
||||
g.POST("/progress/:id", h.UpdateUniversalProgress)
|
||||
g.GET("/progress/:id/history", h.GetProgressHistory)
|
||||
|
||||
// Notes routes
|
||||
g.GET("/media-items/:id/notes", h.GetMediaNotes)
|
||||
g.POST("/media-items/:id/notes", h.CreateMediaNote)
|
||||
|
||||
Reference in New Issue
Block a user