mirror of
https://github.com/correl/mtgsqlive.git
synced 2024-11-21 19:18:41 +00:00
Fix errors causing data population to fail (#31)
* Modify card price reader to handle null price dictionaries (e.g. 10E Anaba Bodyguard) * Add support for undocumented `subtypes`, `supertypes`, and `types` fields on `tokens`.
This commit is contained in:
parent
9b18d52a5d
commit
6fa3063e7b
1 changed files with 8 additions and 4 deletions
|
@ -223,9 +223,12 @@ def build_sql_schema(output_file: Dict) -> None:
|
|||
"scryfallOracleId TEXT(36),",
|
||||
"setCode TEXT REFERENCES sets(code) ON UPDATE CASCADE ON DELETE CASCADE,",
|
||||
"side TEXT,",
|
||||
"subtypes TEXT,",
|
||||
"supertypes TEXT,",
|
||||
"text TEXT,",
|
||||
"toughness TEXT,",
|
||||
"type TEXT,",
|
||||
"types TEXT,",
|
||||
"uuid TEXT(36) UNIQUE,",
|
||||
"watermark TEXT",
|
||||
");",
|
||||
|
@ -494,10 +497,11 @@ def handle_price_rows(
|
|||
"""
|
||||
prices = []
|
||||
for price_type in card_data["prices"]:
|
||||
for date, price in card_data["prices"][price_type].items():
|
||||
prices.append(
|
||||
{"uuid": card_uuid, "type": price_type, "price": price, "date": date}
|
||||
)
|
||||
if(card_data["prices"][price_type] is not None):
|
||||
for date, price in card_data["prices"][price_type].items():
|
||||
prices.append(
|
||||
{"uuid": card_uuid, "type": price_type, "price": price, "date": date}
|
||||
)
|
||||
|
||||
return prices
|
||||
|
||||
|
|
Loading…
Reference in a new issue