mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
Simplify pass: - get_roms_query returns the resolved _GallerySortKey and filter_roms accepts it, so one request resolves the sort once and the grouped aggregate cannot disagree with the ordering the query was built with. - _GallerySortKey carries a single source tag instead of two mutually exclusive booleans. - _rom_user_not_hidden() replaces the three copies of the null-safe visibility predicate. - _GROUP_SORT_AGGREGATE_TYPES trimmed to the types RomUser has (DateTime, Integer); Date/Numeric were unreachable. - order_dir normalizes once per entry point. Skipped, deliberately: folding dedup_subquery into the join condition (plan-pinned SQL) and a single-owner ORDER BY refactor (touches every get_roms_query caller). Compiled SQL is unchanged, per the shape tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ldi4YaXJWDDmFdbKfQay8L