Skip to content

Commit

Permalink
Look for image url in multiple locations.
Browse files Browse the repository at this point in the history
Handle the event that it's not found more graceful.
  • Loading branch information
boralyl committed Dec 21, 2023
1 parent dd0efab commit 545853c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/nintendo_wishlist/eshop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 545853c

Please sign in to comment.