fix(server): load embedded Plex subtitles - #199
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation is coherent, preserves existing proxy invariants, and includes focused regression coverage for the new behavior.
Pull request overview
Adds reliable Plex embedded subtitle extraction and actionable editor errors.
Changes:
- Prepares and validates Plex subtitle decisions using isolated sessions.
- Preserves media selection and supports cancellation.
- Parses server error details for frontend subtitle failures.
File summaries
| File | Description |
|---|---|
apps/server/src/providers/types.ts |
Adds subtitle stream metadata. |
apps/server/src/providers/shared/mediaProxy.ts |
Normalizes the new metadata. |
apps/server/src/providers/plex/playback.ts |
Implements decision-driven subtitle extraction. |
apps/server/src/providers/plexPlayback.test.ts |
Adds Plex subtitle regression coverage. |
apps/frontend/src/api/cliparrClient.ts |
Exposes JSON error parsing. |
apps/frontend/src/api/cliparrClient.test.ts |
Tests error parsing and cancellation. |
apps/frontend/src/components/editor/useSubtitleCues.ts |
Displays actionable subtitle errors. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Embedded text subtitles detected in Plex could fail to load in the editor. Prepare a Plex playback decision, then extract the selected track as SRT through Plex's subtitle endpoint using a separate session from HLS playback. Preserve the selected media version, part, and cue timestamps.
Cancel upstream requests when the browser disconnects, reject failed decisions or changed subtitle selections, and display actionable errors in the editor. Reuse existing helpers and stable media handles; no new dependencies. Embedded tracks still need to be selected in Plex first.
Validation:
pnpm preflightpassed: formatting, lint, type checks, unused-code checks, and all 476 tests.