Closed axxroytovu closed 1 year ago
There's a lot of promo cards matching is:boosterfun
query. Also Contraption.
I'm also not sure why t:attraction doesn't match is:borderless.
So we probably need to define what's "boosterfun" a bit better than this.
Fair.
Are there any other conditions you can think of?
Updated with more rigorous logic.
If the rules are really complicated, any chance we could maybe get mtgjson to maintain that data for us?
I have an open issue over there, and I can ask. In the mean time I'll look for another logic solution.
The specific logic problems I'm running into is that there are always exceptions to whatever rule I can come up with to filter the sets.
These always hold no matter what:
set.types.include("booster")
set.release_date > Date.new(2019, 10, 3)
All sets that have set.types.include?("standard")
or set.types.include?("modern")
have boosterfun.
But these filters have exceptions:
set.types.include?("funny")
- CMB1 and CMB2 do not have boosterfun, but UNF doesset.types.include?("masterpiece")
- STA does not have boosterfun, but BRR doesset.types.include?("masters")
is 50/50. MB1, MB2, and TSR don't have booster fun, but DMR, 2XM and 2X2 doOk, I just discovered that mtgjson has a "promoTypes": ["boosterfun"]
for cards that count as boosterfun. How can we incorporate that into the indexer?
This version:
If mtgjson is doing this, we should probably do support them all https://github.com/taw/magic-search-engine/issues/171
So we have is:boosterfun
now, basically card.promo_types.include?("boosterfun")
.
Is this returning what we want, or we want some different query?
(no has:booosterfun
yet)
Sort of. I had a go seeing if I could make it work with the current setup and I don't think I can. This is the best I could do for a "rare" sheet:
rare:
any:
- query: "r:r promo:boosterfun -is:foilonly -frame:extendedart"
rate: 1
- query: "r:r alt:(e:{set} promo:boosterfun -is:foilonly -frame:extendedart)"
rate: 2
- query: "r:r -alt:(e:{set} promo:boosterfun -is:foilonly -frame:extendedart)"
rate: 3
If we did build a has:boosterfun
using the current promo rules, it wouldn't work. It would also flag cards that only have foil or extended art treatments.
It's also just really clunky, and because the set code needs to be inside the alt tag I can't make this a sheet on the "common.yaml" file. Each booster would need their own sheet which defeats the point of the common sheets entirely.
Also, none of this currently works because the base query requires "is:booster," but that's a separate issue.
This definition of a rare isn't too bad.
Some kind of {set}
expansion inside queries would be straightforward, I just need to pick syntax that won't conflict with other query syntax. Then it could just be some complicated definition in common.yaml
, and in booster definition just:
rare:
use: rare_with_boosterfun
Would that be enough?
The first -is:foilonly
is redundant as every foil and nonfoil query automatically does the right checks, but the ones in alt:
are not redundant, so that's not saving much, and it might be more clear to be redundant here.
is:booster
though indexer rules made a lot of sense back when cards beyond max were just for planeswalker decks, buy-a-box promos etc., and mtgjson was obsessed with including every single misprint etc. It's a bit clunky system since boosterfun, but I'm not sure other ways are better.
If promo:boosterfun -is:foilonly -frame:extendedart
appears in a lot of queries we could give it some name (is:/has:draftboosterfun
or something? ugh).
Yeah I don't much like draftboosterfun
either but I don't have any better ideas.
It might make more sense to have rare
and rare_no_boosterfun
instead, since the "default" now is to include boosterfun treatments. The only time you don't have boosterfun in a slot is in the common/uncommon cards in set and collector boosters. Old sets that don't have boosterfun treatments will have both sheets be the same, so it won't matter.
Could it be a specific rule as part of the card_sheet_factory logic? Similar to how baseset
is implemented?
Do you want to try doing one or two boosters with just yaml, and then I'll see what can be done to improve the process?
I don't really know much about boosterfun, and non-draft boosters.
This branch: https://github.com/taw/magic-search-engine/pull/172 has mostly functioning collector boosters, set boosters, and draft booster fun for ONE.
This code no longer relevant. Should open new issue to simplify existing working YAML code.
Add
is:boosterfun
andhas:boosterfun
search tokens