From dd0efab9fc191b994ff82bb5bafe23fa7564ff8c Mon Sep 17 00:00:00 2001 From: Aaron Godfrey Date: Mon, 19 Jun 2023 15:01:32 -0700 Subject: [PATCH] Fix awaiting results for North America. --- custom_components/nintendo_wishlist/eshop.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/nintendo_wishlist/eshop.py b/custom_components/nintendo_wishlist/eshop.py index 3d7cb73..8c08fa3 100644 --- a/custom_components/nintendo_wishlist/eshop.py +++ b/custom_components/nintendo_wishlist/eshop.py @@ -136,9 +136,10 @@ async def _get_page( query_params: str = f"{params}&page={page_num}" queries[0]["params"] = query_params data = await client.multiple_queries_async(queries) - games = [r for r in data["results"][0]["hits"]] + all_results = await data + games = [r for r in all_results["results"][0]["hits"]] result["games"] = self.filter_wishlist_matches(games) - result["num_pages"] = data["results"][0]["nbPages"] + result["num_pages"] = all_results["results"][0]["nbPages"] return result async def fetch_na(self) -> dict[int, SwitchGame]: