achievements-app / psn-api

A JavaScript library that lets you get trophy, user, and game data from the PlayStation Network.
https://psn-api.achievements.app
MIT License
253 stars 29 forks source link

Wrong User Thin Trophy type returned from getUserTrophiesEarnedForTitle() #138

Open TheYuriG opened 1 year ago

TheYuriG commented 1 year ago

Was wondering why i couldn't get the PS5 trophy progress from users and it was because the type specified was wrong. Below you can see what is actually returned with this method, instead of User Thin Trophy.

{
    "trophyId": 52,
    "trophyHidden": true,
    "earned": false,
    "progress": "416", // PS5 exclusive, on trophies that have tracking
    "progressRate": 89, // PS5 exclusive, on trophies that have tracking
    "progressedDateTime": "2023-01-23T09:04:57Z", // PS5 exclusive, on trophies that have tracking
    "trophyType": "gold",
    "trophyRare": 1,
    "trophyEarnedRate": "8.3"
}

This is for the game Forspoken: NPWR21656_00

I assume User Thin Trophy is just what gets returned from getTitleTrophies(), with the added earned and earnedDateTime, since I was never able to find any trophies that returned the properties trophyProgressTargetValue, trophyRewardImageUrl or trophyRewardName, but maybe I just didn't look on the right games.

Maybe this is Sony's PS5 exclusives only? Or are they only from getTitleTrophies() and unrelated to getUserTrophiesEarnedForTitle()?

If you are not in a hurry, you can assign me to do this PR since fixing this could be done basically at the same time I wrap up my pending PR.

wescopeland commented 1 year ago

Hi @TheYuriG ,

I won't have a chance to take a look at this until later this week. If you'd like to take a stab you are more than welcome to. If not, I will try to investigate around Wednesday or Thursday.

TheYuriG commented 1 year ago

Access Denied

Seems like you are doing something wrong with the authentication endpoint, which is unrelated to this issue.

Maybe go though the documentation again and make sure you are following the steps correctly and open a separate issue if that still doesn't. I've logged in just fine yesterday.