Give the addresses an address version of their own, raised to a1

Every season poster changed with the joined picks, but the Kometa file kept handing out
?v=r3, an address clients keep for good: they would never load the new season posters. Raising
the render version instead would draw every kept layer and finished picture again, though only
the season posters changed.

poster_options.ADDRESS_VERSION ("a1") sits beside RENDER_VERSION: the Kometa file writes it into
every poster address, and only an address carrying it is sent the immutable Cache-Control; an
address with ?v=r3 is now any other address (a day, then its ETag). Layers and finished pictures
stay keyed by RENDER_VERSION, still r3, so nothing kept is drawn again except the season posters
whose photo changed. The API's option text, the Kometa docstring and the README say "address
version".

The options test: ?v=a1 is kept for good, ?v=r3 no longer (on master it fails: no
ADDRESS_VERSION, and ?v=r3 is still the immutable address).

Builds: docs/posters.md at f6b9f937d0 (Finished images: what clients keep, the address version)

Claude-Session: https://claude.ai/code/session_01JG73KFhbaNj3tyJ8tKmE3W
This commit is contained in:
2026-11-30 11:33:56 +01:00
parent ab0c4b9244
commit 25fee9ca85
5 changed files with 18 additions and 12 deletions
+3 -3
View File
@@ -148,14 +148,14 @@ POSTER_OPTIONS_DOC = """Options are query parameters, the same on every poster r
dark, light, none), `photo` (natural, bw), `show` (a comma list of wordmark, round, name, subtitle, date, circuit,
locality, session), `locator` and `checker` (on, off), `track` (off, or #rrggbb with an optional width:
#ffffff,6), `dim` (0 to 1), `accent` (#rrggbb), `width` (400 up to the frame's), `format` (png, jpg, webp), and
`v`, the render version, which the Kometa file adds so clients keep the picture for good."""
`v`, the address version, which the Kometa file adds so clients keep the picture for good."""
def render_poster(request: Request, kind: str, grand_prix_name: Optional[str] = None, season: Optional[int] = None,
session_slug: Optional[str] = None) -> Response:
"""A picture with its credits, its licence and what clients may keep of it.
An address with the current render version (?v=) is kept for good; any other a day, then asked again with its
An address with the current address version (?v=) is kept for good; any other a day, then asked again with its
ETag (a 304 while it is unchanged); a picture served without its map or photo five minutes, with no ETag."""
try:
options = poster_options.parse_options(request.query_params.multi_items(), kind)
@@ -213,7 +213,7 @@ def get_kometa_metadata():
- uses Kometa's f1_season builder for round/episode names
- sets url_poster on the show (the season poster)
- sets url_poster on each Plex 'season' (== each F1 round) from the race poster route, and on each episode
from the session thumbnail route; every address carries ?v=<render version>
from the session thumbnail route; every address carries ?v=<address version>
Kometa harmlessly skips shows / seasons that don't exist in the Plex
library, so we can emit the full schedule and let Kometa do the matching.