mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-12 05:42:59 +00:00
Fix NHL upcoming games time window calculation - now properly checks for games within next 48 hours instead of past 48 hours
This commit is contained in:
@@ -351,8 +351,14 @@ class BaseNHLManager:
|
|||||||
# Calculate if game is within recent window
|
# Calculate if game is within recent window
|
||||||
is_within_window = False
|
is_within_window = False
|
||||||
if start_time_utc:
|
if start_time_utc:
|
||||||
cutoff_time = datetime.now(timezone.utc) - timedelta(hours=self.recent_hours)
|
# For upcoming games, check if the game is within the next 48 hours
|
||||||
is_within_window = start_time_utc > cutoff_time
|
if status["type"]["state"] == "pre":
|
||||||
|
cutoff_time = datetime.now(timezone.utc) + timedelta(hours=self.recent_hours)
|
||||||
|
is_within_window = start_time_utc <= cutoff_time
|
||||||
|
else:
|
||||||
|
# For recent games, check if the game is within the last 48 hours
|
||||||
|
cutoff_time = datetime.now(timezone.utc) - timedelta(hours=self.recent_hours)
|
||||||
|
is_within_window = start_time_utc > cutoff_time
|
||||||
self.logger.debug(f"[NHL] Game time: {start_time_utc}, Cutoff time: {cutoff_time}, Within window: {is_within_window}")
|
self.logger.debug(f"[NHL] Game time: {start_time_utc}, Cutoff time: {cutoff_time}, Within window: {is_within_window}")
|
||||||
|
|
||||||
details = {
|
details = {
|
||||||
|
|||||||
Reference in New Issue
Block a user