From 5fbcbbe7254ec3e7b23c7fb5a642523f908c562b Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Wed, 22 Mar 2023 16:15:48 -0500 Subject: [PATCH] Tweak limits again --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index b8f13d4..0916961 100644 --- a/main.py +++ b/main.py @@ -1829,8 +1829,8 @@ async def v1_battingstats_get( db.close() raise HTTPException(status_code=404, detail=f'Start week {start} is after end week {end} - cannot pull stats') - # if start + 5 < end and not csv: - # start = end - 5 + if start + 5 < end and team_abbrev is None and player_name is None and player_id is None and not csv: + start = end - 5 logging.info(f'\n\nweek_start: {week_start} / week_end: {week_end} / game_num: {game_num} / ' f'start: {start} / end: {end}') @@ -2287,7 +2287,7 @@ async def v1_pitchingstat_get( db.close() raise HTTPException(status_code=404, detail=f'Start week {start} is after end week {end} - cannot pull stats') - if start + 5 < end: + if start + 5 < end and team_abbrev is None and player_name is None and player_id is None and not csv: start = end - 5 all_stats = all_stats.where( @@ -2647,7 +2647,7 @@ async def v1_fieldingstats_get( db.close() raise HTTPException(status_code=404, detail=f'Start week {start} is after end week {end} - cannot pull stats') - if start + 5 < end: + if start + 5 < end and team_abbrev is None and player_name is None and player_id is None and not csv: start = end - 5 all_stats = all_stats.where(