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

Commit

Permalink
fixed crashed caused by missing clock
Browse files Browse the repository at this point in the history
  • Loading branch information
User Name committed Apr 20, 2024
1 parent 257004a commit 3deac70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
11 changes: 0 additions & 11 deletions src/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,6 @@ def __init__(self, config):
# Save the parsed config
self.config = config

# Initialize the time stamp. The time stamp is found only in the live feed endpoint of a game in the API
# It shows the last time (UTC) the data was updated. EX 20200114_041103
self.time_stamp = "00000000_000000"

# Flag for when the data live feed of a game has updated
self.new_data = True

# Get the status from the API
print("Get status from api")
self.get_status()
Expand Down Expand Up @@ -423,10 +416,6 @@ def refresh_overview(self):
while attempts_remaining > 0:
try:
self.overview = nhl_api.overview(self.current_game_id)
# TODO: Not sure what was going on here
if self.time_stamp != self.overview["clock"]["timeRemaining"]:
self.time_stamp = self.overview["clock"]["timeRemaining"]
self.new_data = True
self.needs_refresh = False
self.network_issues = False
break
Expand Down
6 changes: 5 additions & 1 deletion src/data/scoreboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ def __init__(self, overview, data):
self.start_time = convert_time(datetime.strptime(overview["startTimeUTC"],'%Y-%m-%dT%H:%M:%SZ')).strftime(time_format)
self.status = overview["gameState"]
self.periods = Periods(overview)
self.intermission = overview["clock"]["inIntermission"]

try:
self.intermission = overview["clock"]["inIntermission"]
except:
self.intermission = False

if overview["gameState"] == "OFF" or overview["gameState"] == "FINAL":
if away_team["score"] > home_team["score"]:
Expand Down

0 comments on commit 3deac70

Please sign in to comment.