Skip to content

Commit

Permalink
made shure that the downloaded files are consistently sorted for bett…
Browse files Browse the repository at this point in the history
…er reviewability
  • Loading branch information
CommanderStorm committed Oct 28, 2022
1 parent aed3c0f commit a1b8929
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions data/external/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def roomfinder_rooms():
print(".", end="", flush=True)
print("")

rooms.sort(key=lambda r: r["r_id"])
_write_cache_json(cache_name, rooms)
return rooms

Expand Down Expand Up @@ -173,6 +174,7 @@ def roomfinder_maps():
else:
used_maps[_map[1]] = ("building", building_entity["b_id"], _map)
maps = _download_maps(used_maps)
maps.sort(key=lambda m: m["id"])

# Not all maps are used somewhere.
# TODO: Download the rest
Expand Down Expand Up @@ -359,6 +361,7 @@ def tumonline_rooms():
rooms.append(room_index[room["roomcode"]])
usage_id += 1

rooms.sort(key=lambda r: r["list_index"])
_write_cache_json(cache_name, rooms)
return rooms

Expand Down

0 comments on commit a1b8929

Please sign in to comment.