m0ranwad / nba-led-scoreboard

NBA LED scoreboard! This project displays matches and scores for all of the current day's NBA action
GNU General Public License v3.0
5 stars 3 forks source link

Update data.py #9

Closed alexanderthebadatcoding closed 10 months ago

alexanderthebadatcoding commented 10 months ago

fix date checker.

m0ranwad commented 10 months ago

@alexanderthebadatcoding - as far as I can tell, this is a breaking change for the displaying the Countdown.

Prior to this change, we would compare UTCNOW with the UTC Gametime to determine whether or not to draw the countdown. Along with this change, we would need to modify the UTC Gametime that is retrieved in order to prevent this logic from failing.

I might roll this back until I have a moment to look at how we're retrieving the gametime.

alexanderthebadatcoding commented 10 months ago

I was just focused on fixing the incorrect dates, but It seems to be working for me.

I think in the main renderer file I changed

in def _draw_countdown(self, game):
...
if current_time < game_datetime:

and that seemed to fix it for me.

alexanderthebadatcoding commented 10 months ago

I'll double check when it gets closer to game time.

m0ranwad commented 10 months ago

Sounds good. I might have some time to look at it today.

Adding some debug statements to __draw_game made troubleshooting a bit easier for me

debug.info(f"Current Time: {current_time}")
debug.info(f"Game Time: {gametime}")
alexanderthebadatcoding commented 10 months ago

Maybe it's not working haha. I'll keep messing with it.

m0ranwad commented 10 months ago

@alexanderthebadatcoding - I think I found a simple fix. About to post the PR