Skip to content

Commit

Permalink
Merge pull request #324 from cwendt94/hockey_handle_unknown_pos
Browse files Browse the repository at this point in the history
Hockey Player Handle Unknown Position
  • Loading branch information
cwendt94 authored Apr 4, 2022
2 parents 7ccb1bc + 9934157 commit 1958c02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions espn_api/hockey/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class Player(object):
def __init__(self, data):
self.name = json_parsing(data, 'fullName')
self.playerId = json_parsing(data, 'id')
self.position = POSITION_MAP[json_parsing(data, 'defaultPositionId')]
self.position = POSITION_MAP.get(json_parsing(data, 'defaultPositionId'), '')
self.lineupSlot = POSITION_MAP.get(data.get('lineupSlotId'), '')
self.eligibleSlots = [POSITION_MAP[pos] for pos in json_parsing(data, 'eligibleSlots')]
self.eligibleSlots = [POSITION_MAP.get(pos, '') for pos in json_parsing(data, 'eligibleSlots')]
self.acquisitionType = json_parsing(data, 'acquisitionType')
self.proTeam = PRO_TEAM_MAP.get(json_parsing(data, 'proTeamId'), 'Unknown Team')
self.injuryStatus = json_parsing(data, 'injuryStatus')
Expand Down

0 comments on commit 1958c02

Please sign in to comment.