@@ -41,13 +41,15 @@ def get_player_count(self, app_id, timeout=5):
4141 else :
4242 return EResult (resp .eresult )
4343
44- def get_product_info (self , apps = [], packages = [], auto_access_tokens = True , timeout = 15 ):
44+ def get_product_info (self , apps = [], packages = [], meta_data_only = False , auto_access_tokens = True , timeout = 15 ):
4545 """Get product info for apps and packages
4646
4747 :param apps: items in the list should be either just ``app_id``, or :class:`dict`
4848 :type apps: :class:`list`
4949 :param packages: items in the list should be either just ``package_id``, or :class:`dict`
5050 :type packages: :class:`list`
51+ :param meta_data_only: only meta data will be returned in the reponse (e.g. change number, missing_token, sha1)
52+ :type meta_data_only: :class:`bool`
5153 :param auto_access_token: automatically request and fill access tokens
5254 :type auto_access_token: :class:`bool`
5355 :return: dict with ``apps`` and ``packages`` containing their info, see example below
@@ -124,7 +126,9 @@ def get_product_info(self, apps=[], packages=[], auto_access_tokens=True, timeou
124126 else :
125127 package_info .packageid = package
126128
127- message .body .meta_data_only = False
129+ message .body .meta_data_only = meta_data_only
130+ message .body .num_prev_failed = 0
131+ message .body .supports_package_tokens = 1
128132
129133 job_id = self .send_job (message )
130134
@@ -136,11 +140,26 @@ def get_product_info(self, apps=[], packages=[], auto_access_tokens=True, timeou
136140 chunk = chunk [0 ].body
137141
138142 for app in chunk .apps :
139- data ['apps' ][app .appid ] = vdf .loads (app .buffer [:- 1 ].decode ('utf-8' , 'replace' ))['appinfo' ]
143+ if app .buffer :
144+ data ['apps' ][app .appid ] = vdf .loads (app .buffer [:- 1 ].decode ('utf-8' , 'replace' ))['appinfo' ]
145+ else :
146+ data ['apps' ][app .appid ] = {}
147+
140148 data ['apps' ][app .appid ]['_missing_token' ] = app .missing_token
149+ data ['apps' ][app .appid ]['_change_number' ] = app .change_number
150+ data ['apps' ][app .appid ]['_sha' ] = app .sha
151+ data ['apps' ][app .appid ]['_size' ] = app .size
152+
141153 for pkg in chunk .packages :
142- data ['packages' ][pkg .packageid ] = vdf .binary_loads (pkg .buffer [4 :]).get (str (pkg .packageid ), {})
154+ if pkg .buffer :
155+ data ['packages' ][pkg .packageid ] = vdf .binary_loads (pkg .buffer [4 :]).get (str (pkg .packageid ), {})
156+ else :
157+ data ['packages' ][pkg .packageid ] = {}
158+
143159 data ['packages' ][pkg .packageid ]['_missing_token' ] = pkg .missing_token
160+ data ['packages' ][pkg .packageid ]['_change_number' ] = pkg .change_number
161+ data ['packages' ][pkg .packageid ]['_sha' ] = pkg .sha
162+ data ['packages' ][pkg .packageid ]['_size' ] = pkg .size
144163
145164 if not chunk .response_pending :
146165 break
0 commit comments