diff --git a/cover_image_serving_plan.md b/cover_image_serving_plan.md index c2fad00..078fef3 100644 --- a/cover_image_serving_plan.md +++ b/cover_image_serving_plan.md @@ -524,17 +524,18 @@ info: seq: 1 http: method: GET - url: '{{base_url}}/api/covers/{{media_item_id}}' + url: '{{base_url}}/uploads/library-{{library_id}}/path/to/cover.jpg' auth: none docs: |- ## Get Cover Image - Retrieve the cover image for a media item. Requires authentication. + Retrieve the cover image for a media item via authenticated static-style URL. + Uses JWT authentication (same as API endpoints). **Method:** GET - **Endpoint:** /api/covers/{id} + **Endpoint:** /uploads/library-{id}/{path} **Authentication:** Bearer token required @@ -542,16 +543,19 @@ docs: |- **Status Codes:** - 200: Success - returns image - - 400: Invalid media item ID - - 401: Unauthorized - - 404: Media item not found or cover doesn't exist + - 401: Unauthorized (missing/invalid JWT) + - 404: File not found + + **Note:** The actual path would come from the API response which provides + the resolved URL. This test is a template showing the URL format. -Note: Uses `media_item_id` from environment variables. +vars: + library_id: "" ``` -#### File: `bruno/media-items/Download Media Item.yml` (Update existing) +#### File: `bruno/media-items/EPUB Download.yml` (Update existing) -Update the existing file to document that it now handles relative paths: +Update the existing file to note that downloads now work through the same `/uploads/library-{id}/` endpoint: ```yaml info: @@ -560,17 +564,18 @@ info: seq: 1 http: method: GET - url: '{{base_url}}/api/media-items/{{media_item_id}}/download' + url: '{{base_url}}/uploads/library-{{library_id}}/path/to/book.epub' auth: none docs: |- ## Download Media Item - Download a media item file (EPUB, PDF, CBZ, etc.) from Bookhoard server. + Download a media item file (EPUB, PDF, CBZ, etc.) via authenticated static-style URL. + Uses JWT authentication (same as API endpoints). **Method:** GET - **Endpoint:** /api/media-items/{id}/download + **Endpoint:** /uploads/library-{id}/{path} **Authentication:** Bearer token required @@ -584,11 +589,14 @@ docs: |- **Status Codes:** - 200: Success - returns file - - 400: Invalid media item ID - - 401: Unauthorized - - 404: Media item not found or file doesn't exist on disk + - 401: Unauthorized (missing/invalid JWT) + - 404: File not found + + **Note:** The actual path would come from the API response which provides + the resolved URL. This test shows the URL format. -Note: Uses `media_item_id` from environment variables. +vars: + library_id: "" ``` ---