Skip to content

Commit

Permalink
i3pystatus.scores.nhl: Handle null win/loss values during playoffs (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
terminalmage authored Apr 25, 2023
1 parent 60ac28b commit 0820dd4
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions i3pystatus/scores/nhl.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,21 +284,30 @@ def process_game(self, game):
'score',
callback=self.zero_fallback,
default=0)
ret[f'{team}_wins'] = self.get_nested(
team_data,
'leagueRecord:wins',
callback=self.zero_fallback,
default=0)
ret[f'{team}_losses'] = self.get_nested(
team_data,
'leagueRecord:losses',
callback=self.zero_fallback,
default=0)
ret[f'{team}_otl'] = self.get_nested(
team_data,
'leagueRecord:ot',
callback=self.zero_fallback,
default=0)
ret[f'{team}_wins'] = int(
self.get_nested(
team_data,
'leagueRecord:wins',
callback=self.zero_fallback,
default=0,
)
)
ret[f'{team}_losses'] = int(
self.get_nested(
team_data,
'leagueRecord:losses',
callback=self.zero_fallback,
default=0,
)
)
ret[f'{team}_otl'] = int(
self.get_nested(
team_data,
'leagueRecord:ot',
callback=self.zero_fallback,
default=0,
)
)

ret[f'{team}_city'] = self.get_nested(
team_data,
Expand Down

0 comments on commit 0820dd4

Please sign in to comment.