mirror of
https://github.com/Cockatrice/Magic-Spoiler.git
synced 2026-03-21 17:54:59 -05:00
simplify as api guarantees existance
``` Card Face Objects Multiface cards have a card_faces property containing at least two Card Face objects. ``` See https://scryfall.com/docs/api/cards
This commit is contained in:
parent
6a14f8889e
commit
10aceba7a9
|
|
@ -213,9 +213,8 @@ def scryfall2mtgjson(scryfall_cards: List[Dict[str, Any]]) -> List[Dict[str, Any
|
|||
for sf_card in composed_sf_cards:
|
||||
super_types, types, sub_types = build_types(sf_card)
|
||||
|
||||
card_faces = sf_card.get("card_faces")
|
||||
if card_faces and isinstance(card_faces, list) and len(card_faces) > 0:
|
||||
image = card_faces[0].get("image_uris", {}).get("normal", "")
|
||||
if "card_faces" in sf_card:
|
||||
image = sf_card["card_faces"][0].get("image_uris", {}).get("normal", "")
|
||||
else:
|
||||
image = sf_card.get("image_uris", {}).get("normal", "")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user