Jon Solow commited on
Commit
cddb304
1 Parent(s): 0f5112d

Show win or loss in status

Browse files
src/pages/11_Scoreboard.py CHANGED
@@ -89,8 +89,11 @@ def get_player_html_str(player_opt: PlayerOption, player_stats: dict[str, float]
89
  # TODO
90
  multiplier = 1
91
 
92
- game_map = get_schedule_with_live().get(player_opt.week, {}).get(player_opt.team, {})
93
- game_status = " "
 
 
 
94
  if team_score := game_map.get("score"):
95
  game_score = f"""{team_score} - {game_map.get("opponent_score")}"""
96
  else:
 
89
  # TODO
90
  multiplier = 1
91
 
92
+ if player_opt.week and player_opt.team:
93
+ game_map = get_schedule_with_live().get(player_opt.week, {}).get(player_opt.team, {})
94
+ else:
95
+ game_map = {}
96
+ game_status = game_map.get("status") or " "
97
  if team_score := game_map.get("score"):
98
  game_score = f"""{team_score} - {game_map.get("opponent_score")}"""
99
  else:
src/queries/pfr/league_schedule.py CHANGED
@@ -45,8 +45,10 @@ def get_season_game_map(
45
  if isinstance(row["PtsW"], str) and isinstance(row["PtsL"], str):
46
  winner_game["score"] = int(row["PtsW"])
47
  winner_game["opponent_score"] = int(row["PtsL"])
 
48
  loser_game["score"] = int(row["PtsL"])
49
  loser_game["opponent_score"] = int(row["PtsW"])
 
50
  week_team_time_map[mapped_week][winner_team] = winner_game
51
  week_team_time_map[mapped_week][loser_team] = loser_game
52
  return week_team_time_map, last_game_week_map
 
45
  if isinstance(row["PtsW"], str) and isinstance(row["PtsL"], str):
46
  winner_game["score"] = int(row["PtsW"])
47
  winner_game["opponent_score"] = int(row["PtsL"])
48
+ winner_game["status"] = "Win"
49
  loser_game["score"] = int(row["PtsL"])
50
  loser_game["opponent_score"] = int(row["PtsW"])
51
+ loser_game["status"] = "Loss"
52
  week_team_time_map[mapped_week][winner_team] = winner_game
53
  week_team_time_map[mapped_week][loser_team] = loser_game
54
  return week_team_time_map, last_game_week_map