Commit Graph

3 Commits

Author SHA1 Message Date
20e9dea0fe tests/test_launcher_serve: join the file server's handler threads on close, strict cleanup
merzleckeier forced the schedule on Windows (#2759): with ThreadingHTTPServer's
daemon handler threads, server_close() returned while the handler still held
art.jpg, so ignore_cleanup_errors only hid it and left the file behind. With
daemon_threads = False, server_close() joins the handlers, which close their
files first; the folder's removal is strict again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 17:16:53 +01:00
f27cd4ae22 tests/test_launcher_serve: stop the file server before its folders go, and don't fail on a file still open
FetchTests made their temporary folders with 'with', so they were removed when
the test body ended, before the cleanups stopped the test's HTTP server; on
Windows the handler thread could still hold art.jpg open and the removal failed
with PermissionError [WinError 32] (seen on #2724, #2734 and #2754). The folders
are now made with enterContext before the server, so the server stops first, and
with ignore_cleanup_errors=True.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 17:04:00 +01:00
d56a01a505 launcher: the key art behind PLAY, fetched once and kept outside the repository
The picture behind PLAY is the one chosen in Settings (Launcher, Background picture), else the newest background.webp,
.png or .jpg in the launcher's settings folder (%APPDATA%\Leonida), else the newest capture, else the drawn art. When
there is none, launcher/serve.py fetches the game's key art from rockstargames.com once at start (2560 wide) and
keeps it there as background.<the type that came back>; --no-art leaves it. The request names a plain browser and
nothing about the user or the project; what comes back is kept only if its bytes are a PNG, JPEG or WebP. The picture
is never part of the repository.

Over a picture the page sets it a little lower, so heads clear the words top right, fills the band above with the
picture's own top row, and moves the cards to the bottom so the faces stay clear. /media/background needs the run's
cookie and serves only a picture by its bytes.

Tested: python -I tests/test_launcher_serve.py (10 tests: picture kinds, which background, the fetch against a local
server, token, Host, Origin, cookie, preview starting nothing) and tests/test_leonida_launcher.py (15), the
no-game-data check, and the page in a browser with the server in --no-run mode: the art was fetched (2560x1440 WebP)
and shown, Settings names the file in use.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 17:52:09 -05:00