mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 06:46:00 +00:00
filter_roms feeds both the gallery/list endpoint (SimpleRomSchema, no files) and the feed endpoints (which iterate rom.files / is_top_level). The cleanup commit's unconditional selectinload(Rom.files) + joinedload made the gallery/list and filter-value paths pay for files they never serialize. Gate the files load behind a new `include_files` flag (default False), mirroring the existing `include_file_stats` opt-in, and plumb it through get_roms_scalar. The 9 feed endpoints that actually read rom.files opt in; the gallery/list, filter-values, identifiers, smart-collection, and the three feeds that don't touch files (webrcade, fpkgi, kekatsu) skip the load entirely — keeping the gallery query at zero file cost. https://claude.ai/code/session_01PSXKmejPRzdxLFMN6P2QQ4