mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 18:11:16 +01:00
The streamed resource downloads wrapped their writes in `except httpx.TransportError`, which does not cover the `OSError` raised by `f.write()` when the filesystem is out of space. The error escaped the handler and the partially written file stayed on disk. A truncated file is worse than a missing one: it satisfies the `cover_exists` / `screenshots_exist` checks and the `file_exists` guards in `store_ra_badge` and `store_media_file`, so later scans skip it and never refetch it. The artwork stays permanently corrupt. Catch `OSError` on every resource write path (covers, screenshots, manuals, RA badges, media files and uploaded artwork) and remove the partial file so the next scan refetches it. A stream that drops mid-transfer leaves the same truncated file, so the transport-error branches now discard it too. The cleanup helper swallows its own `OSError` so it can never mask the original failure. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>