Kobo emulation + KOReader calibre-compatible surface backfilled with
device-token auth; collections reorder + update_rule created.
Claude registry: 12 entries. kobo/koreader emulation endpoints all bind
arbitrary protocol POST bodies (markup/bookmark/gettests/sync-from-server,
koreader progress/bookmarks) — registered as AnyJSONObject, not bodyless as
first drafted. Initialization returns the library sync payload, not the init
response.
Contract correction in update_rule.md: the route is SetRuleEnabled ({enabled}
required -> {collection_id, is_smart}); Beam's draft invented rule-field
updates. Reordered response/status: {item_ids} -> {status: reordered}.
make test 9/9.
47 lines
1.2 KiB
Markdown
47 lines
1.2 KiB
Markdown
---
|
|
method: PUT
|
|
path: /api/collections/:id/items/order
|
|
auth: jwt
|
|
area: collections
|
|
---
|
|
<!-- source: internal/handlers/collections.go:1332 CollectionHandler.ReorderItems -->
|
|
|
|
# Reorder Collection Items
|
|
|
|
Applies a static collection's manual playlist order. Owner-only; the payload
|
|
is the COMPLETE ordered id list — ids omitted keep their relative order
|
|
appended after (the service never deletes membership).
|
|
|
|
## Example request
|
|
|
|
```json example-request
|
|
{
|
|
"item_ids": [
|
|
"550e8400-e29b-41d4-a716-446655440000",
|
|
"660e8400-e29b-41d4-a716-446655440001"
|
|
]
|
|
}
|
|
```
|
|
|
|
## Example response
|
|
|
|
```json example-response
|
|
{
|
|
"status": "reordered"
|
|
}
|
|
```
|
|
|
|
## Fields
|
|
|
|
| Field | Type | Required | Notes |
|
|
| ----- | ---- | -------- | ----- |
|
|
| item_ids | array of string (uuid) | Yes | Complete ordered list of media item ids |
|
|
|
|
## Errors
|
|
|
|
| Status | Body | When |
|
|
| ------ | ---- | ---- |
|
|
| 400 | `{"error": "item_ids must be a non-empty ordered id list"}` / `{"error": "invalid media item id: ..."}` | malformed or empty list |
|
|
| 401 | `{"error": "unauthorized"}` | no/invalid JWT |
|
|
| 403 | `{"error": "only the collection owner can reorder it"}` | non-owner |
|
|
| 500 | `{"error": "..."}` | unexpected server error | |