Better heroic store file parsing

This commit is contained in:
GeoffreyCoulaud
2023-07-22 00:04:02 +02:00
parent b1992a9466
commit fbf076660d

View File

@@ -307,11 +307,14 @@ class HeroicSourceIterable(SourceIterable):
# Get the hidden app names # Get the hidden app names
try: try:
store = path_json_load(self.source.config_location["store_config.json"]) store = path_json_load(self.source.config_location["store_config.json"])
if "hidden" in store["games"].keys(): self.hidden_app_names = {
self.hidden_app_names = { app_name
game["appName"] for game in store["games"]["hidden"] for game in store["games"]["hidden"]
} if (app_name := game.get("appName")) is not None
except (OSError, JSONDecodeError, KeyError, TypeError) as error: }
except KeyError:
logging.warning('No ["games"]["hidden"] key in Heroic store file')
except (OSError, JSONDecodeError, TypeError) as error:
logging.error("Invalid Heroic store file", exc_info=error) logging.error("Invalid Heroic store file", exc_info=error)
raise InvalidStoreFileError() from error raise InvalidStoreFileError() from error