Skip to content

Commit 783f023

Browse files
committed
CDNClient: Cope with longer manifest descriptions for some depots
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 <[email protected]>
1 parent 74e4292 commit 783f023

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

steam/client/cdn.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,12 @@ def async_fetch_manifest(
836836
else:
837837
manifest_gid = depot_info.get('manifests', {}).get(branch)
838838

839+
if isinstance(manifest_gid, dict):
840+
# For some depots, Steam has started returning a dict
841+
# {"public": {"gid": GID, "size": ..., "download": ...}, ...}
842+
# instead of a simple map {"public": GID, ...}
843+
manifest_gid = manifest_gid['gid']
844+
839845
if manifest_gid is not None:
840846
tasks.append(
841847
self.gpool.spawn(

0 commit comments

Comments
 (0)