Update for new card types, include default for missing card types

This commit is contained in:
Holly 2024-09-30 21:22:41 +00:00
parent ef858dbb8d
commit 9bfdb719c7
1 changed files with 7 additions and 2 deletions

View File

@ -187,7 +187,9 @@ class CardsObject(FoundationObject):
'augment': lambda num: self.scryfallJson['image_uris'],
'host': lambda num: self.scryfallJson['image_uris'],
'adventure': lambda num: self.scryfallJson['image_uris'],
'modal_dfc': lambda num: self.scryfallJson['card_faces'][num]['image_uris']
'modal_dfc': lambda num: self.scryfallJson['card_faces'][num]['image_uris'],
'prototype': lambda num: self.scryfallJson['image_uris'],
'case': lambda num: self.scryfallJson['image_uris'],
}
image_types = {
@ -199,7 +201,10 @@ class CardsObject(FoundationObject):
'border_crop': lambda d: d['border_crop']
}
images_dict = layouts.get(self.scryfallJson['layout'])
images_dict = layouts.get(
self.scryfallJson['layout'],
lambda num: self.scryfallJson['image_uris'], # Get default if missing
)
uri = image_types.get(image_type)