diff --git a/espn_api/basketball/box_score.py b/espn_api/basketball/box_score.py index 949f78c9..cf0f1999 100644 --- a/espn_api/basketball/box_score.py +++ b/espn_api/basketball/box_score.py @@ -7,6 +7,7 @@ def __init__(self, data, pro_schedule, by_matchup): self.home_team = data['home']['teamId'] self.home_projected = -1 # week is over/not set roster_key = 'rosterForMatchupPeriod' if by_matchup else 'rosterForCurrentScoringPeriod' + # TODO combine home and away logic into common function home_roster = data['home'].get(roster_key, {}) if 'totalPointsLive' in data['home'] and by_matchup: self.home_score = round(data['home']['totalPointsLive'], 2) @@ -23,7 +24,7 @@ def __init__(self, data, pro_schedule, by_matchup): if 'away' in data: self.away_team = data['away']['teamId'] away_roster = data['away'].get(roster_key, {}) - if 'totalPointsLive' in data['away']: + if 'totalPointsLive' in data['away'] and by_matchup: self.away_score = round(data['away']['totalPointsLive'], 2) self.away_projected = round(data['away'].get('totalProjectedPointsLive', -1), 2) else: diff --git a/setup.py b/setup.py index b790a0a9..5be14b99 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='espn_api', packages=find_packages(), - version='0.16.0', + version='0.16.1', author='Christian Wendt', description='ESPN API', install_requires=['requests>=2.0.0,<3.0.0', 'pandas>=0.11.0,<=0.25.3', 'numpy>=1.15,<=1.17.5'],