Audio with range requests, library.json, Homer books; LRC parser. Content stays out of git and the image. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1.9 KiB
1.9 KiB
status
| status |
|---|
| in-progress |
Plan 003 — content mount
Spec: docs/specs/003-content-mount.md. TDD: write the test, see it fail, implement, see it pass.
- 1.
src/shared/lrc.ts—parseLrc(text): { time: number; text: string }[]. Tests intests/content.test.ts: basic lines,[mm:ss]and[mm:ss.xx]/[mm:ss.xxx], multiple stamps on one line,[ar:…]-style metadata skipped, CRLF, sorted output. - 2.
src/content/library.ts—scanLibrary(dir): saga foldersEPIC - <Name> (<year>), song files… - NN - <Title>.flac, sagas in story order (Troy, Cyclops, Ocean, Circe, Underworld, Thunder, Wisdom, Vengeance, Ithaca; unknown names after, by year then name), lyrics.lrcpreferred else.txt,folder.jpgcover. URLs under/content/files/with each path segment URI-encoded. Fixture folder built in a temp dir by the test. - 3.
src/content/homer.ts—splitBooks(text): between the Gutenberg START/END markers, headingsBOOK <roman>(optional trailing dot), CRLF-safe; returns{ book, heading, summary, paragraphs }[]. Test with a small fixture string. - 4.
src/content/routes.ts—contentResponse(req, dir | undefined): Response | nullhandling the three routes, traversal guard, range requests (206 with Content-Range). Wire intosrc/server.tsfetch(). Route tests viastartServerwithCONTENT_DIRpointing at the fixture, and without it. - 5.
.gitignore/.dockerignore: ignoreepic-the-musical-content/,content/,*.flac,*.lrc. - 6. Docs: AGENTS.md (lyrics rule, content line in Architecture/Commands),
docs/ARCHITECTURE.md,docs/DECISIONS.md,docs/design/002-direction-round-notes.md§7 run command. - 7. Verify:
bun test,bun run typecheck,bun run build; rebuild the preview container with the mount; curl library.json (9 sagas, 40 songs), a range request on a FLAC, an Odyssey book.