Skip to content

Commit

Permalink
75 odds fix (#76)
Browse files Browse the repository at this point in the history
* Fix: Schedule.get_schedule - adds better key extraction on payload when using past seasons
  • Loading branch information
coreyjs authored Oct 27, 2024
1 parent fac8c83 commit 6a21a36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions nhlpy/api/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def get_schedule(self, date: str = None) -> dict:

schedule_data: dict = self.client.get(resource=f"schedule/{date}").json()
response_payload = {
"nextStartDate": schedule_data["nextStartDate"],
"previousStartDate": schedule_data["previousStartDate"],
"nextStartDate": schedule_data.get("nextStartDate", None),
"previousStartDate": schedule_data.get("previousStartDate", None),
"date": date,
"oddsPartners": schedule_data["oddsPartners"],
"oddsPartners": schedule_data.get("oddsPartners", None),
}

matching_day = next((day for day in schedule_data["gameWeek"] if day["date"] == date), None)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "nhl-api-py"
version = "2.12.0"
version = "2.12.1"
description = "NHL API (Updated for 2024/2025) and EDGE Stats. For standings, team stats, outcomes, player information. Contains each individual API endpoint as well as convience methods as well as pythonic query builder for more indepth EDGE stats."
authors = ["Corey Schaf <cschaf@gmail.com>"]
readme = "README.md"
Expand Down

0 comments on commit 6a21a36

Please sign in to comment.