Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
fixed crash caused by missing "onIce" data
Browse files Browse the repository at this point in the history
  • Loading branch information
User Name committed Mar 7, 2024
1 parent 692ab84 commit 09830e4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def __parse_today(self):
today -= timedelta(days=1)

return today.year, today.month, today.day
#return 2021, 1, 26
#return 2024, 3, 4

def date(self):
return datetime(self.year, self.month, self.day).date()
Expand Down
4 changes: 1 addition & 3 deletions src/data/scoreboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ def __init__(self, overview, data):
debug.error("Failed to get Goal details for current live game. will retry on data refresh")
home_penalties = []
break
home_skaters = len(overview["homeTeam"]["onIce"])
away_skaters = len(overview["awayTeam"]["onIce"])

home_pp = False
away_pp = False
Expand Down Expand Up @@ -254,7 +252,7 @@ def __init__(self, game_details, data):
except KeyError:
self.intermission = False

if game_details["gameState"] == "OFF" or game_details["gameState"] == "FINAL":
if game_details["gameState"] == "OFF" or game_details["gameState"] == "FINAL" or game_details["gameState"] == "OVER":
if game_details["awayTeam"]["score"] > game_details["homeTeam"]["score"]:
self.winning_team_id = game_details["awayTeam"]["id"]
self.winning_score = game_details["awayTeam"]["score"]
Expand Down
1 change: 1 addition & 0 deletions src/nhl_api/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from nhl_api.utils import convert_time
import nhl_api.object


from nhlpy import NHLClient
# from nhl_api_client.api.play_by_play import get_schedule_by_date
#from nhlpy.api.game_center import boxscore
Expand Down

0 comments on commit 09830e4

Please sign in to comment.