Batting stats re24 sort update

This commit is contained in:
Cal Corum 2023-10-30 21:17:33 -05:00
parent c0a94613a3
commit c884f45c17
2 changed files with 9 additions and 2 deletions

View File

@ -509,7 +509,8 @@ async def get_batting_totals(
sum_sb = this_run[0].sum_sb sum_sb = this_run[0].sum_sb
sum_cs = this_run[0].sum_cs sum_cs = this_run[0].sum_cs
run_wpa = this_run[0].sum_wpa run_wpa = this_run[0].sum_wpa
run_re24 = this_run[0].sum_re24 # run_re24 = this_run[0].sum_re24
run_re24 = 0
else: else:
sum_sb = 0 sum_sb = 0
sum_cs = 0 sum_cs = 0
@ -578,6 +579,11 @@ async def get_batting_totals(
'rbi%': rbi_rate 'rbi%': rbi_rate
}) })
# if group_by == 're24-desc':
# return_stats['stats'].sort(key=lambda x: x['re24'], reverse=True)
# elif group_by == 're24-asc':
# return_stats['stats'].sort(key=lambda x: x['re24'])
if csv: if csv:
return_vals = return_stats['stats'] return_vals = return_stats['stats']
if len(return_vals) == 0: if len(return_vals) == 0:

View File

@ -576,7 +576,8 @@ async def get_team_record(team_id: int, season: int):
standings = { standings = {
'minor-league': copy.deepcopy(template), 'minor-league': copy.deepcopy(template),
'major-league': copy.deepcopy(template), 'major-league': copy.deepcopy(template),
'hall-of-fame': copy.deepcopy(template) 'hall-of-fame': copy.deepcopy(template),
'tens': copy.deepcopy(template)
} }
for game in all_games: for game in all_games: