Skip to content

Commit

Permalink
Merge pull request #19 from Daanoz/fix/missing-key-error
Browse files Browse the repository at this point in the history
fix: missing key error when selecting albums
  • Loading branch information
Daanoz authored Apr 2, 2023
2 parents 1ac4782 + 76383aa commit 31b9f12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/google_photos/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ def get_albums() -> List[Album]:
albums = await self.hass.async_add_executor_job(get_albums)
album_selection = dict({CONF_ALBUM_ID_FAVORITES: "Favorites"})
for album in albums:
album_selection[album["id"]] = "{} ({} items)".format(
album["title"], album["mediaItemsCount"]
album_selection[album.get("id")] = "{0} ({1} items)".format(
album.get("title"), album.get("mediaItemsCount", "?")
)

return vol.Schema(
Expand Down

0 comments on commit 31b9f12

Please sign in to comment.