mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 21:03:01 +00:00
fix utc timedate error in milb
This commit is contained in:
@@ -1147,6 +1147,7 @@ class MiLBUpcomingManager(BaseMiLBManager):
|
|||||||
|
|
||||||
self.logger.info(f"[MiLB] Processing {len(games)} games for upcoming games...")
|
self.logger.info(f"[MiLB] Processing {len(games)} games for upcoming games...")
|
||||||
|
|
||||||
|
now_utc = datetime.now(timezone.utc)
|
||||||
for game_id, game in games.items():
|
for game_id, game in games.items():
|
||||||
self.logger.debug(f"[MiLB] Processing game {game_id} for upcoming games...")
|
self.logger.debug(f"[MiLB] Processing game {game_id} for upcoming games...")
|
||||||
|
|
||||||
@@ -1154,16 +1155,15 @@ class MiLBUpcomingManager(BaseMiLBManager):
|
|||||||
if game_time.tzinfo is None:
|
if game_time.tzinfo is None:
|
||||||
game_time = game_time.replace(tzinfo=timezone.utc)
|
game_time = game_time.replace(tzinfo=timezone.utc)
|
||||||
|
|
||||||
current_time = datetime.now(timezone.utc)
|
|
||||||
is_upcoming = (
|
is_upcoming = (
|
||||||
game['status_state'] not in ['post', 'final', 'completed'] and
|
game['status_state'] not in ['post', 'final', 'completed'] and
|
||||||
game_time > current_time
|
game_time > now_utc
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add debug logging for upcoming games logic
|
# Add debug logging for upcoming games logic
|
||||||
self.logger.debug(f"[MiLB] Game {game['away_team']} @ {game['home_team']}:")
|
self.logger.debug(f"[MiLB] Game {game['away_team']} @ {game['home_team']}:")
|
||||||
self.logger.debug(f"[MiLB] Game time: {game_time}")
|
self.logger.debug(f"[MiLB] Game time: {game_time}")
|
||||||
self.logger.debug(f"[MiLB] Current time: {current_time}")
|
self.logger.debug(f"[MiLB] Current time: {now_utc}")
|
||||||
self.logger.debug(f"[MiLB] Status state: {game['status_state']}")
|
self.logger.debug(f"[MiLB] Status state: {game['status_state']}")
|
||||||
self.logger.debug(f"[MiLB] Is upcoming: {is_upcoming}")
|
self.logger.debug(f"[MiLB] Is upcoming: {is_upcoming}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user