[RSM] Support generated chapters#5277
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for persisting AI-generated chapters from the server “-meta.json” transcript metadata when curated chapters are missing, using a Moshi DTO for parsing.
Changes:
- Parse transcript meta JSON into a new
EpisodeMetaResponseDTO via Moshi. - Extend
TranscriptManagerImpl.loadSummaryTextto opportunistically save AI chapters when no existing chapters are present. - Add unit tests covering chapter persistence / skipping behavior and meta JSON permutations.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/transcript/TranscriptManagerImpl.kt | Parses meta JSON with Moshi and saves AI chapters when appropriate. |
| modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/transcript/EpisodeMetaResponse.kt | New Moshi DTO for meta JSON (summary, chapters). |
| modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/transcript/TranscriptManagerTest.kt | Adds coverage for saving/skipping AI chapters from meta JSON. |
| modules/services/repositories/build.gradle.kts | Enables Moshi codegen via KSP for @JsonClass(generateAdapter = true). |
|
I would suggest an icon is used to inform people these are AI chapters, also maby limit the number of chapters go 10 per hour 🤔🤔 |
|
Version |
|
@CookieyedCodes Great suggestions! We've added a text disclaimer that appears above the chapters list when they're AI-generated to set user expectations. An icon indicator and chapter density limits are good ideas for a future iteration — keeping them out of this PR's scope for now. |
eaddc9c to
93bfbc6
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
modules/services/utils/src/main/java/au/com/shiftyjelly/pocketcasts/utils/featureflag/Feature.kt:274
- PR description is focused on AI-generated chapters, but this diff also introduces a new BLOGS feature flag and substantial Blogs-related UI/networking changes. Please update the PR description/scope (or split into a separate PR) so reviewers and release notes can track these independently.
GENERATED_CHAPTERS(
key = "generated_chapters",
title = "AI-Generated Chapters",
defaultValue = isDebugOrPrototypeBuild,
tier = FeatureTier.Free,
hasFirebaseRemoteFlag = true,
hasDevToggle = true,
),
AI_SUMMARIES(
key = "ai_summaries",
title = "AI Summaries",
defaultValue = isDebugOrPrototypeBuild,
tier = FeatureTier.Free,
hasFirebaseRemoteFlag = true,
hasDevToggle = true,
),
| PlaybackStatsEvent::class, | ||
| ], | ||
| version = 127, | ||
| version = 128, |
| MIGRATION_123_124, | ||
| MIGRATION_124_125, | ||
| MIGRATION_125_126, | ||
| MIGRATION_126_127, | ||
| MIGRATION_127_128, | ||
| ) |
|
Can I suggest something, if rss time tags are detected in the show notes, it might be nice that those are generated as chapters over AI generated transcripts chapters 🤔🤔 |

Description
This PR is part of the Radical Speed Month initiative.
It builds upon our previous work with AI summaries for episodes.
Adds support for AI-generated chapters -- when an episode doesn't have curated chapters but has the server-generated meta file (that contains both summary and chapters), we will grab those chapters and store them in our database.
This PR also introduces
EpisodeMetaResponsethat is a DTO to map the meta file's JSON format and we use Moshi to parse the file's content.Testing Instructions
Screenshots or Screencast
Checklist
./gradlew spotlessApplyto automatically apply formatting/linting)modules/services/localization/src/main/res/values/strings.xml