From 82dddd1c5cc29584eb35ae33d57c29eb342ac0f1 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Thu, 20 Jul 2023 19:52:59 +0200 Subject: [PATCH] Skip missing hidden key --- src/importer/sources/heroic_source.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/importer/sources/heroic_source.py b/src/importer/sources/heroic_source.py index d82b111..378c3b3 100644 --- a/src/importer/sources/heroic_source.py +++ b/src/importer/sources/heroic_source.py @@ -20,19 +20,19 @@ import json import logging +from abc import abstractmethod from hashlib import sha256 from json import JSONDecodeError from pathlib import Path from time import time -from typing import Optional, TypedDict, Iterable -from abc import abstractmethod +from typing import Iterable, Optional, TypedDict from src import shared from src.game import Game from src.importer.sources.location import Location from src.importer.sources.source import ( - SourceIterationResult, SourceIterable, + SourceIterationResult, URLExecutableSource, ) @@ -311,9 +311,10 @@ class HeroicSourceIterable(SourceIterable): # Get the hidden app names try: store = path_json_load(self.source.config_location["store_config.json"]) - self.hidden_app_names = { - game["appName"] for game in store["games"]["hidden"] - } + if "hidden" in store["games"].keys(): + self.hidden_app_names = { + game["appName"] for game in store["games"]["hidden"] + } except (OSError, JSONDecodeError, KeyError, TypeError) as error: logging.error("Invalid Heroic store file", exc_info=error) raise InvalidStoreFileError() from error