mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 02:22:44 +01:00
Apply the code-review pass over the screenshot preference order. take_state_frame() was the only consumer that deletes the Redis key, so once an emulator's own frame won, a stashed browser frame survived its save and could become a later one's thumbnail. Drain it on every pull. For RetroArch the unguarded final fallback re-issued the identical /state-screenshot GET, a second blocking 60s request held while the container reservation is still out. The retroarch literal moves to a module-level _BROKER_FRAME_EMULATORS, next to the other per-emulator tables, and extract_state_screenshot() catches anything the zip read raises so a corrupt embedded PNG costs the thumbnail, not the state. Tests cover the RetroArch broker preference, its fallback to the browser frame, and the single broker request when neither source exists. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>