Update Bruno collection test documentation to reflect the new unified static-style
URL strategy for cover images and media downloads.
Changes:
- Update cover image endpoint from /api/covers/{id} to /uploads/library-{id}/{path}
- Update download endpoint from /api/media-items/{id}/download to /uploads/library-{id}/{path}
- Document JWT authentication for static endpoints (same as API endpoints)
- Add clarification that resolved URLs come from API responses
- Update status codes to reflect new endpoint behavior
- Rename 'Download Media Item.yml' to 'EPUB Download.yml' for clarity
This documentation aligns with the unified URL strategy where all file access
goes through a consistent /uploads/library-{id}/ pattern with JWT-based
authentication, eliminating separate API endpoints for file serving.
This commit updates the cover image serving plan to use a more streamlined,
universal approach for file serving across all clients.
Key changes to the plan:
- Adopt unified URL format `/uploads/library-{id}/relative/path` for both
covers and book files, replacing separate /api/files and /api/covers endpoints
- Centralize path resolution through LibraryService.ResolveMediaPath() as the
single source of truth for all handlers
- Consolidate file serving into one authenticated ServeFile handler that
works for web, mobile, and device clients
- Update OPDS handler integration to use the same resolution logic
- Reorganize implementation phases to reflect the unified architecture
Benefits of this approach:
- Simpler routing with one wildcard handler instead of multiple endpoints
- Consistent path resolution logic across MediaHandler, OPDSHandler, and
future handlers
- Better support for multiple libraries and mount points
- Single authentication flow for all file access
- Easier maintenance and testing with centralized resolution
This plan change does not modify any implementation code, only the
documentation for the intended implementation.
Expands the cover image serving plan into a comprehensive file and cover
image serving implementation guide:
- Rename plan to cover both files and cover images
- Add Phase 1: Store relative file paths (not just cover paths)
- Add Phase 2: Create ResolveMediaPath helper in service layer
- Add Phase 3: Modify existing endpoints to return resolved URLs
- Add Phase 4: Update Download handler to use relative paths
- Add Phase 5: Cover image endpoint (consolidated from original)
- Add Phase 6: Frontend changes (no changes needed for SSR)
- Add Phase 7: Backward compatibility for absolute paths
- Add Phase 8: Unit and integration tests
- Add Phase 9: Documentation and Bruno API tests
- Include full code examples for each phase
- Document flexibility for docker-compose mount points
Add detailed implementation plan for fixing cover image serving to:
- Support multiple library folders in docker compose
- Keep covers with books using relative paths in database
- Serve images via authenticated API endpoint
Plan covers:
- Phase 1: Update scanner to store relative paths
- Phase 2: Create /api/covers/:id endpoint with auth
- Phase 3: Update frontend to use new API endpoint
- Phase 4: Backward compatibility for existing data
- Phase 5-6: Tests and API documentation