Revert unauthorized route changes made during router refactoring: Device Routes: - Change :token back to :registration_id in approve/reject routes - Keep routes in correct location (approve/reject in protected group) OPDS Routes: - Restore /opds/devices/:deviceId/* structure (was /opds/:id/*) - Add back missing :bookId parameter for download/cover/formats - Change 'navigation' back to 'nav' Queue Routes: - Add missing admin-only routes - Add missing device-specific queue management routes All routes now match original main.go signatures exactly. Breaking changes reverted - API contract restored.
16 lines
636 B
Go
16 lines
636 B
Go
package router
|
|
|
|
func registerOPDSRoutes(cfg *Config) {
|
|
e := cfg.Echo
|
|
|
|
// OPDS routes (public - device authentication optional)
|
|
// Note: OPDSHandler implements its own device authentication
|
|
opds := e.Group("/opds/devices")
|
|
opds.GET("/:deviceId/catalog", cfg.OPDSHandler.GetDeviceCatalog)
|
|
opds.GET("/:deviceId/search", cfg.OPDSHandler.SearchDeviceCatalog)
|
|
opds.GET("/:deviceId/nav", cfg.OPDSHandler.GetDeviceNavigation)
|
|
opds.GET("/:deviceId/download/:bookId", cfg.OPDSHandler.DownloadBook)
|
|
opds.GET("/:deviceId/cover/:bookId", cfg.OPDSHandler.GetCoverImage)
|
|
opds.GET("/:deviceId/formats/:bookId", cfg.OPDSHandler.ListFormats)
|
|
}
|