This commit is contained in:
Georges-Antoine Assi
2026-06-02 08:02:54 -04:00
parent fbd703cccb
commit 895f495ee6

View File

@@ -143,10 +143,7 @@ def with_details(func):
),
selectinload(Rom.rom_users).options(noload(RomUser.rom)),
selectinload(Rom.metadatum).options(noload(RomMetadata.rom)),
# `is_top_level` / `file_name_for_download` (multi-file downloads,
# 3DS QR codes, metadata matching) read `RomFile.rom.full_path`, so
# eager-load the parent's path columns to avoid a lazy load on a
# detached instance once the session closes.
# Multi-file downloads, 3DS QR codes, and metadata matching
selectinload(Rom.files).options(
joinedload(RomFile.rom).load_only(Rom.fs_path, Rom.fs_name)
),
@@ -600,8 +597,10 @@ class DBRomsHandler(DBBaseHandler):
selectinload(Rom.rom_users).options(noload(RomUser.rom)),
# Sort table by metadata (first_release_date)
selectinload(Rom.metadatum).options(noload(RomMetadata.rom)),
# Required for multi-file ROM actions and 3DS QR code
selectinload(Rom.files),
# Multi-file downloads, 3DS QR codes, and metadata matching
selectinload(Rom.files).options(
joinedload(RomFile.rom).load_only(Rom.fs_path, Rom.fs_name)
),
# Show sibling rom badges on cards
selectinload(Rom.sibling_roms).options(
noload(Rom.platform), noload(Rom.metadatum)