Tokens rework:

- now token images chosen by tokens database instead availableImageSetCodes (related to #10139);
 - added additional verify checks for tokens database;
 - fixed some tokens;
This commit is contained in:
Oleg Agafonov 2023-04-22 15:50:46 +04:00
parent 653cec11ef
commit 7d44057f93
9 changed files with 89 additions and 183 deletions

View file

@ -1222,7 +1222,7 @@ public class VerifyCardDataTest {
// tok file's data
List<TokenInfo> tokFileTokens = TokenRepository.instance.getAllTokens();
List<TokenInfo> tokFileTokens = TokenRepository.instance.getAll();
LinkedHashMap<String, String> tokDataClassesIndex = new LinkedHashMap<>();
LinkedHashMap<String, String> tokDataNamesIndex = new LinkedHashMap<>();
LinkedHashMap<String, List<TokenInfo>> tokDataTokensBySetIndex = new LinkedHashMap<>();
@ -1361,6 +1361,15 @@ public class VerifyCardDataTest {
}
});
// CHECK: token and class names must be same in all sets
TokenRepository.instance.getAllByClassName().forEach((className, list) -> {
Set<String> names = list.stream().map(TokenInfo::getName).collect(Collectors.toSet());
if (names.size() > 1) {
errorsList.add("error, card-pictures-tok.txt contains different names for same class: "
+ className + " - " + String.join(", ", names));
}
});
// TODO: all sets must have full tokens data in tok file (token in every set)
// 1. Download scryfall tokens list: https://api.scryfall.com/cards/search?q=t:token
// 2. Proccess each token with all prints: read "prints_search_uri" field from token data and go to link like