Skip to content

v1.0.3-elf.4 — opt-in MDBlist fetch for /p endpoint

Choose a tag to compare

@funkypenguin funkypenguin released this 27 May 00:37
f4ba29f

Fork-only patch on top of upstream v1.0.3.

What changed

Features

  • PRESET_MDBLIST_FETCH env (default false) opts /p into a live MDBlist fetch on cache miss. The /p preset 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 /poster is gated by PRESET_ENABLED + no ACCESS_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_inflight dict so a burst of concurrent /p requests for the same imdb_id fans out into exactly one MDBlist call.
  • Fetch joins the existing image/logo/trending gather so added wall-time is bounded by max(), not sum().
  • _RateLimited(retry_after) → honour Retry-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_persist so 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.