Repository navigation
Description
Problem
Silo has native Rotten Tomatoes fields, but titles without stored scores need a safe way to populate them after an item is viewed.
A straightforward detached goroutine is not sufficient for Silo's deployment model. PR #266 demonstrated the desired user flow, but its implementation allowed unbounded requests, immediate retry after rate limiting, process-local coordination, stale writes, rating-lock bypass, and synchronous lookups during bulk metadata refresh.
MDBList is reported to allow roughly 1,000 requests per day, so external work must remain bounded across the deployment rather than only per item or per process.
Desired behavior
Opening a native movie or series detail may request missing RT scores asynchronously, without delaying the response. Successful values are persisted safely and become visible on a subsequent load.
Acceptance criteria
- Trigger only when:
- MDBList title ratings are configured;
- the item is a movie or series;
- an IMDb ID is present;
- at least one RT field is missing;
- the rating metadata group is not locked.
- Treat critic and audience independently:
- fill only missing values;
- preserve existing values;
- persist audience-only and critic-only responses;
- preserve explicit zero scores.
- Do not call MDBList synchronously from generic initial-match, scheduled-refresh, manual-refresh, or identify processing.
- Bound total concurrency and request rate for the deployment, including multiple API replicas.
- Apply rate-limit-aware backoff rather than immediate retry after 429 responses.
- De-duplicate concurrent native requests for the same item and IMDb identity.
- Persist conditionally so the write succeeds only if:
- the content ID still exists;
- the IMDb ID still matches the lookup;
- the target field remains missing;
FieldRatingremains unlocked.
- A concurrent admin edit, identification change, or metadata refresh cannot be overwritten by a stale result.
- Empty or disabled configuration is a quiet no-op and remains compatible with settings hot reload.
- Fetch and persistence failures remain retryable without creating a request storm.
- Node restart or death does not corrupt state or permanently suppress future work.
- Successful persistence changes the observable native item representation and relevant cache/ETag state.
- Tests cover disabled configuration, concurrency bounds, replica coordination, 429 backoff, no-score responses, audience-only values, zero scores, persistence failure, lock changes, IMDb changes, concurrent edits, and restart behavior.
- Behavioral validation covers native API and the existing web rating presentation using redacted synthetic data.
- Update the relevant architecture/API documentation, settings-purpose copy, and feature changelog.
Scope
This issue owns native on-view scheduling and safe persistence. It does not add Jellycompat wiring or a bulk-library ratings job.
Discovery context
Derived from Silo Server PR #266 and its exact-head review at 83623def9f8eebfd9f8a7dd3b9defd5ba9b1c1a1.
The PR's useful behavior was retained, while its review findings became explicit acceptance criteria: quota control, bounded concurrency, rating locks, identity fencing, independent fields, disabled configuration, restart behavior, and no generic bulk-refresh fan-out.
AI Disclosure
- Tool: Codex in T3 Code
- Model: gpt-5.6-sol
- Involvement: AI-assisted investigation and issue drafting, published with maintainer approval
- Adversarial review: Evaluated single-node and multi-node request bounds, upstream quota exhaustion, stale-write races, metadata locks, partial ratings, retries, and restart semantics.
Activity