Added comments

This commit is contained in:
Yarne Coppens 2024-08-01 12:16:41 +02:00
parent 655b1b5cf0
commit d0fb364808

View file

@ -114,6 +114,7 @@ def convert_collection_xml_to_boardgame(boardgame_extra_info: BoardGame, collect
return boardgame return boardgame
#Creates list of board games from a collection '/collection' URL
def get_boardgames_from_collection_url(collection_url: str) -> list[BoardGame]: def get_boardgames_from_collection_url(collection_url: str) -> list[BoardGame]:
collection_xml = url_to_xml_object(collection_url) collection_xml = url_to_xml_object(collection_url)
@ -121,9 +122,11 @@ def get_boardgames_from_collection_url(collection_url: str) -> list[BoardGame]:
collection_id_list: list[int] = [] collection_id_list: list[int] = []
#Get all board game ID's from the collection
for boardgame_item in collection_xml: for boardgame_item in collection_xml:
collection_id_list.append(boardgame_item.get('objectid')) collection_id_list.append(boardgame_item.get('objectid'))
#Request extra info about the ID's
boardgame_extras = get_multiple_boardgames(collection_id_list) boardgame_extras = get_multiple_boardgames(collection_id_list)
assert len(boardgame_extras) == len(collection_xml) assert len(boardgame_extras) == len(collection_xml)