From 545853ce3eae117c7576694ba6632f28547415bf Mon Sep 17 00:00:00 2001 From: Aaron Godfrey Date: Thu, 21 Dec 2023 15:39:17 -0800 Subject: [PATCH] Look for image url in multiple locations. Handle the event that it's not found more graceful. --- custom_components/nintendo_wishlist/eshop.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/custom_components/nintendo_wishlist/eshop.py b/custom_components/nintendo_wishlist/eshop.py index 8c08fa3..61c3167 100644 --- a/custom_components/nintendo_wishlist/eshop.py +++ b/custom_components/nintendo_wishlist/eshop.py @@ -179,7 +179,11 @@ async def _get_eu_page(self, page: int = 0) -> ResultsDict: def get_eu_switch_game(self, game: dict) -> SwitchGame: try: - image_url = game["image_url"] + image_url = game.get("image_url", "") + if not image_url: + image_url = game.get("image_url_sq_s", "") + if not image_url: + image_url = game.get("image_url_h2x1_s", "") if not image_url.startswith("https:"): image_url = f"https:{image_url}" return {