Skip to content

fix(player): preserve addon subtitle provider identity - #1840

Open
i7xre wants to merge 1 commit into
NuvioMedia:cmp-rewritefrom
i7xre:fix/1800-subtitle-selection-ownership
Open

fix(player): preserve addon subtitle provider identity#1840
i7xre wants to merge 1 commit into
NuvioMedia:cmp-rewritefrom
i7xre:fix/1800-subtitle-selection-ownership

Conversation

@i7xre

@i7xre i7xre commented Aug 31, 2026

Copy link
Copy Markdown

Summary

Focused follow-up to #1800: preserve exact addon/provider subtitle-row selection when multiple providers legitimately reference the same subtitle URL.

PR type

  • Reproducible bug fix
  • UI glitch/bug fix
  • Behavior bug/regression fix
  • New feature
  • Refactor/cleanup (no behavior change)
  • Documentation-only
  • Build/CI/tooling
  • Other (explain below)

Why

Selecting a later provider row previously reduced the selected identity to its URL. Runtime URL resolution then selected the first provider with that URL, making the highlighted provider jump even though playback resource was unchanged.

How it works

SubtitleSelectionOption.Addon.id is now the provider-qualified optionId / selectionKey (addon:<provider>:<subtitle-id>:<legacy-url-key>). A tap therefore stores and resolves that exact row key first:

tap ElfHosted row → selected optionId → resolver returns ElfHosted row.

addon.url remains unchanged and is used only as playback resource plus legacy URL fallback, so providers sharing one URL can still play that resource without losing which provider row user chose.

Issue or approval

Fixes #1888.

UI / behavior impact

  • No UI change
  • No behavior change
  • UI changed only as described below
  • Behavior changed only to fix a documented bug/regression

Exact provider-row selection now remains stable. Playback still receives addon.url.

Policy check

  • I used the repository's documented architecture/patterns for this area.
  • I reviewed the change for regressions and kept scope focused.
  • I added or updated tests where behavior changed, or explained why tests are not applicable.
  • I did not add secrets, tokens, credentials, or private URLs.
  • I did not change unrelated files or perform drive-by refactors.
  • Any UI change follows the project's design conventions, or this PR has no UI change.
  • Any behavior change is covered by a reproducible issue, approved request, or test.

Scope boundaries

  • Only SubtitleSelectionModel.kt production behavior changes.
  • No SubtitleModal, runtime callback, preference-storage, ownership, fling, backend, player-engine, or diagnostic changes.
  • Existing raw-ID fallback remains return firstOrNull { it.id == selectedId }.
  • Existing addon option IDs and Lazy keys are unchanged.

Testing

  • Pre-fix regression failed: expected AIOStreams | ElfHosted; actual OpenSubtitles v3.
  • Full verification: gradlew.bat :composeApp:testAndroidHostTest :androidApp:assembleFullDebug --console=plain
    • BUILD SUCCESSFUL
    • 823 tests; 0 failures, 0 errors, 0 skips.
  • git diff --check passed.
  • BlueStacks real-playback validation:
    • Indonesian: 60/60 correct selections/cycles.
    • Japanese: 40/40 correct selections.
    • One correct player request per tap; no extra first-provider request; playback remained active.

Screenshots / Video

No UI layout or design change. Reproduction evidence:

  • Before: provider row jumps to first provider
befor.mp4
  • After: clicked provider remains selected
after.mp4

Breaking changes

None. Legacy URL-only selections remain readable and use existing URL fallback when no exact provider-qualified selection is available.

Linked issues

Fixes #1888.

@i7xre
i7xre force-pushed the fix/1800-subtitle-selection-ownership branch 2 times, most recently from a9a0cb2 to d59d5c0 Compare September 6, 2026 11:12
@i7xre i7xre changed the title fix(player): preserve explicit subtitle selection across source refresh fix(player): preserve addon subtitle provider identity Sep 6, 2026
@i7xre
i7xre marked this pull request as ready for review September 6, 2026 11:33
@i7xre
i7xre force-pushed the fix/1800-subtitle-selection-ownership branch from d59d5c0 to 68f7a4a Compare September 6, 2026 11:41
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.

[Bug]: Selecting a subtitle provider row highlights a different provider

1 participant