Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported PlatformType #54

Closed
joalisonx opened this issue Sep 1, 2023 · 3 comments
Closed

Unsupported PlatformType #54

joalisonx opened this issue Sep 1, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@joalisonx
Copy link

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
Copy link
Owner

isFakeAccount commented Sep 2, 2023

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

Also paste the full stack trace.

@joalisonx
Copy link
Author

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 isFakeAccount added the bug Something isn't working label Sep 3, 2023
@isFakeAccount
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants