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

Commit 09830e4

Browse files
author
User Name
committed
fixed crash caused by missing "onIce" data
1 parent 692ab84 commit 09830e4

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/data/data.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def __parse_today(self):
212212
today -= timedelta(days=1)
213213

214214
return today.year, today.month, today.day
215-
#return 2021, 1, 26
215+
#return 2024, 3, 4
216216

217217
def date(self):
218218
return datetime(self.year, self.month, self.day).date()

src/data/scoreboard.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ def __init__(self, overview, data):
149149
debug.error("Failed to get Goal details for current live game. will retry on data refresh")
150150
home_penalties = []
151151
break
152-
home_skaters = len(overview["homeTeam"]["onIce"])
153-
away_skaters = len(overview["awayTeam"]["onIce"])
154152

155153
home_pp = False
156154
away_pp = False
@@ -254,7 +252,7 @@ def __init__(self, game_details, data):
254252
except KeyError:
255253
self.intermission = False
256254

257-
if game_details["gameState"] == "OFF" or game_details["gameState"] == "FINAL":
255+
if game_details["gameState"] == "OFF" or game_details["gameState"] == "FINAL" or game_details["gameState"] == "OVER":
258256
if game_details["awayTeam"]["score"] > game_details["homeTeam"]["score"]:
259257
self.winning_team_id = game_details["awayTeam"]["id"]
260258
self.winning_score = game_details["awayTeam"]["score"]

src/nhl_api/game.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from nhl_api.utils import convert_time
77
import nhl_api.object
88

9+
910
from nhlpy import NHLClient
1011
# from nhl_api_client.api.play_by_play import get_schedule_by_date
1112
#from nhlpy.api.game_center import boxscore

0 commit comments

Comments
 (0)