PokemonTCG / pokemon-tcg-api

Pokemon TCG API allows developers to easily consume Pokemon card and set data in JSON format.
63 stars 3 forks source link

Error in ptcgoCode in S&M Black Star Promos set #69

Closed r0adkll closed 6 years ago

r0adkll commented 6 years ago

The S&M BSP object returned in the /sets endpoint returns this:

{
    "code": "smp",
    "ptcgoCode": "PR-SM SM",
    "name": "SM Black Star Promos",
    "series": "Sun & Moon",
    "totalCards": 15,
    "standardLegal": true,
    "expandedLegal": true,
    "releaseDate": "02/03/2017",
    "symbolUrl": "https://images.pokemontcg.io/smp/symbol.png",
    "logoUrl": "https://images.pokemontcg.io/smp/logo.png"
}

Where the ptcgoCode returns PR-SM SM where it should just return PR-SM since the promos in that set have a number of SM30, SM31 so the SM on the end seems erroneous.

It also doesn't match other BSP sets (i.e. xyp, etc)

adback03 commented 6 years ago

Hmmm do you have a source for what these codes should be? In #13, it was called out that it was supposed to be "PR-SM SM".

r0adkll commented 6 years ago

This is based on my observations of the data that is returned by the API and the decklist formats that PTCGO is outputting.

For example, here is the line that PTCGO outputs for the Tapu Koko BSP

* 1 Tapu Koko PR-SM SM31

Then when I look up the same card from the API it returns this number in the object

{
    ...,
    "number": "SM31",
    ...
}

Then the set that is associated with that card, i.e. the S&M BSP set, it returns the following PTCGO code

{
    ...,
    "ptcgoCode": "PR-SM SM",
    ...
}

So if you are trying to generate a decklist to export to PTCGO and logically concatenate these values like you do for any other set/card combination you get:

PR-SM SMSM31

where it should be PR-SM SM31

Now other BSP sets don't include the promo number prefix in the ptcgoCode such as: xyp -> PR-XY.

This makes it more difficult for me to write a PTCGO importer/exporter as I would have to write a special case around this set to trim that trailing SM off

adback03 commented 6 years ago

Ahhh makes sense to me. I can make this update tonight.