feat: add 16 missing Bruno requests for complete API coverage
Add missing Bruno requests for all API endpoints: Library Management: - Get Library - retrieve single library details - Update Library - modify existing library - Delete Library - remove library and media items - Delete Library Folder - remove folder from library - Get Library Stats - retrieve library statistics Media Items Management: - Create Media Item - add new media with full metadata - Update Media Item - modify existing media metadata - Delete Media Item - remove media from library - Get Media Rating - retrieve single media rating - Delete Media Rating - remove user's media rating Coverage now complete: 47/47 API endpoints have Bruno requests Organized requests in proper folder structure for maintainability
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
meta {
|
||||
name: Get Media Rating
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/media-items/{{media_item_id}}/rating
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
tests {
|
||||
test_get_media_rating_success(status, headers, body) {
|
||||
if (status !== 200) {
|
||||
throw new Error("Expected status 200, got " + status);
|
||||
}
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(body);
|
||||
} catch (e) {
|
||||
throw new Error("Response body is not valid JSON");
|
||||
}
|
||||
|
||||
if (!data || typeof data !== "object") {
|
||||
throw new Error("Expected rating object in response");
|
||||
}
|
||||
|
||||
// Verify expected fields
|
||||
if (!data.media_item_id || !data.rating === undefined) {
|
||||
throw new Error("Rating response missing required fields: media_item_id, rating");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
mediaItemId: "550e8400-e29b-41d4-a716-446655440000"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get Media Rating
|
||||
|
||||
Retrieves a user's rating for a specific media item.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/media-items/{id}/rating
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Media item UUID
|
||||
|
||||
**Response:** Rating object
|
||||
- `id` (string): Rating UUID
|
||||
- `media_item_id` (string): Media item UUID
|
||||
- `user_id` (string): User UUID
|
||||
- `rating` (integer): Rating value (1-10 scale)
|
||||
- `created_at` (string): Creation timestamp
|
||||
- `updated_at` (string): Last update timestamp
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 404: Media item not found
|
||||
- 500: Internal server error
|
||||
|
||||
**Examples:**
|
||||
- Get media rating: `GET /api/media-items/550e8400-e29b-41d4-a716-446655440000/rating`
|
||||
|
||||
**Note:** Returns the authenticated user's rating for the specified media item.
|
||||
}
|
||||
Reference in New Issue
Block a user