Skip to content

fix(detail): resolve Auto for a series page episode like playback - #408

Merged
Quick104 merged 3 commits into
Silo-Server:mainfrom
Rhainland:fix/episode-auto-version
Sep 29, 2026
Merged

Quick104 merged 3 commits into
Silo-Server:mainfrom
Rhainland:fix/episode-auto-version

Conversation

@Rhainland

@Rhainland Rhainland commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: Silo-Server/silo-server#1167
Validation tasks: changes #329 C1 (not yet run)

On the series page, the version row shows Auto as the selected episode's first version in server order, and the Download button saves that file. Play on Auto picks differently: the last-played file, then the quality preference. When the first-listed version is not the one the user watches, for example the one without subtitles, the page shows and downloads it while Play streams another.

Approach

Episodes now resolve Auto with the same rule as the movie page and the player (selectPlaybackVersion). The movie page's resolution moved into one helper, detailDisplayVersionIndex, which both pages use, so the version Auto shows is the one Play streams and Download saves. An explicit pick behaves as before.

Episode downloads also need #407 to succeed against current servers. iOS: Silo-Server/silo-apple#536. Server default for requests that name no file: Silo-Server/silo-server#1630.

Validation

  • androidApp unit tests: 683 of 684 pass, including 5 new tests for the Auto rule. ReflowStyleTest "line height flows from settings" fails the same way on unmodified main.
  • android-shared unit tests pass (1581). :androidApp:assembleDebug passes.
  • Manual on an API 36 emulator against a local server, for an episode whose 720p version (with .srt) is listed first and was never played: the page shows "Auto - 1080p", the version Play on Auto streams; the previous code shows the first-listed 720p version. For an episode last played in 720p, Auto shows 720p with the English .srt. With fix(downloads): register episode downloads under their series #407 applied, Download saved the displayed version on Auto and the picked version after an explicit 720p pick.

Screenshots

Series page on S1·E2, whose never-played 720p version (with .srt) is listed first; Play on Auto streams the 1080p version. Before is the #407 build, whose version row matches main.

Before After
Before: Auto shows the first-listed 720p version After: Auto shows the 1080p version that Play uses

Risks

Low. It changes which version Auto shows and downloads for series-page episodes; movie pages keep the same rule, moved into the shared helper.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code (Claude Agent SDK) in T3 Code
  • Tool(s): Claude Code; OpenAI Codex CLI 0.155.1 (codex review --uncommitted) for independent review; Gradle, Android emulator
  • Model(s): claude-opus-5-5 (Claude Opus 5.5, 1M context); gpt-6-astra (Codex, medium reasoning effort)
  • Involvement: AI-assisted. Code and tests were written by claude-opus-5-5; the submitter reviewed the complete diff and validated the changes end to end.
  • Adversarial review: A Claude Code review (medium) and Codex (gpt-6-astra, medium) read the Android changes before they were split into this PR and fix(downloads): register episode downloads under their series #407. Both judged the Auto resolution in this PR correct; their findings were in the download identity code, fixed in fix(downloads): register episode downloads under their series #407. Codex re-reviewed and found nothing further.

Note

Fix Auto version resolution for episode playback on series detail page

  • Adds the detailDisplayVersionIndex selector in MediaSelectors.kt. It returns an explicit valid index first, then resolves the last-played file while the preferred quality is still loading, and otherwise delegates to the shared playback version selection.
  • ItemDetailScreen.kt now uses this selector for both the episode and main video preview paths, so the displayed version matches the playback version.
  • Before, Auto always picked the first listed version. Now it picks the last-played version, and shows no resolved version until the quality preference loads.
  • Covers the change with tests in DetailDisplayVersionTest.kt, including explicit-pick precedence, empty version lists, and stale explicit picks.
  • Behavioral Change: a stale or out-of-range explicit index now returns -1 (no version) instead of falling back to another version; the resolved video version also drives the local download selection.

Macroscope summarized 9ff9c37.

On the series page, Auto showed and downloaded the selected episode's
first version in server order, while Play on Auto resolved the
last-played file, then the quality preference. A user who watches the
version with subtitles could see and download a different one.

Episodes now use the same resolution as the movie page and the player,
moved into one shared detailDisplayVersionIndex helper, so the version
Auto shows is the one Play streams and Download saves.
@kody-ai

kody-ai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Access your configuration settings here.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 53541400-fa92-4a84-9587-20a35b96c33f

📥 Commits

Reviewing files that changed from the base of the PR and between c38fb93 and 9ff9c37.

📒 Files selected for processing (3)
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/ItemDetailScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/MediaSelectors.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/detail/DetailDisplayVersionTest.kt

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

An explicit pick returned before the empty-list check, so a series
episode still loading its versions got an index into an empty list.
Check for an empty list first and clamp an explicit pick to the list.
@kody-ai

kody-ai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Access your configuration settings here.

Clamping an out-of-range pick named the last file for Download while
Play, which sends no file id for a stale pick, resolved another. A stale
pick now names no version, as main did.
@kody-ai

kody-ai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Access your configuration settings here.

@Quick104
Quick104 merged commit ad6f371 into Silo-Server:main Sep 29, 2026
5 checks passed
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