Serve the picks from the API, so the live picker reads them

The picker read circuits/photos.json and seasons/photos.json relative to
itself. The API serves only /examples/, so the live page showed two HTTP
404 errors and a "Load it from disk" box for each.

The API now serves both picks files, read-only, at /picks/circuits.json
and /picks/seasons.json. Each answer is the file as the poster service
has it loaded, from the same loader it draws from: the notes first, then
the entries, a refused entry left out. The root route lists both routes.

The picker reads them from the API its site picks. Only a page opened
from a working copy (file:, or a loopback host) falls back to the
repository's files. A failure names each address and why.

Builds: docs/posters.md, Picking photos, as written in 780984064f (the lead's lines 1-4 of 2026-11-30 and answers Q1, Q2)

Claude-Session: https://claude.ai/code/session_01JG73KFhbaNj3tyJ8tKmE3W
This commit is contained in:
2026-11-30 10:18:16 +01:00
parent 780984064f
commit 250828710c
7 changed files with 148 additions and 51 deletions
+3 -1
View File
@@ -29,6 +29,8 @@ How posters are made (sources and their licences, kept layers, options, credits)
| `GET /posters/session/{race}/{season}/{session}.png?…` | a 1920×1080 thumbnail for one session, such as `fp1`, `qualifying`, `sprint` or `race` |
| `GET /kometa/formula-1-metadata.yml` | [Kometa](https://kometa.wiki/) metadata that sets these posters on a Plex Formula 1 library |
| `GET /licences` | every source a picture may be made from: its licence, its credit and its terms, and how a picture's licence follows from them |
| `GET /picks/circuits.json` | the photo or map picked per layout, as the poster service has `circuits/photos.json` loaded: its notes and the entries it draws from |
| `GET /picks/seasons.json` | the photo picked per season, as the poster service has `seasons/photos.json` loaded: its notes and the entries it draws from |
The three picture routes take the same options as query parameters ([docs/posters.md](docs/posters.md) lists
them): `style` (`classic`, `minimal`), `bg` (`satellite`, its alias `aerial`, `photo`, `osm`, `dark`, `light`, `none`),
@@ -167,7 +169,7 @@ are fetched only when a picture asks for them, at most two at once; Wikimedia Co
`merge-check.sh` runs before a change merges: every Python file the service ships must parse, and the tests in
`tests/` must pass (every circuit has one unique `ergastId`, a race resolves by it, a failed Jolpica fetch is never
kept, every link in this README leads to a file, an unknown circuit or layout is named; a poster's satellite source,
credits and licence, its options, keys and cache headers, and the picture store's cap).
credits and licence, its options, keys and cache headers, the picture store's cap, and the picks `/picks/…` answers).
## Acknowledgment