diff --git a/espn_api/baseball/team.py b/espn_api/baseball/team.py index 6fae0e75..13a2f38a 100644 --- a/espn_api/baseball/team.py +++ b/espn_api/baseball/team.py @@ -8,10 +8,9 @@ class Team(object): def __init__(self, data, roster, schedule, year, **kwargs): self.team_id = data['id'] self.team_abbrev = data['abbrev'] - if year < 2023: + self.team_name = data.get('name', 'Unknown') + if self.team_name == 'Unknown': self.team_name = "%s %s" % (data.get('location', 'Unknown'), data.get('nickname', 'Unknown')) - else: - self.team_name = data.get('name', 'Unknown') self.division_id = data['divisionId'] self.division_name = '' # set by caller self.wins = data['record']['overall']['wins'] diff --git a/espn_api/basketball/team.py b/espn_api/basketball/team.py index 1523ff6b..b1381544 100644 --- a/espn_api/basketball/team.py +++ b/espn_api/basketball/team.py @@ -7,10 +7,9 @@ class Team(object): def __init__(self, data, roster, schedule, year, **kwargs): self.team_id = data['id'] self.team_abbrev = data['abbrev'] - if year < 2023: + self.team_name = data.get('name', 'Unknown') + if self.team_name == 'Unknown': self.team_name = "%s %s" % (data.get('location', 'Unknown'), data.get('nickname', 'Unknown')) - else: - self.team_name = data.get('name', 'Unknown') self.division_id = data['divisionId'] self.division_name = '' # set by caller self.wins = data['record']['overall']['wins'] diff --git a/espn_api/football/team.py b/espn_api/football/team.py index d4b945bf..4c2991f6 100644 --- a/espn_api/football/team.py +++ b/espn_api/football/team.py @@ -5,10 +5,9 @@ class Team(object): def __init__(self, data, roster, schedule, year, **kwargs): self.team_id = data['id'] self.team_abbrev = data['abbrev'] - if year < 2023: + self.team_name = data.get('name', 'Unknown') + if self.team_name == 'Unknown': self.team_name = "%s %s" % (data.get('location', 'Unknown'), data.get('nickname', 'Unknown')) - else: - self.team_name = data.get('name', 'Unknown') self.division_id = data['divisionId'] self.division_name = '' # set by caller self.wins = data['record']['overall']['wins'] diff --git a/espn_api/hockey/team.py b/espn_api/hockey/team.py index 81dcd348..f744098c 100644 --- a/espn_api/hockey/team.py +++ b/espn_api/hockey/team.py @@ -9,10 +9,9 @@ class Team(object): def __init__(self, data, roster, schedule, year, **kwargs): self.team_id = data['id'] self.team_abbrev = data['abbrev'] - if year < 2023: + self.team_name = data.get('name', 'Unknown') + if self.team_name == 'Unknown': self.team_name = "%s %s" % (data.get('location', 'Unknown'), data.get('nickname', 'Unknown')) - else: - self.team_name = data.get('name', 'Unknown') self.division_id = data['divisionId'] self.division_name = '' # set by caller self.wins = data['record']['overall']['wins'] diff --git a/espn_api/wbasketball/team.py b/espn_api/wbasketball/team.py index 0c0edcba..7a72f39c 100644 --- a/espn_api/wbasketball/team.py +++ b/espn_api/wbasketball/team.py @@ -7,10 +7,9 @@ class Team(object): def __init__(self, data, roster, schedule, year, **kwargs): self.team_id = data['id'] self.team_abbrev = data['abbrev'] - if year < 2023: + self.team_name = data.get('name', 'Unknown') + if self.team_name == 'Unknown': self.team_name = "%s %s" % (data.get('location', 'Unknown'), data.get('nickname', 'Unknown')) - else: - self.team_name = data.get('name', 'Unknown') self.division_id = data['divisionId'] self.division_name = '' # set by caller self.wins = data['record']['overall']['wins']