From 90887964e180322aa9c531783786607fa1c0b499 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Tue, 22 Mar 2022 16:00:45 -0500 Subject: [PATCH] Ensure numeric values are strings (#840) This prevents record/score values from being being interpreted as False and excluded from bracketed blocks in formatp. --- i3pystatus/scores/mlb.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/i3pystatus/scores/mlb.py b/i3pystatus/scores/mlb.py index ed60064e..0ad8aaf6 100644 --- a/i3pystatus/scores/mlb.py +++ b/i3pystatus/scores/mlb.py @@ -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] = ''