Skip to content

Commit

Permalink
Merge pull request #217 from cwendt94/BbBoxScoreFixAway
Browse files Browse the repository at this point in the history
Fix Basketball Box Score Final Scoring Period Away
  • Loading branch information
cwendt94 authored May 27, 2021
2 parents 2e5f2f3 + 97a1515 commit 3fdf52e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion espn_api/basketball/box_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 3fdf52e

Please sign in to comment.