From ce71853c04ca25cb525fa1c0d3219e78ef4324a6 Mon Sep 17 00:00:00 2001 From: Zach H Date: Sun, 18 Oct 2020 15:42:24 -0400 Subject: [PATCH] Change SetList to contain everything except for booster data, cards, and tokens. (#704) --- mtgjson5/compiled_classes/mtgjson_set_list.py | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/mtgjson5/compiled_classes/mtgjson_set_list.py b/mtgjson5/compiled_classes/mtgjson_set_list.py index 95f65a6c..34f3f2b2 100644 --- a/mtgjson5/compiled_classes/mtgjson_set_list.py +++ b/mtgjson5/compiled_classes/mtgjson_set_list.py @@ -40,25 +40,14 @@ def get_all_set_list(files_to_ignore: List[str]) -> List[Dict[str, str]]: continue with set_file.open(encoding="utf-8") as f: - file_content = json.load(f).get("data", {}) + set_data = json.load(f).get("data", {}) - if not file_content.get("name"): + if not set_data.get("name"): continue - set_data = { - "baseSetSize": file_content.get("baseSetSize"), - "code": file_content.get("code"), - "name": file_content.get("name"), - "releaseDate": file_content.get("releaseDate"), - "totalSetSize": file_content.get("totalSetSize"), - "type": file_content.get("type"), - } - - if "parentCode" in file_content.keys(): - set_data["parentCode"] = file_content["parentCode"] - - if "isPartialPreview" in file_content.keys(): - set_data["isPartialPreview"] = file_content["isPartialPreview"] + for key in ["booster", "cards", "tokens"]: + if key in set_data: + del set_data[key] all_sets_data.append(set_data)