MTGProxyPrinter

View Ticket
Login

View Ticket

Ticket Hash: d6085a9f5c42470a38089cffe20519c45fb597bd
Title: Improve Scryfall CSV parser to support CSV returned by the search API
Status: Closed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Deck_List_Parser Resolution: Fixed
Last Modified: 2024-08-10 17:26:37
Version Found In: 0.28.3
User Comments:
thomas added on 2024-08-09 13:22:10:

The Scryfall CSV parser needs some amendments to support CSV documents returned by the search APi.
See the report on Reddit https://www.reddit.com/r/bootlegmtg/comments/vvoapc/comment/lh4wowc

Sample search: https://api.scryfall.com/cards/search?q=e%3Arex+cn%E2%89%A527+cn%E2%89%A445&format=csv

Plan

Currently, the parser requires a whole list of columns/fields, which is a leftover from the times where print hiding was implemented at the card data import step. This can be reduced to requiring only the scryfall_id field, which is sufficient. The other logic using name, set code, language, etc, is mostly dead nowadays, and is only accessed if the user wants to import a new re-print of an old card, while the card database is outdated that it does not contain the new printing. Then name-based lookup could find an old version of the card and offer that instead.

The best solution is probably moving the access of these optional fields into the block handling this case, and simply fail to find a card, if the optional fields are not present in the input CSV.

Once the parser only accesses the scryfall_id field, it can be used to parse the search API results, too.


thomas added on 2024-08-10 17:26:37:

Implemented.