Repository navigation
fix(metadata): store each library's language in shared-item localizations - #2677
Conversation
…ions A title shared between libraries in two languages stored the canonical (first library's) text in the second language's localization row. A non-canonical refresh merges the stored canonical item into its result, and the localization write then took its title, overview and tagline from that merged result instead of the text fetched in the request language. Refresh All rewrote the same copy, so the rows never healed. The localization write now uses the text fetched in the request language; a locked field still keeps the canonical value. A stored provider value identical to the canonical text is treated as a copy: the refresh replaces it in either merge mode, and when the provider has no translation the upsert clears it so the field falls back to the base text and AI translation can fill it. Manual and AI text is untouched. Closes Silo-Server#2618
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
The PR changes shared-item detail pages: localized titles, overviews, and taglines can now reflect the requesting library’s language instead of copied canonical-language text ( Posted via Macroscope — Visible change evidence |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 24 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Major change: the recorded Server results for #1213 C1–C2 and Web results for #1215 C1–C2 cover profile-language display and AI-on-view. This PR changes the provider-localization write/clear path, changing displayed fields for shared items and whether copied fields are considered missing for AI. The PR must explain why the previously recorded behavior changes; these cases need re-validation after merge. The issue comments record these outcomes on Suggested fix: Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
Quick104
left a comment
There was a problem hiding this comment.
Review of f255779. The approach holds up: building the localization row from the text fetched before the merge is the right boundary, and it matches how season and episode localizations already work. I found two issues. Both are small, and I'm fixing both in commits on this branch, so there's no need to change anything yourself.
CI skips database tests that no list selects. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…readable A fill-empty refresh carries on when it cannot read the NFO, on the grounds that it leaves stored values alone. The canonical-copy repair broke that: it cleared stored NFO values that match the canonical text, and the provider's text filled them. Skip the repair on such a pass, and record the unreadable sidecar in the context whether or not local artwork caching is on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review summaryReviewed head: 3668229 (the original f255779 plus two review fixes I pushed). Fit: 9/10 · Readiness: 9/10 — ready (assuming CI is green) Fit. This fixes a real bug in the core experience. A shared title showed the first library's language in the second library, and Refresh All couldn't repair it. The fix is in the right place: the localization row is built from the text fetched in the request language, which is how season and episode localizations already work. It adds no setting, API field, or migration. Readiness. The core tests fail on the base. Addressed findings
Remaining for the maintainersNothing blocks the merge. Two low-impact limits stay, and both match the PR's Risks section:
Other feedback
Validated featuresNo passed case on the v1.0 board reaches this diff. The only passed cases are the person and cast tasks (#1138, #1143), and they don't read item localizations. User manual and clients
MethodMulti-agent review at medium effort (three finders and a validation check on Claude Opus 5.5 and Sonnet), plus one adversarial round by GPT-6.1-Sol, which raised the NFO finding. |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
The linked evidence covers desktop and mobile web only, while the PR also changes item metadata returned through the native API and jellycompat for clients that render it. Please add before-and-after captures of the same shared item in each affected native and Jellyfin-compatible client surface, with the surface and build or commit identified; the captures should show the requested-language title, overview, and tagline replacing copied canonical-language text. Suggested fix: No diff — add these captures under Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
Problem
Closes #2618
Related issue: N/A
Validation tasks: none (no passed case reaches this code; #1250, #1213, #1215 and #1210 cover this area but have no passed case yet)
When a movie or series is in both an English and a French library, the French library shows the English description. The French localization row holds a copy of the English text, and Refresh All Metadata writes the same copy again, so the row never heals. Titles that are only in the French library are not affected.
This change makes the second library's refresh store text in that library's language. A Refresh All repairs the rows that are already wrong, with no migration or manual cleanup.
A shared title has one catalog item, whose canonical text is in the language of the library that matched it first. When the other library refreshes it,
mergeAndPersistmerges the stored item into the fetched result. The localization row was then built from that merged result, so it got the canonical title, overview and tagline underreq.Language, labelledoverview_source = provider.Approach
default_metadata_languageare not changed.MediaItemLocalizationRepository.Upsertclears the copy. The field then shows the base text (no visible change), and AI translation can fill it; before, the copy blocked AI translation because the field never looked empty.This is server-only and changes no API contract. Native API and jellycompat responses read the same localization rows, so clients show the corrected text after a refresh with no client change. Season and episode localizations were already built from provider-only results and are unchanged.
Validation
main.scripts/ci/db-contracts.txt, so CI runs it.go test ./internal/metadata/... ./internal/catalog/...passes, with the database tests run against local Postgres.make lint-changedreports 0 issues.mainreproduced the bug: the shared titles'frrows held the exact English overview, and Refresh All rewrote it.en, the English library still shows English, and a French-only title is unchanged.enrow.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-2677/
Surface and build: web item detail page opened from the French libraries (Library default profile language), desktop and mobile web. Before: a build of
main(a434bbc) after Refresh All. After: this branch after Refresh All on the same data.Risks
Checklist
AI Disclosure
Note
Fix shared-item localizations to store each library's language text
localizedItemTextin service.go, with locked fields using canonical item text and fallback titles omitted.buildItemLocalizationRecordclears existing provider-sourced title, sort-title, overview, and tagline values that are exact copies of canonical text, so they no longer display as translations. Manual values and real translations are preserved.MediaItemLocalizationRepository.Upsertin localization_repo.go also clears provider overview/tagline values equal to base text when the incoming provider value is empty.clearCanonicalCopyand the new SQL branches inUpsert.Macroscope summarized 3668229.