mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 06:46:00 +00:00
The gallery list endpoint was eager-loading every rom_file row for each paginated ROM via selectinload, then re-joining each row back to its parent rom for the is_top_level computation. For platforms with extracted multi-file ROMs (Xbox 360 ~1394 files/ROM, Switch ~199 files/ROM), this made /api/roms time out at 120s even with a rom_id index. Cards never displayed individual files — only the has_simple_single_file / has_nested_single_file / has_multiple_files booleans that derive from the file list. Denormalize the underlying state onto roms as multi_file (folder-based vs single-file) and top_level_file_count, recompute the booleans from those columns, drop the selectinload from filter_roms, and move the files field from SimpleRomSchema to DetailedRomSchema so the gallery payload no longer ships file rows. Also drop the redundant joinedload(RomFile.rom) and switch the relation to lazy="select" so subsequent file.rom accesses resolve from the session identity map instead of re-JOINing the parent rom per file row. ShowQRCode.vue's folder-based DS/3DS fallback now fetches the detailed rom on demand, since SimpleRom no longer carries files.