images: fixed scryfall images download after last website update (#13479);

This commit is contained in:
Oleg Agafonov 2025-04-13 23:32:18 +04:00
parent d5eee8e46d
commit cf0ceb8a44
2 changed files with 19 additions and 2 deletions

View file

@ -90,7 +90,24 @@ public class ScryfallApiCard {
// - scryfall: Command Tower // Command Tower
// - xmage: Command Tower (second side as diff card and direct link image), example: https://scryfall.com/card/rex/26/command-tower-command-tower
if (this.layout.equals("reversible_card")) {
if (this.card_faces.get(0).layout == null || this.card_faces.get(0).layout.equals("normal")) {
if (false) {
// ignore
} else if (this.card_faces == null) {
// TODO: temporary fix, delete after scryfall site update
// broken adventure/omen card (scryfall changed it for some reason)
// Scavenger Regent // Exude Toxin
// https://scryfall.com/card/tdm/90/scavenger-regent-exude-toxin
if (this.name.contains("//")) {
throw new IllegalArgumentException("Scryfall: unsupported data type, broken reversible_card must have same simple name"
+ this.set + " - " + this.collector_number + " - " + this.name);
}
} else if (this.card_faces.get(0).layout.equals("reversible_card")) {
// TODO: temporary fix, delete after scryfall site update
// broken adventure/omen card (scryfall changed it for some reason)
// Bloomvine Regent // Claim Territory
// https://scryfall.com/card/tdm/381/bloomvine-regent-claim-territory-bloomvine-regent
this.name = this.card_faces.get(0).name;
} else if (this.card_faces.get(0).layout == null || this.card_faces.get(0).layout.equals("normal")) {
// simple card
// Command Tower // Command Tower
// https://scryfall.com/card/rex/26/command-tower-command-tower

View file

@ -504,7 +504,7 @@ public class ScryfallImageSource implements CardImageSource {
jsonReader.close();
return bulkCardsDatabaseAll.size() > 0;
} catch (Exception e) {
logger.error("Can't read bulk file (possible reason: broken scryfall format), details: " + e);
logger.error("Can't read bulk file (possible reason: broken scryfall format), details: " + e, e);
try {
// clean up
if (!SCRYFALL_BULK_FILES_DEBUG_READ_ONLY_MODE) {