Fix all wrong-path artifacts identified by the audit: - Kobo sync endpoints (init/bookmark/markup/sync-from-server/analytics): add missing :token device segment (6 doc files incl. kobo-protocol.md) - Highlights/notes update+delete: add missing /:id media-item prefix - media-items/download_media_item.md: removed (static /uploads route, not an API endpoint; info about the file route is recoverable from OPDS docs) - Bruno: /libraries/visible -> /visibility, /collections/books missing id, /audio/0 -> track_index - operations/troubleshooting.md: same /libraries/visible -> /visibility fix - media-items/get_audio_track.md + get_audio_chapters.md: /audio/0 examples fixed - Deleted monolithic docs/developer/api-reference.md (duplicate of split docs) - Fixed 4 stale entries in docs/developer/api/api-reference.md (split index) Audit re-run: orphan docs 0, orphan Bruno 6 (all scenario files with literal IDs).
54 lines
1.6 KiB
Markdown
54 lines
1.6 KiB
Markdown
# Get Audio Chapters
|
|
|
|
The format-abstraction chapter list for audiobooks, sourced from
|
|
`media_items.audio_metadata`. Embedded m4b chapters, folder-of-tracks
|
|
books and zip-of-audio books all write the same chapter shape; the
|
|
locator `{chapter, audio_offset_seconds}` and this endpoint never learn
|
|
which file model produced them.
|
|
|
|
**Endpoint**: `GET /api/media-items/{id}/chapters`
|
|
**Auth**: Required (JWT)
|
|
|
|
## Response
|
|
|
|
```json
|
|
{
|
|
"media_item_id": "…",
|
|
"chapters": [
|
|
{ "index": 0, "title": "Chapter One", "start": 0.0, "end": 168.0 }
|
|
],
|
|
"duration_seconds": 36000.0,
|
|
"codec_profile": "mp3",
|
|
"layout": "folder",
|
|
"tracks": [
|
|
{
|
|
"index": 0,
|
|
"url": "/api/media-items/{id}/audio/{trackIndex}",
|
|
"title": "01 First",
|
|
"path": "Author/Title/01 First.mp3",
|
|
"start": 0.0,
|
|
"end": 168.0,
|
|
"duration_seconds": 168.0,
|
|
"size_bytes": 2700000
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
- `layout` is `""` for single-file books (the Batch A model — the whole
|
|
file streams through the `/uploads` path), `"folder"` for a directory
|
|
of track files and `"zip"` for a zip-of-audio book.
|
|
- `tracks` is empty for single-file books and carries one entry per
|
|
playable file otherwise. `start`/`end` are cumulative GLOBAL seconds —
|
|
the same coordinate system chapters, bookmarks and
|
|
`audio_offset_seconds` use.
|
|
|
|
## Error Responses
|
|
|
|
| Code | Description |
|
|
| ---- | ------------------------------- |
|
|
| 400 | Invalid media item id |
|
|
| 401 | Missing/invalid token |
|
|
| 404 | Book not found |
|
|
| 500 | audio_metadata failed to parse |
|