You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
routes/games.py Decomposition — Split the 2 472-line routes/games.py by extracting shared query helpers and the HLTB sub-API into dedicated modules. No behavior change — all 30 pytest cases still pass, ruff clean.
services/game_query.py (new) — Extracted query helpers used across the games blueprint: escape_like (SQL LIKE character escaping), _get_filter_options (60-second TTL cache for dropdown values), _build_games_query (the master WHERE/JOIN builder with filter, search, letter-nav, and source-source logic), get_retroachievements_info, get_trophy_info_for_game, get_bonus_discs_for_game. Also extracted the filter cache state and invalidate_filter_cache().
routes/games_hltb.py (new blueprint) — Extracted the four HLTB API endpoints (/api/hltb-lookup/<id>, /api/hltb-save/<id>, /api/hltb-clear/<id>, /api/hltb/search) into their own blueprint. URL paths are unchanged; endpoint names are now games_hltb.* (no template references needed updating since these are called from JS via fetch).
routes/games.py shrinks — Down from 2 472 to 2 000 lines (−19%). Combined with v2.77.8, app.py + routes/games.py have together dropped by about 1 450 lines, replaced by six cohesive service/blueprint modules totalling 1 540 lines — the codebase is cleaner to navigate without growing.