Skip to content

Commit

Permalink
Merge pull request #509 from DesiPilla/add-previous-seasons
Browse files Browse the repository at this point in the history
feat: Add `previousSeasons` to `BaseLeague` object
  • Loading branch information
cwendt94 authored Dec 5, 2023
2 parents cff22b5 + 8f9a834 commit 2ccb6b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions espn_api/base_league.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def _fetch_league(self, SettingsClass = BaseSettings):
self.scoringPeriodId = data['scoringPeriodId']
self.firstScoringPeriod = data['status']['firstScoringPeriod']
self.finalScoringPeriod = data['status']['finalScoringPeriod']
self.previousSeasons = [
year for year in data["status"]["previousSeasons"] if year < self.year
]
if self.year < 2018:
self.current_week = data['scoringPeriodId']
else:
Expand Down

0 comments on commit 2ccb6b7

Please sign in to comment.