wip
This commit is contained in:
@@ -624,7 +624,7 @@ class MLBScraper(BaseScraper):
|
||||
for abbrev in abbrevs:
|
||||
team_divisions[abbrev] = (league, div)
|
||||
|
||||
for abbrev, (team_id, full_name, city) in TEAM_MAPPINGS.get("mlb", {}).items():
|
||||
for abbrev, (team_id, full_name, city, stadium_id) in TEAM_MAPPINGS.get("mlb", {}).items():
|
||||
if team_id in seen:
|
||||
continue
|
||||
seen.add(team_id)
|
||||
@@ -642,14 +642,6 @@ class MLBScraper(BaseScraper):
|
||||
# Get league and division
|
||||
league, div = team_divisions.get(abbrev, (None, None))
|
||||
|
||||
# Get stadium ID
|
||||
stadium_id = None
|
||||
mlb_stadiums = STADIUM_MAPPINGS.get("mlb", {})
|
||||
for sid, sinfo in mlb_stadiums.items():
|
||||
if city.lower() in sinfo.city.lower() or sinfo.city.lower() in city.lower():
|
||||
stadium_id = sid
|
||||
break
|
||||
|
||||
team = Team(
|
||||
id=team_id,
|
||||
sport="mlb",
|
||||
|
||||
@@ -345,7 +345,7 @@ class MLSScraper(BaseScraper):
|
||||
for abbrev in abbrevs:
|
||||
team_conferences[abbrev] = conf
|
||||
|
||||
for abbrev, (team_id, full_name, city) in TEAM_MAPPINGS.get("mls", {}).items():
|
||||
for abbrev, (team_id, full_name, city, stadium_id) in TEAM_MAPPINGS.get("mls", {}).items():
|
||||
if team_id in seen:
|
||||
continue
|
||||
seen.add(team_id)
|
||||
@@ -356,14 +356,6 @@ class MLSScraper(BaseScraper):
|
||||
# Get conference
|
||||
conf = team_conferences.get(abbrev)
|
||||
|
||||
# Get stadium ID
|
||||
stadium_id = None
|
||||
mls_stadiums = STADIUM_MAPPINGS.get("mls", {})
|
||||
for sid, sinfo in mls_stadiums.items():
|
||||
if city.lower() in sinfo.city.lower() or sinfo.city.lower() in city.lower():
|
||||
stadium_id = sid
|
||||
break
|
||||
|
||||
team = Team(
|
||||
id=team_id,
|
||||
sport="mls",
|
||||
|
||||
@@ -589,7 +589,7 @@ class NBAScraper(BaseScraper):
|
||||
for abbrev in abbrevs:
|
||||
team_divisions[abbrev] = (conf, div)
|
||||
|
||||
for abbrev, (team_id, full_name, city) in TEAM_MAPPINGS.get("nba", {}).items():
|
||||
for abbrev, (team_id, full_name, city, stadium_id) in TEAM_MAPPINGS.get("nba", {}).items():
|
||||
if team_id in seen:
|
||||
continue
|
||||
seen.add(team_id)
|
||||
@@ -618,13 +618,6 @@ class NBAScraper(BaseScraper):
|
||||
# Get conference and division
|
||||
conf, div = team_divisions.get(abbrev, (None, None))
|
||||
|
||||
# Get stadium ID
|
||||
stadium_id = None
|
||||
for sid, sinfo in STADIUM_MAPPINGS.get("nba", {}).items():
|
||||
if city.lower() in sinfo.city.lower() or sinfo.city.lower() in city.lower():
|
||||
stadium_id = sid
|
||||
break
|
||||
|
||||
team = Team(
|
||||
id=team_id,
|
||||
sport="nba",
|
||||
|
||||
@@ -523,7 +523,7 @@ class NFLScraper(BaseScraper):
|
||||
for abbrev in abbrevs:
|
||||
team_divisions[abbrev] = (conf, div)
|
||||
|
||||
for abbrev, (team_id, full_name, city) in TEAM_MAPPINGS.get("nfl", {}).items():
|
||||
for abbrev, (team_id, full_name, city, stadium_id) in TEAM_MAPPINGS.get("nfl", {}).items():
|
||||
if team_id in seen:
|
||||
continue
|
||||
seen.add(team_id)
|
||||
@@ -535,14 +535,6 @@ class NFLScraper(BaseScraper):
|
||||
# Get conference and division
|
||||
conf, div = team_divisions.get(abbrev, (None, None))
|
||||
|
||||
# Get stadium ID
|
||||
stadium_id = None
|
||||
nfl_stadiums = STADIUM_MAPPINGS.get("nfl", {})
|
||||
for sid, sinfo in nfl_stadiums.items():
|
||||
if city.lower() in sinfo.city.lower() or sinfo.city.lower() in city.lower():
|
||||
stadium_id = sid
|
||||
break
|
||||
|
||||
team = Team(
|
||||
id=team_id,
|
||||
sport="nfl",
|
||||
|
||||
@@ -589,7 +589,7 @@ class NHLScraper(BaseScraper):
|
||||
for abbrev in abbrevs:
|
||||
team_divisions[abbrev] = (conf, div)
|
||||
|
||||
for abbrev, (team_id, full_name, city) in TEAM_MAPPINGS.get("nhl", {}).items():
|
||||
for abbrev, (team_id, full_name, city, stadium_id) in TEAM_MAPPINGS.get("nhl", {}).items():
|
||||
if team_id in seen:
|
||||
continue
|
||||
seen.add(team_id)
|
||||
@@ -604,14 +604,6 @@ class NHLScraper(BaseScraper):
|
||||
# Get conference and division
|
||||
conf, div = team_divisions.get(abbrev, (None, None))
|
||||
|
||||
# Get stadium ID
|
||||
stadium_id = None
|
||||
nhl_stadiums = STADIUM_MAPPINGS.get("nhl", {})
|
||||
for sid, sinfo in nhl_stadiums.items():
|
||||
if city.lower() in sinfo.city.lower() or sinfo.city.lower() in city.lower():
|
||||
stadium_id = sid
|
||||
break
|
||||
|
||||
team = Team(
|
||||
id=team_id,
|
||||
sport="nhl",
|
||||
|
||||
@@ -323,7 +323,7 @@ class NWSLScraper(BaseScraper):
|
||||
teams: list[Team] = []
|
||||
seen: set[str] = set()
|
||||
|
||||
for abbrev, (team_id, full_name, city) in TEAM_MAPPINGS.get("nwsl", {}).items():
|
||||
for abbrev, (team_id, full_name, city, stadium_id) in TEAM_MAPPINGS.get("nwsl", {}).items():
|
||||
if team_id in seen:
|
||||
continue
|
||||
seen.add(team_id)
|
||||
@@ -331,14 +331,6 @@ class NWSLScraper(BaseScraper):
|
||||
# Parse team name
|
||||
team_name = full_name
|
||||
|
||||
# Get stadium ID
|
||||
stadium_id = None
|
||||
nwsl_stadiums = STADIUM_MAPPINGS.get("nwsl", {})
|
||||
for sid, sinfo in nwsl_stadiums.items():
|
||||
if city.lower() in sinfo.city.lower() or sinfo.city.lower() in city.lower():
|
||||
stadium_id = sid
|
||||
break
|
||||
|
||||
team = Team(
|
||||
id=team_id,
|
||||
sport="nwsl",
|
||||
|
||||
@@ -323,7 +323,7 @@ class WNBAScraper(BaseScraper):
|
||||
teams: list[Team] = []
|
||||
seen: set[str] = set()
|
||||
|
||||
for abbrev, (team_id, full_name, city) in TEAM_MAPPINGS.get("wnba", {}).items():
|
||||
for abbrev, (team_id, full_name, city, stadium_id) in TEAM_MAPPINGS.get("wnba", {}).items():
|
||||
if team_id in seen:
|
||||
continue
|
||||
seen.add(team_id)
|
||||
@@ -332,14 +332,6 @@ class WNBAScraper(BaseScraper):
|
||||
parts = full_name.split()
|
||||
team_name = parts[-1] if parts else full_name
|
||||
|
||||
# Get stadium ID
|
||||
stadium_id = None
|
||||
wnba_stadiums = STADIUM_MAPPINGS.get("wnba", {})
|
||||
for sid, sinfo in wnba_stadiums.items():
|
||||
if city.lower() in sinfo.city.lower() or sinfo.city.lower() in city.lower():
|
||||
stadium_id = sid
|
||||
break
|
||||
|
||||
team = Team(
|
||||
id=team_id,
|
||||
sport="wnba",
|
||||
|
||||
Reference in New Issue
Block a user