feat(csec, csfc, csgc, cs4ac, cs4bc): fix CSEC, CSFC, CSGC, CS4aC, CS4bC missing abilities

main
beiyanpiki 11 months ago
parent 5f9ec9956a
commit 9985b5c6e6

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -218,8 +218,15 @@ def get_pokemon_attr(card) -> PokemonAttr:
stage = get_stage(card)
hp = card['details']['hp']
ability = (card['details'].get('featureName', None), card['details'].get('featureText', None))
if ability[0] is not None:
if 'featureName' in card['details'] and 'featureText' in card['details']:
ability = (card['details'].get('featureName', None), card['details'].get('featureText', None))
# After CSEC, Raw data change it ability structure
elif 'cardFeatureItemList' in card['details']:
ability = (card['details']['cardFeatureItemList'][0]['featureName'],
card['details']['cardFeatureItemList'][0]['featureDesc'])
else:
ability = None
if ability is not None:
ability = Ability(ability[0], ability[1])
else:
ability = None

Loading…
Cancel
Save