From 7b31c4cca5d1ae5f4ed0d4488c55091683f2b3c7 Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Sat, 9 Aug 2025 13:55:34 -0500 Subject: [PATCH] milb deduplication --- src/milb_manager.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/milb_manager.py b/src/milb_manager.py index 30076afc..2946b2fd 100644 --- a/src/milb_manager.py +++ b/src/milb_manager.py @@ -80,13 +80,7 @@ class BaseMiLBManager: abstract_state = str(status_obj.get('abstractGameState', '')).lower() is_live = (status_code == 'I') or (abstract_state == 'live') - if not is_live: - # Some feeds report via liveData/linescore even when abstractGameState lags - live_data = payload.get('liveData', {}) - linescore = live_data.get('linescore', {}) - if linescore.get('currentInning'): - is_live = True - + # Only treat as live if feed status says in-progress if not is_live: return False @@ -128,9 +122,10 @@ class BaseMiLBManager: 'third' in offense ] - # Set status to in-progress + # Set status to in-progress and record feed status code game_data['status'] = 'status_in_progress' game_data['status_state'] = 'in' + game_data['_status_code'] = status_code return True except Exception as e: self.logger.debug(f"[MiLB] Live feed probe failed for {game_pk}: {e}")