v1.0.3-elf.4 — opt-in MDBlist fetch for /p endpoint
Fork-only patch on top of upstream v1.0.3.
What changed
Features
PRESET_MDBLIST_FETCHenv (default false) opts /p into a live MDBlist fetch on cache miss. The/ppreset endpoint historically never called MDBlist — anonymous traffic was assumed to need protection from burning the operator's quota. With elf.2's fleet-wide cooldown the worst-case quota burn is now bounded (~120s of paused traffic per 429), so it's safe to enable. Required for preset-only instances (where/posteris gated byPRESET_ENABLED+ noACCESS_KEY→ nothing else warms the rating cache → every preset render was permanent-N/A). (#30)
Behaviour when enabled:
- Same gating as
/poster— global cooldown + per-title back-off. - Coalesced via the shared
_rating_fetch_inflightdict so a burst of concurrent/prequests for the sameimdb_idfans out into exactly one MDBlist call. - Fetch joins the existing image/logo/trending gather so added wall-time is bounded by
max(), notsum(). _RateLimited(retry_after)→ honourRetry-After(cap 1h) for per-title back-off.FETCH_FAILED→ set 1h per-title back-off.- Success → cache the rating row (full awards/festival/cult parsing) and flip
will_persistso the composite gets the long preset TTL on first hit.
Relationship to upstream
The /p/ preset endpoint is fork-only, so this feature isn't applicable upstream.