Skip to content

Commit 6a21a36

Browse files
authored
75 odds fix (#76)
* Fix: Schedule.get_schedule - adds better key extraction on payload when using past seasons
1 parent fac8c83 commit 6a21a36

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

nhlpy/api/schedule.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ def get_schedule(self, date: str = None) -> dict:
2222

2323
schedule_data: dict = self.client.get(resource=f"schedule/{date}").json()
2424
response_payload = {
25-
"nextStartDate": schedule_data["nextStartDate"],
26-
"previousStartDate": schedule_data["previousStartDate"],
25+
"nextStartDate": schedule_data.get("nextStartDate", None),
26+
"previousStartDate": schedule_data.get("previousStartDate", None),
2727
"date": date,
28-
"oddsPartners": schedule_data["oddsPartners"],
28+
"oddsPartners": schedule_data.get("oddsPartners", None),
2929
}
3030

3131
matching_day = next((day for day in schedule_data["gameWeek"] if day["date"] == date), None)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "nhl-api-py"
7-
version = "2.12.0"
7+
version = "2.12.1"
88
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."
99
authors = ["Corey Schaf <[email protected]>"]
1010
readme = "README.md"

0 commit comments

Comments
 (0)