diff --git a/app/routers_v2/stratplays.py b/app/routers_v2/stratplays.py index 66b2aca..e64f19a 100644 --- a/app/routers_v2/stratplays.py +++ b/app/routers_v2/stratplays.py @@ -770,6 +770,10 @@ async def get_pitching_totals( for x in pit_plays: this_dec = all_dec.where(Decision.pitcher == x.pitcher) + if game_type is not None: + all_types = [x.lower() for x in game_type] + all_games = StratGame.select().where(fn.Lower(StratGame.game_type) << all_types) + this_dec = this_dec.where(Decision.game << all_games) tot_outs = x.sum_outs if x.sum_outs > 0 else 1 obp = (x.sum_hit + x.sum_bb + x.sum_hbp + x.sum_ibb) / x.sum_pa slg = (x.sum_hr * 4 + x.sum_triple * 3 + x.sum_double * 2 +