Files
bookhoard/docs/developer/api/media-items/set_audio_speed.md
T
John O'Keefe 4a6fb033cb docs(media-items): Work Order 3 batch 3b — management endpoints (8)
New frontmatter'd docs:
- download (ServeFile — raw bytes, family-lens enforced; corrects the old
  download doc's claim that no download route is registered: ServeFile IS
  routed, DownloadBook is the dead code)
- set_audio_speed (speed range 0.25-4.0, NaN/Inf rejected)
- rescan (abridged example over the full 70+-column row; write-after-success
  guarantee noted)
- purge-archived (destructive, admin), unarchive (204), merge (SHA-256
  precondition, per-user collisions keep active copy)
- facets (two modes: facet+values, field autocomplete counts)
- filter_count (family lens)

Registry: RawMessage pins for map/abridged responses; Schema{} for non-JSON
body routes (download = raw bytes; unarchive = 204). Audit now:
missing docs down to ~55 (from 112), 0 orphans.
2026-10-24 15:06:23 -04:00

38 lines
911 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
method: PUT
path: /api/media-items/:id/audio-speed
auth: jwt
area: media-items
---
<!-- source: internal/handlers/media.go:3033 MediaHandler.SetAudioSpeed -->
# Set Audio Speed
Persists the audiobook playback speed for the signed-in user on one media
item. Speed must be within **0.25–4.0** (NaN/Inf rejected).
## Example request
```json example-request
{
"speed": 1.5
}
```
## Example response
```json example-response
{
"playback_speed": 1.5
}
```
## Errors
| Status | Body | When |
| ------ | ---- | ---- |
| 400 | `{"error": "invalid media item id"}` / `{"error": "invalid request"}` / `{"error": "speed out of range"}` | malformed or out-of-range |
| 401 | `{"error": "authentication required"}` / `{"error": "invalid user"}` | no/invalid auth |
| 404 | `{"error": "book not found"}` | no such media item |
| 500 | `{"error": "failed to save playback speed"}` | unexpected server error |