Replace per-row CardModel.get() in _build_card_state_response with a bulk prefetch in list_card_states: collect variant player IDs, issue at most 2 queries (BattingCard + PitchingCard), build a (player_id, variant) -> image_url map, and pass the resolved value directly to the helper. The single-card get_card_state path is unchanged and still resolves image_url inline (one extra query is acceptable for a single-item response). Closes #199 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| models | ||
| routers_v2 | ||
| seed | ||
| services | ||
| __init__.py | ||
| card_creation.py | ||
| db_engine.py | ||
| db_helpers.py | ||
| dependencies.py | ||
| main.py | ||
| player_scouting.py | ||