Repository navigation
[codex] fix metadata translation on season and episode pages - #238
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/metadata/translation/service_test.go (1)
546-581: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd 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
📒 Files selected for processing (13)
internal/api/handlers/metadata_ai.gointernal/api/handlers/metadata_ai_test.gointernal/api/router.gointernal/catalog/detail.gointernal/metadata/translation/service.gointernal/metadata/translation/service_test.goweb/src/components/EditMetadataDialog.tsxweb/src/components/MetadataTranslatePanel.tsxweb/src/hooks/useOnViewTranslation.tsweb/src/pages/ItemDetail/EpisodeContent.test.tsxweb/src/pages/ItemDetail/EpisodeContent.tsxweb/src/pages/ItemDetail/SeasonContent.test.tsxweb/src/pages/ItemDetail/SeasonContent.tsx
Part of: user-reported season/episode metadata translation regression (no issue provided).
What changed
pending_translation_languagewhen their overview is missing the viewer presentation-language localization.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-deployto100.86.116.20; Docker build completed, frontend production build completed,silo-silo-1is healthy,/api/v1/readyreturns ok, and dev has metadata AI enabled withon_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
Bug Fixes