Repository navigation
Conversation
A plain AI translation job collects only fields whose localized value is empty, but its writes replaced any AI-sourced value. A forced re-translation that finished while a plain job was still running could then be overwritten with a translation of the older source text. The item, season and episode AI writes take the job's force flag again. A forced job keeps the rule Silo-Server#2214 set: fill an empty field or replace earlier AI text, never provider or manual text. A plain job fills only a field that is still empty when it writes. Closes Silo-Server#2472 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedThis organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing. Next included review available in 15 minutes. View limit details
|
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:
|
Quick104
left a comment
There was a problem hiding this comment.
🤖 Claude Code (claude-opus-5-5)
The fix holds up: the new test fails on the base for the reported reason and passes here, and a separate Codex review found no defects in the diff. One cleanup finding below. I'm fixing it in a commit on this branch, so you don't need to change anything.
… test Co-Authored-By: Claude Opus 5.5 <[email protected]>
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:
|
|
🤖 Claude Code (claude-opus-5-5) Review summaryReviewed head: The fix does what #2472 asks. A plain job now writes only into a field that is still empty, which matches the fields its collection step picks ( How it was checked
Findings
Left for maintainers
Validated features No passed validation case changes. The AI translation cases (#1213 C1 and C2, #1214 C1, and the client display cases) behave the same, because a plain job already picked only empty fields; the only difference is the race this PR closes. User manual No change needed. The metadata page already says a plain translation keeps existing descriptions and that Re-translate AI text is what refreshes earlier AI translations. This PR makes the server match that. Other clients N/A, as the PR body says: clients only display the stored descriptions, and jellycompat reads the same rows. Fit: 9/10 · Readiness: 9/10 — ready (assuming CI is green)
|
Problem
Closes #2472
Related issue: #2214 (removed the
forceparameter from these writes)Validation tasks: none
Other clients: Apple, Android, Roku and Jellyfin-compatible clients N/A: they show the stored localized descriptions, and only which text gets stored changes.
A plain (not forced) AI translation job collects only fields whose localized value is empty (
translatableField), but its writes replaced any AI-sourced value. A forced re-translation that finished while a plain job was still running could then be overwritten with a translation of the older source text.This PR has no dependencies and can merge in any order. #2214, which the issue said to follow, is merged.
Approach
UpsertAITranslationand the season and episodeUpsertAIOverview(internal/catalog/localization_repo.go) take the job'sforceflag again, andLocalizationStorepasses it frompersistField(job.Force).Validation
gofmt,go vetand the changed-lines lint are clean.TestAITranslationNeverOverwritesProviderOrManualTextnow passesforce=true, the rule it describes; its assertions are unchanged.TestPlainAITranslationFillsOnlyEmptyFields(Postgres 18.6, listed indb-contracts.txt): a plain write keeps an item's, season's and episode's newer AI overview and fills the item's empty tagline.$5 OR true), the new test fails on all three writes.go test ./internal/catalog/ ./internal/metadata/translation/passes.make test-go.Evidence
No visible layout change. The evidence is what a plain write stores, from the DB tests on WSL2 (Ubuntu,
go1.26.4 linux/amd64),mainat43405eb2a, this PR atfe9b93792.mainRisks
LocalizationStoreinterface change signature; every implementation in the tree is updated.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Add
forceflag to AI translation upserts so plain writes fill only empty fieldsforceparameter toUpsertAITranslation,UpsertAIOverview(season and episode), and theLocalizationStoreinterface in localization_repo.go and store.goforcefalse, AI writes fill only empty overview/tagline fields and never replace existing AI-sourced text. Withforcetrue, AI-sourced text is replaced. Manual- and provider-sourced text stays protected in both modes.job.Forceto each localization write, and a database-backed test covers the plain-write behavior.LocalizationStoremethods must pass the newforceargument; in-tree callers are updated in service.go.Macroscope summarized b2fca36.