-
-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loyalty filter added #3087
Loyalty filter added #3087
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Works as a normal digit filter ✔️
- Utilizes new relative filter, too ✔️
- Placed at correct alphabetical position in filter list ✔️
But I have a problem with using <=
and <
... ❌
>
, >=
, =
, ==
and only digits are working!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So loyalty is technically a string, as there are cards with "X" loyalty. If you want to convert "X" => 0, that's fine with me.
Loyalty is stored as an int value in the code, and what caused this problem is that all non-planeswalker cards are indistinguishable from those with 0 or X loyalty (both are stored as 0).
I'd rather choose the second solution due to the runtime we can spare by not having to compare the type of each card to the "Planeswalker" string when loyalty filter is used. What are your opinions? |
I'd prefer the 2nd option as planeswalker is tied to magic. If the field doensn't exist it should be easy to say it's a negative. |
Hmm, we handle
The root issue is from upstream: mtgjson/mtgjson#320 I prefer to not do any shenanigans here. Can we make the loyalty filters support strings already? |
If we don't do any shenanigans here, three planeswalkers will be left out when we filter to
I think it would be nice to remain consistent with the handling of X values: if they mean 0 in CMC, they should mean 0 here as well - or is it totally different? |
I'm happy with this PR as-is. When MTGJSON v4 is released, I'll give ample notice to put a change in. Maybe we can leave a TODO alert to update this when that happens. |
Planeswalker with For the back-sides of the transform-planeswalkers (Arlinn, Embraced by the Moon and Garruk, the Veil-Cursed) shouldn't they have no |
Ok, I made |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now. The <=
etc. work again for me, too.
If we do nothing on our end and mtgjson changes their value from "loyalty": null
to "loyalty": "X"
, Oracle then parses that correctly and stores the X as <loyalty>X</loyalty>
.
Just simulated that. 👍
Only issue: relative filtering wouldn't work to find Nissa yet.
You have to filter loyalty for exactly x
or X
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good here
Related Ticket(s)
Short roundup of the initial problem
"Loyalty" was missing from the possible options for card filter.
Screenshots