From 56f5d99b89f67609b5062d94d42ae365f14c8afd Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Wed, 15 Mar 2023 13:27:48 +0100 Subject: [PATCH] Remove non-games from Steam import --- src/utils/steam_parser.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/utils/steam_parser.py b/src/utils/steam_parser.py index 3d5a830..8debd29 100644 --- a/src/utils/steam_parser.py +++ b/src/utils/steam_parser.py @@ -100,6 +100,7 @@ def steam_parser(parent_widget, action): app["appid"]: app["data"]["appinfo"]["common"]["associations"]["0"]["name"] for app in apps if "common" in app["data"]["appinfo"] + and app["data"]["appinfo"]["common"]["type"] == "Game" and "associations" in app["data"]["appinfo"]["common"] and "0" in app["data"]["appinfo"]["common"]["associations"] } @@ -121,15 +122,17 @@ def steam_parser(parent_widget, action): ): continue + # If the developer is empty, it means that the app is not an actual game + try: + values["developer"] = developers[int(values["appid"])] + except KeyError: + continue + values["executable"] = "xdg-open steam://rungameid/" + values["appid"] values["hidden"] = False values["source"] = "steam" values["added"] = current_time values["last_played"] = 0 - try: - values["developer"] = developers[int(values["appid"])] - except KeyError: - pass if os.path.isfile( os.path.join(