-
Notifications
You must be signed in to change notification settings - Fork 39
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
Feature suggestion: automatic set symbol selector #7
Comments
I've done this in the past so it's definitely possible, but I'm wondering if there would be a more maintainable & cleaner way to implement it than a hardcoded dictionary. At minimum, I can include that dictionary and some code that retrieves the set symbol from it based on the card's expansion depending on a flag. Will have a think about how I can implement it & I'll get back to you! |
I did a quick hack of this yesterday by adding an additional (but optional) identifier to the image tag (ex. https://github.com/hunz-dev/mtg-autoproxy/blob/set-symbols/scripts/get_card_info.py#L160-L165 From here I manually made a JSON file storing the set codes to the appropriate HTML entity by parsing out the HTML of the Keyrune cheatsheet. Realistically this step could be automated by using something like https://github.com/hunz-dev/mtg-autoproxy/blob/set-symbols/scripts/set_symbols.json Then all I had to do was get the mapped set symbol code, use the https://github.com/hunz-dev/mtg-autoproxy/blob/set-symbols/scripts/get_card_info.py#L131-L144 I'd be happy to work with you to build on this solution in a way that you think would make sense. |
this issue is pretty old, but i'm currently working on adding this feature, as I learned recently that scryfall stores SVGs of all expansion symbols: set_info = json.loads(request.urlopen(f"https://api.scryfall.com/sets/{set_code}").read())
request.urlretrieve(set_info["icon_svg_uri"], icon_path) having to maintain a mapping between set codes and keyrune characters was the main thing holding me back from implementing this |
Would it perhaps be possible to add a feature that allows the scryfall api to automatically get the expansion name of the card, then find the appropriate symbol from: https://andrewgioia.github.io/Keyrune/icons.html and set it on the card?
I imagine a dictionary with the expansion name as key and the icon as value would help.
The text was updated successfully, but these errors were encountered: