From d0defe0810eea87f286b724623bdc5fa08e0afd3 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Fri, 22 Jul 2016 00:15:58 -0500 Subject: [PATCH] Properly identify rain-shortened games as final These were erroneously being identified as pregame --- i3pystatus/scores/mlb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i3pystatus/scores/mlb.py b/i3pystatus/scores/mlb.py index 7109184..54b3740 100644 --- a/i3pystatus/scores/mlb.py +++ b/i3pystatus/scores/mlb.py @@ -269,7 +269,7 @@ class MLB(ScoresBackend): ret['delay'] = game.get('reason', 'Unknown') elif ret['status'] == 'postponed': ret['postponed'] = game.get('reason', 'Unknown Reason') - elif ret['status'] == 'game_over': + elif ret['status'] in ('game_over', 'completed_early'): ret['status'] = 'final' elif ret['status'] not in ('in_progress', 'final'): ret['status'] = 'pregame' @@ -277,7 +277,7 @@ class MLB(ScoresBackend): try: inning = game.get('inning', '0') ret['extra_innings'] = inning \ - if ret['status'] == 'final' and int(inning) > 9 \ + if ret['status'] == 'final' and int(inning) != 9 \ else '' except ValueError: ret['extra_innings'] = ''