Skip to content

fix(server): load embedded Plex subtitles - #199

Merged
KyleTryon merged 1 commit into
mainfrom
fix/server/plex-embedded-subtitles
Sep 13, 2026
Merged

KyleTryon merged 1 commit into
mainfrom
fix/server/plex-embedded-subtitles

Conversation

@KyleTryon

Copy link
Copy Markdown
Contributor

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 preflight passed: formatting, lint, type checks, unused-code checks, and all 476 tests.
  • Regression coverage includes decision/extraction ordering, session isolation, SRT/ASS handling, sidecars, media selection, cancellation, malformed responses, and frontend error messages.
  • Verified extraction with a disposable Plex server and synthetic embedded SRT/ASS fixtures, including language changes and preserved timestamps.

@KyleTryon
KyleTryon marked this pull request as ready for review September 13, 2026 03:27
@KyleTryon
KyleTryon requested a balanced review from Copilot September 13, 2026 03:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.

@KyleTryon
KyleTryon merged commit 66ee11b into main Sep 13, 2026
5 checks passed
@KyleTryon
KyleTryon deleted the fix/server/plex-embedded-subtitles branch September 13, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants