isFakeAccount / psnawp

PlayStation Network API Python
https://pypi.org/project/PSNAWP/
Other
108 stars 23 forks source link

Unsupported PlatformType #54

Closed joalisonx closed 1 year ago

joalisonx commented 1 year ago

Apparently, when I try to fetch a game that has a set of trophies shared between VITA and PS3, the wrapper gives me an error: ValueError: 'PS3,PSVITA' is not a valid PlatformType This game is Batman: Arkham Origins

isFakeAccount commented 1 year ago

@joalisonx Can you provide details on how to reproduce this error?

Also paste the full stack trace.

joalisonx commented 1 year ago

Sure. It also gives me the same error with PS Vita platform.

client = PSNAWP(get_env()["npsso"])
game = client.game_title(title_id="NPWR04151_00", np_communication_id="NPWR04151_00").trophy_groups_summary("PS3")
Traceback (most recent call last):
  File "/platinador/src/ext/find.py", line 26, in find
    game = get_game(game_id, platform)
  File "/platinador/src/utils/utils.py", line 35, in get_game
    raise err
  File "/platinador/src/utils/utils.py", line 26, in get_game
    game = client.game_title(title_id=game_id, np_communication_id=game_id).trophy_groups_summary(platform)
  File "/lib/python3.8/site-packages/psnawp_api/models/game_title.py", line 119, in trophy_groups_summary
    return TrophyGroupsSummaryBuilder(
  File "/lib/python3.8/site-packages/psnawp_api/models/trophies/trophy_group.py", line 162, in game_title_trophy_groups_summary
    return _trophy_groups_dict_to_obj(response)
  File "/lib/python3.8/site-packages/psnawp_api/models/trophies/trophy_group.py", line 99, in _trophy_groups_dict_to_obj
    trophy_title_platform=PlatformType(trophy_groups_dict.get("trophyTitlePlatform", "UNKNOWN")),
  File "/lib/python3.8/enum.py", line 304, in __call__
    return cls.__new__(cls, value)
  File "/lib/python3.8/enum.py", line 595, in __new__
    raise exc
  File "/lib/python3.8/enum.py", line 579, in __new__
    result = cls._missing_(value)
  File "/lib/python3.8/enum.py", line 608, in _missing_
    raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 'PS3,PSVITA' is not a valid PlatformType
isFakeAccount commented 1 year ago

This bug is fixed in version 1.3.2 https://github.com/isFakeAccount/psnawp/releases/tag/v1.3.2