mirror of
https://github.com/Cockatrice/Magic-Spoiler.git
synced 2026-08-28 12:25:26 -05:00
fix key error
This commit is contained in:
@@ -213,12 +213,9 @@ 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)
|
||||
|
||||
if "//" in sf_card.get("name", ""):
|
||||
image = (
|
||||
sf_card["card_faces"][0]
|
||||
.get("image_uris", {})
|
||||
.get("normal", "")
|
||||
)
|
||||
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", "")
|
||||
else:
|
||||
image = sf_card.get("image_uris", {}).get("normal", "")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user