diff --git a/data/external/scrapers/nat.py b/data/external/scrapers/nat.py index 46d8b0741..63cf5772c 100644 --- a/data/external/scrapers/nat.py +++ b/data/external/scrapers/nat.py @@ -22,6 +22,11 @@ def scrape_buildings(): logging.info("Scraping the buildings of the NAT") buildings = requests.get(f"{NAT_API_URL}/building", timeout=30).json() + # TODO: Remove if NAT does fix this.. TUM changed names in denazification initative + for building in buildings: + building["building_name"].replace("Bestelmeyer Süd", "Zentralgebäude 2") + building["building_name"].replace("Bestelmeyer Nord", "Zentralgebäude 7") + with open(CACHE_PATH / "buildings_nat.json", "w", encoding="utf-8") as file: json.dump(buildings, file, indent=2, sort_keys=True) diff --git a/data/external/scrapers/roomfinder.py b/data/external/scrapers/roomfinder.py index a116cff4b..013ac9254 100644 --- a/data/external/scrapers/roomfinder.py +++ b/data/external/scrapers/roomfinder.py @@ -83,6 +83,9 @@ class SearchResult(TypedDict): def _sanitise_room(room: dict) -> dict: for _map in room["maps"]: _map[1] = f"rf{_map[1]}" + # TODO: Remove if MyTUM does fix this.. TUM changed names in denazification initative + _map[3] = _map[3].replace("Bestelmeyer Nord", "Zentralgebäude 7") + _map[3] = _map[3].replace("Bestelmeyer Süd", "Zentralgebäude 2") if default_map := room["default_map"]: default_map[1] = f"rf{default_map[1]}" room["lat"], room["lon"] = _utm_to_latlon( @@ -95,6 +98,9 @@ def _sanitise_room(room: dict) -> dict: room["b_name"] = room["b_name"].replace("Bestelmeyer Süd", "Zentralgebäude 2") room["r_alias"] = room["r_alias"].replace("Gustav-Niemann-", "") room["r_alias"] = room["r_alias"].replace("EINGANGSHALLE FOYER BESTELMEYER", "") + for _map in room["maps"]: + _map[3] = _map[3].replace("Bestelmeyer Nord", "Zentralgebäude 7") + _map[3] = _map[3].replace("Bestelmeyer Süd", "Zentralgebäude 2") return room