Skip to content

fix(detail): show metadata for the selected version - #311

Open
Rhainland wants to merge 1 commit into
Silo-Server:mainfrom
Rhainland:suspense/fix-selected-version-metadata
Open

Rhainland wants to merge 1 commit into
Silo-Server:mainfrom
Rhainland:suspense/fix-selected-version-metadata

Conversation

@Rhainland

@Rhainland Rhainland commented Sep 17, 2026

Copy link
Copy Markdown

Problem

Related issue: N/A — narrow fix

Selecting a different movie or episode file could leave Android showing the item-level editorial runtime instead of the selected media duration. Android TV could also show a CC badge inherited from another file because the catalog subtitle list is item-wide. This follows up on the selected-version metadata behavior corrected in silo-server#414.

Approach

  • Project playback_variants from the v2 catalog response into the presentation model.
  • Resolve runtime from the selected file for single-part media and from the playback-variant total for multipart media, with the editorial runtime as the compatibility fallback.
  • Use the resolved runtime on Android phone detail heroes, phone detail facts, Android TV movie and episode heroes, and focused series episodes.
  • Keep resolution, HDR/Dolby Vision, video codec, audio, and subtitle indicators tied to the effective selected file. Android TV no longer falls back to the item-wide subtitle list for its CC badge.
  • Preserve compatibility with servers that omit playback_variants.

The server contract already provides the required file durations and playback-variant totals. No server change is needed. silo-apple#301 carries the coordinated Apple client change.

Validation

Passed:

  • ./scripts/test-check-build-supply-chain.sh
  • ./scripts/check-build-supply-chain.sh
  • Selected runtime, v2 projection, Android phone metadata, and Android TV metadata unit tests
  • :android-shared:lintDebug, :androidApp:lintDebug, and :androidTvApp:lintDebug
  • :androidApp:lintVitalRelease and :androidTvApp:lintVitalRelease
  • :androidApp:assembleDebug and :androidTvApp:assembleDebug

./gradlew testDebugUnitTest ran 666 Android phone tests and stopped on the existing ReflowStyleTest > line height flows from settings failure. The same test fails on the clean main checkout at the branch base. All tests added or changed by this PR pass.

Manual phone and TV verification against a live server was not run.

Risks

Low. The new response field is optional, and older servers retain the existing editorial-runtime fallback. No playback request or server behavior changes.

Checklist

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

AI Disclosure

  • Harness: Codex desktop app
  • Tool(s): Codex, Gradle, Android Lint, GitHub CLI
  • Model(s): gpt-6-astra with medium reasoning effort
  • Involvement: Fully AI-generated and human-directed; pending maintainer review
  • Adversarial review: Two complete cross-client reviews traced v2 projection, selected-version state, runtime resolution, and visible technical labels. They found an out-of-range Swift conversion crash, Android TV subtitle leakage from item-level metadata, and unrelated Apple package-lock churn. All three findings were fixed. A final review found no remaining actionable issues.

Summary by CodeRabbit

  • New Features

    • Added support for playback variants and multipart media.
    • Runtime displays now reflect the selected version, including combined runtimes for multipart content.
    • Movie and TV detail screens show quality, audio, HDR, subtitle, and codec information for the selected version.
  • Bug Fixes

    • Prevented metadata from mixing information across different file versions.
    • Corrected subtitle indicators so they only appear when supported by the selected version.
    • Preserved catalog runtime values when selected media durations are unavailable or invalid.

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 9436fd80-7b21-486e-bae6-2971571717a6

📥 Commits

Reviewing files that changed from the base of the PR and between e35edbf and bf746a6.

📒 Files selected for processing (11)
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/DetailSharedComponents.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/MovieDetailContent.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/detail/SelectedVersionMetadataTest.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvDetailMetadata.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailScreen.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvDetailMetadataTest.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/model/catalog/CatalogModels.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/model/catalog/SelectedMediaRuntime.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/network/apiv2/CatalogDetailReadV2Models.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/model/catalog/SelectedMediaRuntimeTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/network/apiv2/CatalogDetailReadV2Test.kt

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds playback variant catalog models and API mapping, resolves runtime from the selected media version, and applies that runtime and version-specific metadata to Android and TV detail screens. Tests cover multipart durations, fallback behavior, technical labels, and subtitle selection.

