This new revision of the APi brings a more consistent distribution of the different parameters and settings in DB API calls.
In particular, the changes affect the getCardFromEditions which are now separated into three sets of methods:
- methods to retrieve a card based on CardArtPreference
- methods to also include a Release Date restriction,
that can be now considered in both directions
(as in "releasedBefore" and "releasedAfter" a specified date).
These changes will be functional for new additions in future changes to Deck Importer, as well as will be used
to refine the implementation of the new Smart Card Art Selection in Decks.
From an implementation perspective, it is important to emphasise that all those methods are just syntactic sugar
for parameter passing to the **same** core (private) retrieval method (centralised single point of failure)
which incorporates all the required parameters, that would also be cumbersome to use in a public API.
Even if UNKNOWN card load is enabled, we should check whether the card was not found because of originally filtered.
Therefore, the actual UNKNOWN card will be added now ONLY IF it is not contained in the filtered Blacklist.
The new "Smart Card Art Selection" option for card images in deck has been added.
The Ui and forge preferences have been updated (default is False), as well as corresponding support in StaticData.
On this note, the old `getAlternativeCardPrint` has been re-implemented to enforce a "Latest_Art" based preference selection so that editions could be selected accordingly (as the smart method was originally designed)
Actual implementation of the method will be part of future commits as still under dev - and requires better encapsulation
The getImagefile will be invoked since this method will also account for any difference in `full` and `fullborder` naming for card images.
In particular, it will try everything possible before giving up and assume the card has no image.
This is **crucial** for cardDB card retrieval, as well as determines the boolean value returned by PaperCard.hasImage method/property
CardDb now includes a more refined mechanism to set up values for CardArt Preference.
These methods do now support the proper setup for legacy values and string values (as supported previously in mobile version).
Moreover, new methods are now defined to support the new (separated) pair of settings as integrated into the Desktop App.
I've decided to use the option in settings only for gameplay, and so always allowing the load of custom cards.
This is because otherwise the option should be much more pervasive, so inhibiting card catalog, sets filters, ...
So the option will just control the use of custom cards in decks for gameplay (still false by default!)
If Custom Card setting is disabled, an error message in logs will be printed accordingly.
Custom Cards will be loaded as such in Card Pool only if the option in settings is enabled.
Also, the CardArtPreference Enum now includes a new methods that allows seamless recognition (and instantiation) of corresponding enum value from Forge Preference - also with backward compatibility.
The revised implementation of `attemptToLoadCard` method now also takes into consideration any setcode that may be present into request info.
This is to reduce db lookup operation and returning a card from a very specific set.
Setting the value of card art preference from string now is more reliable, and it falls back automatically to the default
(Latest Art All editions).
This is to allow setting the enum value from Forge Preference Labels.
The new name, i.e. OldArtExcludedPromoAndOnlineEditions is more self-explanatory - a bit long though.
Won't exclude that I will come back at namings after having now worked on CardEdition.Type revision