FriendsOfGalaxy/galaxy-integration-psn

I think new version is not grabbing all games with new getPurchasedGameList api due to missing Start and Size values in variables param

joyrider3774 opened this issue · 9 comments

Describe the bug
I had installed the latest version of the integration but it did not seem grab all my playstation games.
From what i can see this url here https://github.com/FriendsOfGalaxy/galaxy-integration-psn/blob/master/src/psn_client.py#L15 it is missing "size":X,"start":Y" variables, if those are omitted the api only returns 50 games

the Size parameter is the amount of json (game) values to return (default 24) the Start param is the offset from where to start

I tried in a browser to add 2500 for size and start =0 and it rerturned all my games in one call. But we probably should not do that.

I did see some paginate parameters being added to the url here (here https://github.com/FriendsOfGalaxy/galaxy-integration-psn/blob/master/src/http_client.py#L23) but i'm not sure they are used correctly with the getPurchasedGameList if the variables parameter does not contain Size & Start values. And that might explain why not all my games were returned because as far as i could see the plugin does not use these values and then only 50 games are rerturned

For example when looking in my chrome browser on the webstore i see the following is happening

first call:
web.np.playstation.com/api/graphql/v1/op?operationName=getPurchasedGameList&variables={"isActive":true,"platform":["ps4","ps5"],"size":24,"start":0,"sortBy":"ACTIVE_DATE","sortDirection":"desc","subscriptionService":"NONE"}&extensions={"persistedQuery":{"version":1,"sha256Hash":"2c045408b0a4d0264bb5a3edfed4efd49fb4749cf8d216be9043768adff905e2"}}

2nd call
web.np.playstation.com/api/graphql/v1/op?operationName=getPurchasedGameList&variables={"isActive":true,"platform":["ps4","ps5"],"size":24,"start":24,"sortBy":"ACTIVE_DATE","sortDirection":"desc","subscriptionService":"NONE"}&extensions={"persistedQuery":{"version":1,"sha256Hash":"2c045408b0a4d0264bb5a3edfed4efd49fb4749cf8d216be9043768adff905e2"}}
load more games:

3rd call:
web.np.playstation.com/api/graphql/v1/op?operationName=getPurchasedGameList&variables={"isActive":true,"platform":["ps4","ps5"],"size":24,"start":48,"sortBy":"ACTIVE_DATE","sortDirection":"desc","subscriptionService":"NONE"}&extensions={"persistedQuery":{"version":1,"sha256Hash":"2c045408b0a4d0264bb5a3edfed4efd49fb4749cf8d216be9043768adff905e2"}}
load more games:

keep an eye on size & start parameters. This keeps going until all games are fetched.

You can increase the sizes (i have played with that and the api accepts it) but if you just call url below (as the plugin does) without those start and size values present it will only grab 50 games

web.np.playstation.com/api/graphql/v1/op?operationName=getPurchasedGameList&variables={"isActive":true,"platform":["ps4","ps5"],"sortBy":"ACTIVE_DATE","sortDirection":"desc","subscriptionService":"NONE"}&extensions={"persistedQuery":{"version":1,"sha256Hash":"2c045408b0a4d0264bb5a3edfed4efd49fb4749cf8d216be9043768adff905e2"}}

PS: i tested all this in browser because plugin would not work anymore after disconnecting it when it was working with the new version

PPS: i also saw this url https://github.com/FriendsOfGalaxy/galaxy-integration-psn/blob/master/src/psn_client.py#L20 uses LIMIT:50 (default what sony also uses) but from my testing you can set limit to 100 & get the last 100 recently played games. Starting from 101 the api throws an error

To Reproduce
Have more than 50 games purchased, sync games and check nr of games from getPurchasedGameList it will only contain about 50 games in total

Expected behavior
for it to grab all my 379 purchased games which it does not seem to do so currently

Attached logs
don't have logs as i can't make the plugin authenticate again after disconnecting it once after it was working

This seems consistent with my suspicions reported here: #25 (comment)

I've just synced up the games, and it seems like I'm missing PS4 games that I've bought/played earlier than some time around mid 2019. I'm missing all the 'bangers' I've started my PS4 journey with back in 2018 - games like Spider-Man, Uncharted 1-4, The Last of Us, etc. It seems like that's the only pattern I've found - there's no obvious disc vs physical, PS4 vs PS5, PS+ vs owned problems.

I'm also missing a few games like Assassin's creed Origin, Final Fantasy XV, Fruit Ninja VR and a few more.

I'm also missing a few games like Assassin's creed Origin, Final Fantasy XV, Fruit Ninja VR and a few more.

if you erased your previous connection before using this, how many games does it display in total ? i got a feeling it can never grab more than 100 with the current version (50 from recently played and 50 from getpurchased api due to what i explained above)

At the moment it grabs 83 games out of 100+ I own.

At the moment it grabs 83 games out of 100+ I own.

Have you been using any apps or played demos recently to make up for missing 17 (out of 100 assumed to be downloaded)?

Thanks @joyrider3774 you're right. I'm working on this.

Fix was released in 0.35 version. Check it out!

all working fine now, thanks again

Yep, looks okay for me too :).