From 507db6ac4138b4c17c1d6f3949b3a144e76521fa Mon Sep 17 00:00:00 2001 From: Yarne Coppens Date: Thu, 22 Aug 2024 10:18:23 +0200 Subject: [PATCH] Uncommented play retrieval block from bgg_connection for debugging --- src/modules/bgg_connection.py | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/modules/bgg_connection.py b/src/modules/bgg_connection.py index 0e524fa..fad6852 100644 --- a/src/modules/bgg_connection.py +++ b/src/modules/bgg_connection.py @@ -330,21 +330,15 @@ def get_plays() -> list[play_classes.Play]: all_plays : list[play_classes.Play] = [] - # for page in tqdm( - # range(amount_of_pages_needed), - # desc="Getting plays from BGG", - # unit="requests"): - # url = 'https://boardgamegeek.com/xmlapi2/plays?username={}&page={}'.format(auth_manager.username, page + 1) - # plays_page_xml_object = url_to_xml_object(url) - # for play_xml in plays_page_xml_object: - # new_play = convert_play_xml_to_play(play_xml) - # all_plays.append(new_play) - - url = 'https://boardgamegeek.com/xmlapi2/plays?username={}&page=1'.format(auth_manager.username) - plays_page_xml_object = url_to_xml_object(url) - for play_xml in plays_page_xml_object: - new_play = convert_play_xml_to_play(play_xml) - all_plays.append(new_play) + for page in tqdm( + range(amount_of_pages_needed), + desc="Getting plays from BGG", + unit="requests"): + url = 'https://boardgamegeek.com/xmlapi2/plays?username={}&page={}'.format(auth_manager.username, page + 1) + plays_page_xml_object = url_to_xml_object(url) + for play_xml in plays_page_xml_object: + new_play = convert_play_xml_to_play(play_xml) + all_plays.append(new_play) return all_plays