feat: Push the games that are in intermission to the bottom, but retain their sort
This commit is contained in:
@@ -76,7 +76,7 @@ def get_game_outcome(game, game_state):
|
||||
|
||||
def calculate_game_priority(game):
|
||||
# Return 0 if game is in certain states
|
||||
if game["gameState"] in ["FINAL", "OFF", "PRE", "FUT"] or game["clock"]["inIntermission"]:
|
||||
if game["gameState"] in ["FINAL", "OFF", "PRE", "FUT"]:
|
||||
return 0
|
||||
|
||||
# Get standings for home and away teams
|
||||
@@ -121,6 +121,10 @@ def calculate_game_priority(game):
|
||||
# Calculate the final priority
|
||||
final_priority = int(base_priority + time_priority - matchup_adjustment + score_total)
|
||||
|
||||
# Pushes the games that are in intermission to the bottom, but retains their sort
|
||||
if game["clock"]["inIntermission"]:
|
||||
return (final_priority - 2000)
|
||||
|
||||
return final_priority
|
||||
|
||||
def get_team_standings(team_name):
|
||||
|
||||
Reference in New Issue
Block a user