-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.4.0 #51
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This gets most pieces of the module back into working order with the new API. I haven't found any way of determining how much time is left in a period, so that still needs to be figured out. I'm also not sure what the CRIT gameState is, but it seems to be "game almost over". Periods are missing their ordinal suffix right now, so they're just numbers rather than "1st" or "2nd". I don't know what a postponed game state is, either, so that is still TBD. I have yet to find any details on endpoints for playoff series information, so while I can query last season's playoff games, I am not sure how to query for the full playoff series details. Fixes #49
I broke this after a late edit while preparing the change to be committed.
This is how the module is expecting to handle the period.
As much as we can, anyway. The API only gives us back about a week's worth of games.
This will return all games that take place on the day that you define as daysAhead. My previous implementation would return all games happening at (now + days ahead) which meant it would take the current time into consideration. Now the time is dropped so if daysAhead were 1, you'd see all games happening any time today and any time tomorrow (plus whatever daysInPast is set to).
I think this will work, but I need to wait until a game is live before being certain. This fetches all current scores, which includes game clock information, and applies the clock info to games that are in progress. Furthermore, if we aren't able to retrieve the time remaining, we will just display the period number the same way that "Final" or date/time is already displayed.
This allows the template to change minimally. Since we're already transforming the received data into a different object for presentation, it makes sense to keep things consistent where possible.
This endpoint is being incredibly slow today, and once we've loaded it we probably don't need to load it again.
The scores endpoint only returns games for the requested day, so we need to use today, not startDate.
Don't show "Final" during crit, just show the score as normal.
Update for 2023 api
Looks like it's showing correct information for the live games tonight. I did see a "4th" once, either last night or earlier today, but that was still in my branch and I'm not sure what caused it. This all seems to be working for me :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated module to work with the new NHL API.