From 9f62cc157e8815a5f949399e0f493a895be56f88 Mon Sep 17 00:00:00 2001 From: rob-sumer <137927208+rob-sumer@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:58:18 -1000 Subject: [PATCH] Refresh Draft function for Football If we want to run in-step with a live draft, we need a short circuit to retrieve latest draft state without refreshing the entirety of league state. --- espn_api/football/league.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/espn_api/football/league.py b/espn_api/football/league.py index 8a823856..c47c2eab 100644 --- a/espn_api/football/league.py +++ b/espn_api/football/league.py @@ -82,6 +82,14 @@ def refresh(self): self.nfl_week = data['status']['latestScoringPeriod'] self._fetch_teams(data) + + def refresh_draft(self, refresh_players=False, refresh__teams=False): + super()._fetch_draft() + if refresh_players: + self._fetch_players() + if refresh__teams: + self._fetch_teams(data) + def load_roster_week(self, week: int) -> None: '''Sets Teams Roster for a Certain Week''' params = {