From 16bd6fb3f22fffceffcf92a3c79d8846f96277eb Mon Sep 17 00:00:00 2001 From: Christian Wendt Date: Thu, 26 Oct 2023 15:37:16 +0000 Subject: [PATCH] keep old in case --- espn_api/baseball/team.py | 2 ++ espn_api/basketball/team.py | 2 ++ espn_api/football/team.py | 2 ++ espn_api/hockey/team.py | 2 ++ espn_api/wbasketball/team.py | 2 ++ 5 files changed, 10 insertions(+) diff --git a/espn_api/baseball/team.py b/espn_api/baseball/team.py index 10a16b3e..13a2f38a 100644 --- a/espn_api/baseball/team.py +++ b/espn_api/baseball/team.py @@ -9,6 +9,8 @@ def __init__(self, data, roster, schedule, year, **kwargs): self.team_id = data['id'] self.team_abbrev = data['abbrev'] 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')) 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 3ecd1093..b1381544 100644 --- a/espn_api/basketball/team.py +++ b/espn_api/basketball/team.py @@ -8,6 +8,8 @@ def __init__(self, data, roster, schedule, year, **kwargs): self.team_id = data['id'] self.team_abbrev = data['abbrev'] 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')) 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 5a5a9dd0..4c2991f6 100644 --- a/espn_api/football/team.py +++ b/espn_api/football/team.py @@ -6,6 +6,8 @@ def __init__(self, data, roster, schedule, year, **kwargs): self.team_id = data['id'] self.team_abbrev = data['abbrev'] 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')) 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 4868906e..f744098c 100644 --- a/espn_api/hockey/team.py +++ b/espn_api/hockey/team.py @@ -10,6 +10,8 @@ def __init__(self, data, roster, schedule, year, **kwargs): self.team_id = data['id'] self.team_abbrev = data['abbrev'] 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')) 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 87ede9f9..7a72f39c 100644 --- a/espn_api/wbasketball/team.py +++ b/espn_api/wbasketball/team.py @@ -8,6 +8,8 @@ def __init__(self, data, roster, schedule, year, **kwargs): self.team_id = data['id'] self.team_abbrev = data['abbrev'] 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')) self.division_id = data['divisionId'] self.division_name = '' # set by caller self.wins = data['record']['overall']['wins']