Skip to content

Commit

Permalink
CDNClient: Cope with longer manifest descriptions for some depots
Browse files Browse the repository at this point in the history
Some depots now have a dict like {"public": {"gid": GID, ...}, ...}
where we would traditionally have seen a flat dict {"public": GID, ...}.
Not all depots have this: at the time of writing,
1628350 "Steam Linux Runtime - Sniper" does, but
1391110 "Steam Linux Runtime - Soldier" does not. Presumably this is a
change that is being rolled out gradually to let the Steam client give
better estimates of the size of a depot.

Cope with either format, by retrieving the gid field if the nested dict
is present.

Resolves: ValvePython#436
Signed-off-by: Simon McVittie <smcv@collabora.com>
  • Loading branch information
smcv committed May 5, 2023
1 parent 74e4292 commit 783f023
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions steam/client/cdn.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,12 @@ def async_fetch_manifest(
else:
manifest_gid = depot_info.get('manifests', {}).get(branch)

if isinstance(manifest_gid, dict):
# For some depots, Steam has started returning a dict
# {"public": {"gid": GID, "size": ..., "download": ...}, ...}
# instead of a simple map {"public": GID, ...}
manifest_gid = manifest_gid['gid']

if manifest_gid is not None:
tasks.append(
self.gpool.spawn(
Expand Down

0 comments on commit 783f023

Please sign in to comment.