Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

steamutil: Force SteamApp game_name to string #439

Merged
merged 3 commits into from
Aug 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pupgui2/steamutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,18 +272,18 @@ def _get_steam_ctool_info(steam_config_folder: str) -> Dict[str, Dict[str, str]]
return ctool_map


def update_steamapp_info(steam_config_folder: str, steamapp_list: List[SteamApp]) -> List[SteamApp]:
def update_steamapp_info(steam_config_folder: str, steamapp_list: list[SteamApp]) -> list[SteamApp]:
"""
Get Steam game names and information for provided SteamApps
Return Type: List[SteamApp]
"""
appinfo_file = os.path.join(os.path.expanduser(steam_config_folder), '../appcache/appinfo.vdf')
appinfo_file = os.path.realpath(appinfo_file)
sapps = {app.get_app_id_str(): app for app in steamapp_list}
sapps: dict[str, SteamApp] = {app.get_app_id_str(): app for app in steamapp_list}
len_sapps = len(sapps)
cnt = 0
try:
ctool_map = _get_steam_ctool_info(steam_config_folder)
ctool_map: dict[str, dict[str, str]] = _get_steam_ctool_info(steam_config_folder)
with open(appinfo_file, 'rb') as f:
_, apps = parse_appinfo(f, mapper=dict)
for steam_app in apps:
Expand All @@ -296,7 +296,7 @@ def update_steamapp_info(steam_config_folder: str, steamapp_list: List[SteamApp]
# Example: {'0': {'src_os': 'windows', 'dest_os': 'linux', 'appid': 1826330, 'comment': 'EAC runtime'}}
app_additional_dependencies = app_appinfo.get('extended', {}).get('additional_dependencies', {})

a.game_name = app_appinfo_common.get('name', '')
a.game_name = str(app_appinfo_common.get('name', ''))
a.deck_compatibility = app_appinfo_common.get('steam_deck_compatibility', {})
for dep in app_additional_dependencies.values():
a.anticheat_runtimes[RuntimeType.EAC] = dep.get('appid', -1) == PROTON_EAC_RUNTIME_APPID
Expand Down