Changes

Selected media metadata

Layer / File(s) Summary
Playback variant contract and mapping
shared/src/commonMain/kotlin/org/siloserver/silo/model/catalog/CatalogModels.kt, shared/src/commonMain/kotlin/org/siloserver/silo/network/apiv2/CatalogDetailReadV2Models.kt, shared/src/commonTest/kotlin/org/siloserver/silo/network/apiv2/CatalogDetailReadV2Test.kt
ItemDetail now maps serialized playback variants, parts, nested file versions, durations, and checked file IDs.
Selected runtime resolution
shared/src/commonMain/kotlin/org/siloserver/silo/model/catalog/SelectedMediaRuntime.kt, shared/src/commonTest/kotlin/org/siloserver/silo/model/catalog/SelectedMediaRuntimeTest.kt
selectedMediaRuntimeMinutes uses selected file or multipart variant durations and falls back to the editorial runtime for unusable values.
Android detail metadata integration
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/DetailSharedComponents.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/MovieDetailContent.kt, androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/detail/SelectedVersionMetadataTest.kt
Android hero facts and detail facts now accept the selected runtime. Tests verify selected-version runtime and metadata labels.
TV detail metadata integration
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvDetailMetadata.kt, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailScreen.kt, androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvDetailMetadataTest.kt
TV metadata derives runtime and technical badges from the selected version. Series episode metadata receives the resolved runtime, and catalog-level subtitles no longer add badges to unselected versions.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant CatalogDetailReadV2
  participant ItemDetail
  participant selectedMediaRuntimeMinutes
  participant MovieDetailContent
  participant TvDetailMetadata
  CatalogDetailReadV2->>ItemDetail: map playback_variants
  MovieDetailContent->>selectedMediaRuntimeMinutes: resolve selected movie runtime
  selectedMediaRuntimeMinutes-->>MovieDetailContent: runtime minutes
  MovieDetailContent->>ItemDetail: render Android metadata with runtime
  TvDetailMetadata->>selectedMediaRuntimeMinutes: resolve selected TV runtime
  selectedMediaRuntimeMinutes-->>TvDetailMetadata: runtime minutes
  TvDetailMetadata->>ItemDetail: render version-specific TV metadata
Loading

Suggested reviewers: quick104

Merge Risk: ⚪ Minimal · up to bf746

The selected-runtime flow preserves multipart duration resolution for server-generated playback variants, with no actionable merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 28 functions across 11 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: updating detail-screen metadata to reflect the selected version.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

The implementation appears behaviorally safe, but the repository’s required before-and-after UI evidence must be added before merging.

Findings

  1. P2 Missing required UI evidence

Reviews (1) · Last reviewed commit: "fix(detail): show selected version metad..."

Comment on lines +127 to +128
val selectedRuntimeMinutes = selectedMediaRuntimeMinutes(detail, selectedVersion)
val factsLine = HeroMetadata.movieFactsLine(detail, selectedRuntimeMinutes)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Missing required UI evidence

This changes the visible runtime metadata on phone and TV, but the PR provides no before-and-after images and states that neither interface was manually verified. The repository guide requires before-and-after images for UI changes, so this requirement must be satisfied before merging. Please add evidence covering the affected phone and TV detail states.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We are not adding screenshots for this PR. This is a small, focused metadata data-flow correction; it does not change the layouts or introduce new UI states. The phone and TV presentation coverage verifies that the selected version drives the displayed runtime and technical metadata, so screenshot evidence is not warranted for this change.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I agree this is a narrow data-flow correction and that the presentation tests provide meaningful coverage. However, the repository guideline does not limit the evidence requirement to layout or new-state changes; it says to include before-and-after images for UI changes. Because this PR changes the runtime and subtitle metadata visibly rendered on both phone and TV detail screens, it qualifies as a UI change even though the layout is unchanged. The screenshot requirement therefore still applies unless a maintainer grants an explicit exception or the repository guideline is updated.

Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.

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.

1 participant