From b456f8114900b3bed83f9c2732855e870eef1f91 Mon Sep 17 00:00:00 2001 From: Jozen Blue Martinez Date: Sun, 13 Oct 2024 08:21:16 +0800 Subject: [PATCH] CI: fix Steam appid check (#148) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * CI: fix Steam appid comparison It was reversed 🙃 * CI: return set from get_valid_appids --- .github/scripts/check_gamefixes.py | 7 +++---- .github/scripts/steam_client.py | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/scripts/check_gamefixes.py b/.github/scripts/check_gamefixes.py index 79ddc6b..d88ef57 100644 --- a/.github/scripts/check_gamefixes.py +++ b/.github/scripts/check_gamefixes.py @@ -37,10 +37,9 @@ def check_steamfixes(project: Path) -> None: appids = {int(x) for x in appids} steam_appids = steam.get_valid_appids(appids) - - for appid in steam_appids: - if appid not in appids: - invalid_appids.add(appid) + + # If an ID doesn't exist in the Steam result then it's invalid + invalid_appids.update(appids - steam_appids) if invalid_appids: err = f'The following Steam app ids are invalid: {invalid_appids}' diff --git a/.github/scripts/steam_client.py b/.github/scripts/steam_client.py index fa221dd..c1095b6 100644 --- a/.github/scripts/steam_client.py +++ b/.github/scripts/steam_client.py @@ -41,7 +41,7 @@ def handle_after_logon() -> None: client.anonymous_login() - def get_valid_appids(self, appids: set[int]) -> list[int]: + def get_valid_appids(self, appids: set[int]) -> set[int]: """Queries Steam for the specified appids. If an appid doesn't exist, it won't be in the response. @@ -63,6 +63,6 @@ def get_valid_appids(self, appids: set[int]) -> list[int]: raise ValueError(err) data = proto_to_dict(resp) - appids = [app['appid'] for app in data['apps']] + appids = {app['appid'] for app in data['apps']} - return appids \ No newline at end of file + return appids