Skip to content

[codex] fix metadata translation on season and episode pages - #238

Merged
Quick104 merged 1 commit into
mainfrom
codex/season-episode-metadata-translation
Jun 28, 2026
Merged

Quick104 merged 1 commit into
mainfrom
codex/season-episode-metadata-translation

Conversation

@Quick104

@Quick104 Quick104 commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

Part of: user-reported season/episode metadata translation regression (no issue provided).

What changed

  • Season and episode detail responses now expose pending_translation_language when their overview is missing the viewer presentation-language localization.
  • Viewer on-view metadata translation now resolves the target as item, season, or episode before enqueueing, and authorizes season/episode requests through the parent series.
  • The metadata editor translation panel is available for season and episode pages, and admin translation jobs use the correct target kind.
  • Season and episode detail pages now wire the existing overview translation shimmer/button into DetailHero, with cache invalidation for canonical season detail keys.

Root cause

Movie and series details had the pending-language signal and UI hook. Season and episode details localized existing rows, but never reported a missing translation, their pages never invoked the hook, and both viewer/admin translation endpoints treated every request as a media-item job.

Validation

  • GOCACHE=/private/tmp/silo-go-cache GOWORK=off go test ./internal/metadata/translation -run 'TestRequestOnView'\n- GOCACHE=/private/tmp/silo-go-cache GOWORK=off go test ./internal/api/handlers -run 'TestMetadataAI'\n- GOCACHE=/private/tmp/silo-go-cache GOWORK=off go test ./internal/catalog -run '^$'\n- pnpm exec vitest run src/pages/ItemDetail/SeasonContent.test.tsx src/pages/ItemDetail/EpisodeContent.test.tsx\n- pnpm exec prettier --check ... for touched frontend files\n- pnpm exec tsc -b --pretty false\n- make dev-deploy to 100.86.116.20; Docker build completed, frontend production build completed, silo-silo-1 is healthy, /api/v1/ready returns ok, and dev has metadata AI enabled with on_view=auto.\n\nNote: I did not mint or forge a dev bearer token for protected live API smoke testing; Codex rejected that as unsafe, and Chrome session control was unavailable in this session.\n\n## Risks\n- Admin season jobs currently translate the season overview only; they do not expand to episodes. Series jobs retain existing child expansion.\n\n## AI use\nImplemented and validated with Codex.

Summary by CodeRabbit

  • New Features

    • Added translation support for season and episode metadata, including on-view requests and admin-triggered translation.
    • Expanded detail pages to show pending translation status for seasons and episodes.
    • Updated the metadata translation panel to work with more content types and adjust guidance text accordingly.
  • Bug Fixes

    • Improved translation behavior so the correct content type is used when requesting or tracking translations.
    • Refreshed related detail views during translation to keep localized content up to date.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 03d215ea-2803-419e-852a-c9d43fb21eef

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/season-episode-metadata-translation

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

@Quick104
Quick104 marked this pull request as ready for review June 28, 2026 01:33

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
internal/metadata/translation/service_test.go (1)

546-581: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a cooldown isolation regression for target kind.

The service now skips existing jobs with a different TargetKind; seed a recent failed item job for the same content/language and assert a season request still enqueues a new season job.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/metadata/translation/service_test.go` around lines 546 - 581, Add a
regression test in TestRequestOnViewUsesRequestedTargetKind that seeds an
existing recent failed job for the same content and language but with a
different TargetKind, then verify RequestOnView still creates a new job for the
requested kind. Reuse the existing helpers in service_test.go such as
testService, repo.job, and RequestOnView, and assert the season request is not
blocked by the item-level cooldown while still keeping the current target-kind
checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@internal/metadata/translation/service_test.go`:
- Around line 546-581: Add a regression test in
TestRequestOnViewUsesRequestedTargetKind that seeds an existing recent failed
job for the same content and language but with a different TargetKind, then
verify RequestOnView still creates a new job for the requested kind. Reuse the
existing helpers in service_test.go such as testService, repo.job, and
RequestOnView, and assert the season request is not blocked by the item-level
cooldown while still keeping the current target-kind checks.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e3c8cab3-bcc3-42b3-adbc-5dba431de9ac

📥 Commits

Reviewing files that changed from the base of the PR and between 41a1fc8 and 85d2d75.

📒 Files selected for processing (13)
  • internal/api/handlers/metadata_ai.go
  • internal/api/handlers/metadata_ai_test.go
  • internal/api/router.go
  • internal/catalog/detail.go
  • internal/metadata/translation/service.go
  • internal/metadata/translation/service_test.go
  • web/src/components/EditMetadataDialog.tsx
  • web/src/components/MetadataTranslatePanel.tsx
  • web/src/hooks/useOnViewTranslation.ts
  • web/src/pages/ItemDetail/EpisodeContent.test.tsx
  • web/src/pages/ItemDetail/EpisodeContent.tsx
  • web/src/pages/ItemDetail/SeasonContent.test.tsx
  • web/src/pages/ItemDetail/SeasonContent.tsx

@Quick104
Quick104 merged commit a72094f into main Jun 28, 2026
2 checks passed
@Quick104
Quick104 deleted the codex/season-episode-metadata-translation branch June 28, 2026 01:44
Quick104 added a commit to RXWatcher/silo-server that referenced this pull request Jul 10, 2026
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