OpenXbox / xbox-webapi-python

A python library to authenticate with Xbox Live via your Microsoft Account and provides Xbox related Web-API.
https://pypi.python.org/pypi/xbox-webapi
MIT License
176 stars 45 forks source link

Gamestats "stats_fields" #4

Closed kufhjer closed 6 years ago

kufhjer commented 6 years ago

The gamestats batch feature is working great, but I am missing data, I am trying to figure out the "stats_field" params to get "MinutesPlayed" for a game.

post_data = { 'arrangebyfield': 'xuid', 'groups': [ { 'name': 'Hero', 'titleId': int(title_id) } ], 'stats': [dict(name=stat, titleId=int(title_id)) for stat in stats_fields], 'xuids': [str(xid) for xid in xuids] }

tuxuser commented 6 years ago

Just use https://github.com/OpenXbox/xbox-webapi-python/commit/eb417533658dca23e130e9ffb2ff56c22ae88b92#diff-7577e603200d42ab26c03471a0120ebdR13 by title id ;) It just returns the single field "MinutesPlayed" .. but thats what you want, right ?

for batch it does not respect the requested field for whatever reason.

EDIT: Nevermind, I did shit, reverted the change - You can do one batch call tho... get the scid that way.. then use it to do "get_stats" and get the remaining field

tuxuser commented 6 years ago

Can I close this issue? Got it solved?

kufhjer commented 6 years ago

Sorry for the late response, this is solved.