- Update api-reference.md with current endpoint list - Update bulk_update_books.md with improved documentation - Update scanner/overview.md to reference scan_library.md
2.3 KiB
2.3 KiB
Bulk Update Books
Update multiple media items at once.
Endpoint: POST /api/books/bulk-update
Auth: Required
Content-Type: application/json
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| updates | array of objects | Yes | Array of update operations (see below) |
Update Object
| Field | Type | Required | Description |
|---|---|---|---|
| book_id | string (UUID) | Yes | Media item UUID to update |
| updates | object | Yes | Fields to update (see below) |
Update Fields
| Field | Type | Required | Description |
|---|---|---|---|
| title | string | No | Updated title |
| author | string | No | Updated author |
| genre | string | No | Updated genre |
| language | string | No | Updated language |
| tags | array of strings | No | Updated tags (auto-normalized) |
| contributors | array of strings | No | Updated contributors (auto-normalized) |
Example Request
{
"updates": [
{
"book_id": "550e8400-e29b-41d4-a716-446655440001",
"updates": {
"title": "Updated Title",
"genre": "Science Fiction",
"tags": ["science fiction", "non-fiction", "ACME CORP."]
}
},
{
"book_id": "660e8400-e29b-41d4-a716-446655440002",
"updates": {
"author": "Updated Author",
"contributors": ["O'Reilly Media", "Penguin Random House"]
}
}
]
}
Response (200 OK)
{
"results": [
{
"book_id": "550e8400-e29b-41d4-a716-446655440001",
"success": true
},
{
"book_id": "660e8400-e29b-41d4-a716-446655440002",
"success": true
}
],
"total": 2,
"success": 2,
"failed": 0
}
Tag and Contributor Normalization
The backend automatically normalizes tags and contributors:
- Tags: Titlecased, punctuation preserved, deduplicated
- Contributors: Original casing preserved, punctuation preserved
- Search fields: Lowercase, no punctuation, stored in
tags_searchandcontributors_search
Error Responses
| Code | Description |
|---|---|
| 400 | Invalid request data |
| 401 | Invalid or expired token |
| 403 | User does not have permission |
| 404 | One or more media items not found |