Skip to content

Commit

Permalink
Change SetList to contain everything except for booster data, cards, …
Browse files Browse the repository at this point in the history
…and tokens. (mtgjson#704)
  • Loading branch information
ZeldaZach authored Oct 18, 2020
1 parent 3adfcdb commit ce71853
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions mtgjson5/compiled_classes/mtgjson_set_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit ce71853

Please sign in to comment.