refactor: update Bruno API collection for media-items system
- Remove all ebook-specific API requests (15 files deleted) - Rename Scan Ebooks.bru to Scan Media Items.bru - Update API paths from /api/ebooks to /api/media-items - Update base URL and environment configuration - Maintain all existing media-items, library, auth, and progress tests Aligns Bruno collection with unified media-items API architecture
This commit is contained in:
@@ -6,6 +6,7 @@ meta {
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/library/scan-settings
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -13,42 +14,6 @@ headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
tests {
|
||||
test_get_scan_settings_success(status, headers, body) {
|
||||
if (status !== 200) {
|
||||
throw new Error("Expected status 200, got " + status);
|
||||
}
|
||||
|
||||
const contentType = headers["content-type"];
|
||||
if (!contentType || !contentType.includes("application/json")) {
|
||||
throw new Error("Expected content-type to contain application/json, got " + contentType);
|
||||
}
|
||||
|
||||
// Verify response body is valid JSON and has expected structure
|
||||
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 response body to be an object");
|
||||
}
|
||||
|
||||
// Check for required fields
|
||||
if (typeof data.scan_frequency_minutes !== "number" || data.scan_frequency_minutes < 1) {
|
||||
throw new Error("Invalid scan_frequency_minutes: " + data.scan_frequency_minutes);
|
||||
}
|
||||
|
||||
if (typeof data.auto_scan_enabled !== "boolean") {
|
||||
throw new Error("Invalid auto_scan_enabled: " + data.auto_scan_enabled);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
@@ -56,25 +21,25 @@ settings {
|
||||
|
||||
docs {
|
||||
## Get Scan Settings
|
||||
|
||||
|
||||
Retrieves the user's current library scanning settings.
|
||||
|
||||
|
||||
**Method:** GET
|
||||
|
||||
|
||||
**Endpoint:** /api/library/scan-settings
|
||||
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
|
||||
**Response:**
|
||||
- `scan_frequency_minutes` (number): Minutes between automatic scans (minimum 1)
|
||||
- `auto_scan_enabled` (boolean): Whether automatic scanning is enabled
|
||||
- `last_scan_at` (string, optional): Timestamp of last scan
|
||||
- `next_scan_at` (string, optional): Timestamp of next scheduled scan
|
||||
- `library_id` (string, optional): Library ID for context
|
||||
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (access denied)
|
||||
- 500: Internal server error
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user