Add a library page: seasons, race weekends and sessions as Plex shows them

The operator wants to browse the posters the way a Plex or Emby Formula 1
library shows them. The page reads the whole library from the one Kometa
file (rounds, race names in the race posters' addresses, sessions in the
episodes'), waits through a fresh server's minutes-long first answer
instead of failing, and loads each picture only when it is on screen, two
at a time, dropping the queue when the reader leaves a level: every
poster is a render of about 10 s that pulls map tiles. Each level has its
own address and back/forward work; a picture the server has none for is
a plain card with its name.

The session order per weekend format moves into site.js, so the posters
page and the library read the same list.

Claude-Session: https://claude.ai/code/session_01NcbgfJAa38xFpzy69BWrqh
This commit is contained in:
2026-11-27 10:33:19 +01:00
parent 8237aabd87
commit db9f386c7a
10 changed files with 518 additions and 16 deletions
+3 -14
View File
@@ -19,6 +19,7 @@
<a href="grand-prix.html">Grand prix lookup</a>
<a href="posters.html" aria-current="page">Posters</a>
<a href="kometa.html">Kometa</a>
<a href="library.html">Library</a>
</nav>
<div id="api-base"></div>
</header>
@@ -109,20 +110,8 @@
const { h, api, path, call, setRequest, setStatus, showImage, racePicker } = F1;
const $ = (id) => document.getElementById(id);
// Kometa's episode numbering per weekend format: the same maps the service renders from.
const STANDARD = [
['fp1', 'Free Practice 1'], ['fp2', 'Free Practice 2'], ['fp3', 'Free Practice 3'],
['pre-qualifying', 'Pre-Qualifying Buildup'], ['qualifying', 'Qualifying'], ['post-qualifying', 'Post-Qualifying'],
['pre-race', 'Pre-Race Buildup'], ['race', 'Race'], ['post-race', 'Post-Race'], ['highlights', 'Highlights'],
];
const SPRINT = [
['fp1', 'Free Practice 1'], ['pre-sprint-qualifying', 'Pre-Sprint-Qualifying Buildup'],
['sprint-qualifying', 'Sprint Qualifying'], ['post-sprint-qualifying', 'Post-Sprint-Qualifying'],
['pre-sprint', 'Pre-Sprint Buildup'], ['sprint', 'Sprint'], ['post-sprint', 'Post-Sprint'],
['pre-qualifying', 'Pre-Qualifying Buildup'], ['qualifying', 'Qualifying'], ['post-qualifying', 'Post-Qualifying'],
['pre-race', 'Pre-Race Buildup'], ['race', 'Race'], ['post-race', 'Post-Race'], ['highlights', 'Highlights'],
['bonus', 'Bonus Content'],
];
const STANDARD = F1.SESSIONS.standard;
const SPRINT = F1.SESSIONS.sprint;
const LABEL = Object.fromEntries([...STANDARD, ...SPRINT]);
const ALL = Object.keys(LABEL);