mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
images: fixed scryfall images download after last website update (#13479);
This commit is contained in:
parent
d5eee8e46d
commit
cf0ceb8a44
2 changed files with 19 additions and 2 deletions
|
|
@ -90,7 +90,24 @@ public class ScryfallApiCard {
|
||||||
// - scryfall: Command Tower // Command Tower
|
// - 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
|
// - 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.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
|
// simple card
|
||||||
// Command Tower // Command Tower
|
// Command Tower // Command Tower
|
||||||
// https://scryfall.com/card/rex/26/command-tower-command-tower
|
// https://scryfall.com/card/rex/26/command-tower-command-tower
|
||||||
|
|
|
||||||
|
|
@ -504,7 +504,7 @@ public class ScryfallImageSource implements CardImageSource {
|
||||||
jsonReader.close();
|
jsonReader.close();
|
||||||
return bulkCardsDatabaseAll.size() > 0;
|
return bulkCardsDatabaseAll.size() > 0;
|
||||||
} catch (Exception e) {
|
} 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 {
|
try {
|
||||||
// clean up
|
// clean up
|
||||||
if (!SCRYFALL_BULK_FILES_DEBUG_READ_ONLY_MODE) {
|
if (!SCRYFALL_BULK_FILES_DEBUG_READ_ONLY_MODE) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue