Code Monkey home page Code Monkey logo

Comments (7)

Senryoku avatar Senryoku commented on August 15, 2024 1

It's a one-off script, I re-run it when a new set is released or when I make changes to the card "db" (just some json files) structure.
I generally run it with a argument so I didn't catch this problem, I just updated it.
You probably want to run it as python3 ./ManageCardData.py dl for first time to download the scryfall card data (warning: huge file)

The easiest way to fix this issue is probably to add some checks to the collection parsing (I assume that these duplicate cards are rare since they introduced card style since then, which doesn't cause the issue), not to edit the python script.

from draftmancer.

Senryoku avatar Senryoku commented on August 15, 2024 1

Yes, these alternate art cards have a different Arena ID than the "normal" cards but are otherwise identical. We need to list these arena ids, map them to the ids of the corresponding normal cards and add them as additional normal cards up to 4 copies (since we don't have the alternate arts in the db, and I don't think it's worth it to support them)

from draftmancer.

joesaraceno avatar joesaraceno commented on August 15, 2024

Do you have any instruction about this script? Is it meants to be used as a one-off script to seed the card data? or does the node application execute it on some interval? I've tried to run the script and ran into some issues, I think with some of the command line arguments not being defined:

python3 ./ManageCardData.py
Traceback (most recent call last):
  File "./ManageCardData.py", line 60, in <module>
    if not os.path.isfile(ManaSymbolsFile) or ForceSymbology:
NameError: name 'ForceSymbology' is not defined

is probably due to

if len(sys.argv) > 1:
    Arg = sys.argv[1].lower()
    ForceDownload = Arg == "dl"
    ForceExtract = ForceDownload or Arg == "extract"
    ForceCache = ForceExtract or Arg == "cache"
    ForceRatings = Arg == "ratings"
    ForceJumpstart = Arg == "jmp"
    ForceSymbology = Arg == "symb"

that conditional remaining false

from draftmancer.

joesaraceno avatar joesaraceno commented on August 15, 2024

where is the collection parsing located? inparseCardList.js?

from draftmancer.

Senryoku avatar Senryoku commented on August 15, 2024

parseMTGALog in App.js

from draftmancer.

joesaraceno avatar joesaraceno commented on August 15, 2024

ok, so some cards with alternate art will fail to be imported by the client parser, which is in App.js in the vue app?

from draftmancer.

joesaraceno avatar joesaraceno commented on August 15, 2024

I've got what appears to be a working solution to replace the arena ID of list of replacement keys to the cards collection json object.
They would look like this { 74519: 74520 } and are declared in some constant (maybe in the constants.json file for now)

I am investigating any breadcrumbs we can find to get on the trail of the exhaustive list of cards that need their ids squashed like this.
One lead so far: some of the listed cards are duplicated with this different flag in the schema. I can assume the \GR[0-9]\ flag to represent the masterpiece quality, because it's present on these three

"('Teferi, Hero of Dominaria', '207', 'dom')": 67518,
"('Teferi, Hero of Dominaria', 'GR6', 'dom')": 69451,
.....
"('Ral, Izzet Viceroy', '195', 'grn')": 68656,
"('Ral, Izzet Viceroy', 'GR5', 'grn')": 69449,
.....
"('Vraska, Golgari Queen', '213', 'grn')": 68674,
"('Vraska, Golgari Queen', 'GR8', 'grn')": 69450,

If you all can think of any other examples of cards Id which need to be replaced like this, or can think of another way I can find this information, please let me know.

from draftmancer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.