PennyDreadfulMTG / Penny-Dreadful-Tools

A suite of tools for the Penny Dreadful MTGO community
https://pennydreadfulmagic.com
MIT License
39 stars 28 forks source link

Support types properly in search and elsewhere for Split cards, Adventure cards, MDFCs #7452

Open vorpal-buildbot opened 4 years ago

vorpal-buildbot commented 4 years ago

Reported on Discord by jgabrielygalan#7654

bakert commented 4 years ago
when i go to the "cards" section and use the filter to narrow down the card list, adventure cards do not show up
i know order of midnight has been used (Ive used it) but it doesnt come up
i tried just "t:adventure" and nothing came up, but it does when i go direct to scryfall
just means i keep missing out on adventure cards and their win% when i search

-- FadeToBlack1183

bakert commented 3 years ago

This is because the scryfall API returns "Order of Midnight // Alter Fate" for that card. Honestly that is garbage behavior as that is clearly not the cards name in the same way "Odds // Ends" is the name of that card. But we should cope. I fixed it in our Whoosh search but that won't affect the filter as it is done in javascript. We should check for layout=meld and layout=flip too as that's what's being accounted for in the python code.

bakert commented 3 years ago

This has been partially obsoleted by me breaking filter search in live tables.

bakert commented 2 years ago

This is now, "support t:adventure in find". We currently do not. Scryfall does.

bakert commented 2 months ago

You can workaround with layout:adventure but we want to match Scryfall's behavior.

We have names=Order of Midnight|Alter Fate and layout=adventure and mana_cost={1}{B}|{1}{B} in cards._cache_card but there isn't currently enough in there for it to work as a type. So either we alter how we store type for adventures or we make the behavior of type search special in the case of adventures. Probably the former? We need to treat it more like a split card/dfc and less like a normal card.

Looking into this makes me notice that we actually never split up a type_line. Not even for split cards where each side is a different type like Commit // Memory nor for mdfcs where the sides have different types like Agadeem's Awakening.

So this is probably a bigger change that makes "t:sorcery commit" return Commit // Memory like Scryfall does. And "awakening t:sorcery" return Agadeem's Awakening.

And then the bot, the card detail page, and probably other places, will need to cope with the fact that there might be a pipe in type_line the same as mana_cost and names.