[Synced Transcripts] Add timing fields to transcript entries #5321
Open
sztomek wants to merge 2 commits into
Open
[Synced Transcripts] Add timing fields to transcript entries #5321sztomek wants to merge 2 commits into
sztomek wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR lays groundwork for synced transcripts by adding start/end timing (ms) to transcript text entries and threading that timing through subtitle parsers and transcript sanitization, gated behind a new feature flag.
Changes:
- Added
startTimeMs/endTimeMsfields (default-1L) toTranscriptEntry.Text. - Updated WebVTT/SRT parsing to attach cue timing to
TranscriptEntry.Text, and JSON parsing to convertstartTime/endTimeinto ms. - Updated transcript sanitization to accumulate timing spans when joining split sentences; added a new
SYNCED_TRANSCRIPTSfeature flag.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/services/utils/src/main/java/au/com/shiftyjelly/pocketcasts/utils/featureflag/Feature.kt | Adds the SYNCED_TRANSCRIPTS feature flag definition. |
| modules/services/model/src/main/java/au/com/shiftyjelly/pocketcasts/models/to/TranscriptEntry.kt | Extends TranscriptEntry.Text with startTimeMs/endTimeMs (default -1L). |
| modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/transcript/TranscriptParser.kt | Threads timing through subtitle parsing and JSON parsing into transcript entries. |
| modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/transcript/TranscripSanitization.kt | Accumulates and propagates timing when joining sentence fragments. |
| modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/transcript/WebVttParserTest.kt | Updates expected entries to include parsed WebVTT timings. |
| modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/transcript/SrtParserTest.kt | Updates expected entries to include parsed SRT timings. |
cd17406 to
95bd8f9
Compare
Collaborator
geekygecko
approved these changes
May 26, 2026
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.
Description
This PR is part of the Radical Speed Month initiative.
It lays the groundwork for synced transcripts by threading timing data through the transcript pipeline.
TranscriptEntry.TextgainsstartTimeMs/endTimeMsfields (defaulting to-1Lso all existing callers are unaffected). All parsers (WebVTT, SRT, JSON) now extract timing from their source formats, and thejoinSplitSentences()sanitizer accumulates timing spans when merging fragments.Also adds the
SYNCED_TRANSCRIPTSfeature flag (Free tier, debug/prototype default, Firebase remote + dev toggle).Testing Instructions
Just review the code please.
Checklist
./gradlew spotlessApplyto automatically apply formatting/linting)modules/services/localization/src/main/res/values/strings.xml