Included expansions in collection retrieval

This commit is contained in:
Yarne Coppens 2024-08-01 11:10:48 +02:00
parent cfff61853a
commit 03936192fa

View file

@ -10,7 +10,7 @@ authenticated_session: requests.Session = requests.Session()
def url_to_xml_object(url: HttpUrl) -> ET.Element:
r = authenticated_session.get(url)
assert r.status_code == 200, "Got {} status code".format(r.status_code)
assert r.status_code == 200 or r.status_code == 202, "Got {} status code".format(r.status_code)
root = ET.fromstring(r.content)
return root
@ -139,7 +139,7 @@ def get_boardgames_from_collection_url(collection_url: str) -> list[BoardGame]:
return collection_list
def get_user_owned_collection() -> list[BoardGame]:
url = 'https://boardgamegeek.com/xmlapi2/collection?username={}&own=1&stats=1&excludesubtype=boardgameexpansion&showprivate=1&version=1'.format(auth_manager.username)
url = 'https://boardgamegeek.com/xmlapi2/collection?username={}&own=1&stats=1&showprivate=1&version=1'.format(auth_manager.username)
owned_boardgames = get_boardgames_from_collection_url(url)
return owned_boardgames