Skip to content

Commit

Permalink
Ensure numeric values are strings (#840)
Browse files Browse the repository at this point in the history
This prevents record/score values from being being interpreted as False
and excluded from bracketed blocks in formatp.
  • Loading branch information
terminalmage authored Mar 22, 2022
1 parent c4876ed commit 9088796
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion i3pystatus/scores/mlb.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +272,19 @@ def process_game(self, game):
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}_score'] = self.get_nested(
linescore,
f'teams:{team}:runs',
default='0')
callback=self.zero_fallback,
default=0)

for key in ('delay', 'postponed', 'suspended'):
ret[key] = ''
Expand Down

0 comments on commit 9088796

Please sign in to comment.