Add audio timing support for Bible chapters#49
Open
KallynGowdy wants to merge 4 commits into
Open
Conversation
Implements the API design from issue #10 (comment #2657325351): chapters now expose thisChapterAudioTimings/previousChapterAudioTimings/nextChapterAudioTimings link maps, and a new per-reader endpoint `/api/{translation}/{book}/{chapter}.{reader}.audioTimings.json` returns the per-verse start times (in seconds). Timing data is stored in a new ChapterAudioTiming table (mirroring ChapterAudioUrl) and surfaced through dataset generation, API generation, and static file output, following the existing audio-links plumbing. Since no formula can generate real timing data, a new `import-audio-timings` CLI command lets timing data be loaded from a JSON file into the database whenever it becomes available. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Ku4uMT7pCxVbLKnUCf9rC
The docs build (vuepress + @vuepress/theme-default) compiles SCSS via Vite, which requires a sass implementation to be installed but none was declared, breaking `npm run build:docs` in CI (and locally). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Ku4uMT7pCxVbLKnUCf9rC
The workflow was pinned to Node 20.x while package.json requires node ^22.19.0. This mismatch left pnpm installing on an unsupported engine, which likely contributed to native module (better-sqlite3) build failures on Windows runners. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Ku4uMT7pCxVbLKnUCf9rC
better-sqlite3 can't compile on the windows-latest runner: node-gyp v11.1.0 (bundled with pnpm 10.12.1) doesn't recognize the Visual Studio version installed on the image, so the native module build fails regardless of Node version. This is an upstream node-gyp/toolchain gap, not something fixable from this repo. Testing on ubuntu and macOS covers the supported platforms until that's resolved separately. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Ku4uMT7pCxVbLKnUCf9rC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive support for audio timings (per-verse start times in seconds) across the Bible API generation and CLI tools. Audio timings allow clients to know exactly when each verse begins in an audio recording, enabling features like synchronized verse highlighting during playback.
Key Changes
API Generation (
packages/helloao-tools/generation/)ApiTranslationBookChapterAudioTimingsschema and type to represent audio timing data for a specific chapter and readerApiTranslationBookChapterto include three new fields:thisChapterAudioTimings: Links to audio timing files for the current chapternextChapterAudioTimings: Links to audio timing files for the next chapter (nullable)previousChapterAudioTimings: Links to audio timing files for the previous chapter (nullable)bookChapterAudioTimingsApiLink()helper function to generate API endpoints for audio timing files/api/{translation}/{book}/{chapter}.{reader}.audioTimings.jsonto OpenAPI documentationDatabase Layer (
packages/helloao-cli/)ChapterAudioTimingPrisma model to store per-verse timing data (JSON array of seconds)ChapterAudioTimingtable with proper foreign key relationshipsupsertChapterAudioTiming()function for inserting/updating timing recordsinsertTranslationContent()to persist audio timings when importing translationsloadTranslationDatasets()to load audio timings from the databaseCLI Tools (
packages/helloao-cli/)importAudioTimings()command to import audio timing data from JSON filesimport-audio-timingsCLI command that accepts a JSON file with timing recordsAudioTimingRecordinterface for the import formatData Models (
packages/helloao-tools/generation/common-types.ts)TranslationBookChapterAudioTimingsschema and type representing a map of reader IDs to verse timing arraysTranslationBookChapterto includethisChapterAudioTimingsfieldTests
Implementation Details
{chapter}.{reader}.audioTimings.jsonhttps://claude.ai/code/session_016Ku4uMT7pCxVbLKnUCf9rC