Skip to content

Commit

Permalink
fix otj bonus sheets and fix for when parentheses are used
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePieBandit committed Jun 19, 2024
1 parent e3b2ad9 commit c0d3d4d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/replacements.config
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ The Brothers' War: Retro Frame Artifacts=The Brothers' War Retro Artifacts
March of the Machine: Multiverse Legends=Multiverse Legends
Promo Pack: Kamigawa: Neon Dynasty=Promo Pack: Kamigawa: Neon Dynasty
XLN Treasure Chest=Black Friday Treasure Chest Promos
Outlaws of Thunder Junction: Breaking News=Breaking News
Outlaws of Thunder Junction: The Big Score=The Big Score

[NAMES]
;; Crimson Vow Alternative Art
Expand Down
18 changes: 10 additions & 8 deletions src/tcg-to-deckbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,24 +142,28 @@ def process_row(row, writer, config_parser):
# For BFZ lands...there's no differentiator from the full arts and the non-full arts.
row["Name"] = row["Name"].replace(" - Full Art", "")

# Handle Special cases of Parentheses
# War of the Spark Alternate Arts handled differently
if "(JP Alternate Art)" in row["Name"] and row["Edition"] == "War of the Spark":
row["Edition"] = "War of the Spark Japanese Alternate Art"
row["Name"] = row["Name"].replace(" (JP Alternate Art)", "")

if row["Name"] in scryfall_bab_data and row["Edition"] == "Buy-A-Box Promos":
if "Promos" in scryfall_bab_data[row["Name"]]:
row["Edition"] = "Media Inserts"
else:
row["Edition"] = scryfall_bab_data[row["Name"]]

# Handle Mystery Booster Test Cards, the 2021 release differentiates by Edition
# on deckbox, while tcg player differentiates by name appending '(No PW Symbol)'
if (
"(No PW Symbol)" in row["Name"]
and row["Edition"] == "Mystery Booster: Convention Edition Exclusives"
):
row["Edition"] = "Mystery Booster Playtest Cards 2021"

# Remove all Parentheses still at the end of cards
row["Name"] = re.sub(r" \(.*\)", "", row["Name"])

if row["Name"] in scryfall_bab_data and row["Edition"] == "Buy-A-Box Promos":
if "Promos" in scryfall_bab_data[row["Name"]]:
row["Edition"] = "Media Inserts"
else:
row["Edition"] = scryfall_bab_data[row["Name"]]

####################################################################
# Handle General Card Conversions
Expand All @@ -169,8 +173,6 @@ def process_row(row, writer, config_parser):
# TODO The List Reprints -> The List
# TODO remove "- Thick Stock"

# Remove all Parentheses at the end of cards
row["Name"] = re.sub(r" \(.*\)", "", row["Name"])
replace_strings(row, config_parser, "NAMES", "Name")

# We need to do a little extra work on dual faced cards, because deckbox is inconsistent with whether it
Expand Down

0 comments on commit c0d3d4d

Please sign in to comment.