Add a vanilla-creature filter to card and library search
Filtering for creatures with an empty rules box can't be done from `oracle_cards.oracle_text`: that column joins every face together, so an Adventure card always carries its spell half's text and a naive `oracle_text = ''` test would exclude exactly the cards worth including. Derive it at ingest instead, from the front face's own text — the front is the half that resolves as the creature, and adventure/prepared/transform cards are all cast from it. Exposed as `vanilla_only` behind its own `has_vanilla` capability check rather than folded into `has_universes_beyond`, since it lands in a later reference-schema revision and a db can have one column without the other. Needs a card-data re-download before it does anything.
This commit is contained in:
@@ -314,6 +314,12 @@ pub struct LibraryFilter {
|
||||
/// Only cards that can head a Commander deck.
|
||||
#[serde(default)]
|
||||
pub can_be_commander: bool,
|
||||
/// Only "vanilla" creatures — a creature with an empty rules box. Includes
|
||||
/// Adventure and Prepared cards whose creature half has no abilities, which
|
||||
/// is why this reads a precomputed column instead of testing `oracle_text`:
|
||||
/// that column joins every face, so the attached spell's text is in it.
|
||||
#[serde(default)]
|
||||
pub vanilla_only: bool,
|
||||
/// Only cards with an empty colour identity — what a colourless commander
|
||||
/// can actually play. The colour bitmasks can't express this: 0 there means
|
||||
/// "no filter", not "no colours".
|
||||
|
||||
Reference in New Issue
Block a user