Allow to define a list of set_types to exclude (#303)

* add sets

* add comment

* No lowercase transformation
This commit is contained in:
tooomm 2024-02-10 15:00:13 +01:00 committed by GitHub
parent c7a7a66523
commit 0efd986a16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -526,10 +526,15 @@ def get_spoiler_sets() -> List[Dict[str, str]]:
return [] return []
spoiler_sets = [] spoiler_sets = []
# Find list of possible Set Types to exclude here: https://scryfall.com/docs/api/sets
excluded_set_types = ["alchemy", "masterpiece", "arsenal", "from_the_vault", "spellbook", "premium_deck", "duel_deck",
"draft_innovation", "treasure_chest", "planechase", "archenemy", "vanguard", "box", "promo",
"token", "memorabilia", "minigame"]
for sf_set in sf_sets["data"]: for sf_set in sf_sets["data"]:
if ( if (
sf_set["released_at"] >= time.strftime("%Y-%m-%d %H:%M:%S") sf_set["released_at"] >= time.strftime("%Y-%m-%d %H:%M:%S")
and sf_set["set_type"] != "token" and sf_set["set_type"] not in excluded_set_types
and sf_set["card_count"] and sf_set["card_count"]
): ):
sf_set["code"] = sf_set["code"].upper() sf_set["code"] = sf_set["code"].upper()