mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
* Image download - added Ixalan & Iconic Masters to Scryfall and mythicspoilers.com.
This commit is contained in:
parent
1d5d201d29
commit
ae0d87b7ec
5 changed files with 26 additions and 7 deletions
|
@ -251,6 +251,7 @@ public enum MythicspoilerComSource implements CardImageSource {
|
|||
supportedSets.add("E01");
|
||||
supportedSets.add("HOU");
|
||||
supportedSets.add("C17");
|
||||
supportedSets.add("IMA");
|
||||
supportedSets.add("XLN");
|
||||
|
||||
sets = new LinkedHashMap<>();
|
||||
|
|
|
@ -199,11 +199,25 @@ public enum ScryfallImageSource implements CardImageSource {
|
|||
supportedSets.add("E01");
|
||||
supportedSets.add("HOU");
|
||||
supportedSets.add("C17");
|
||||
supportedSets.add("XLN");
|
||||
// supportedSets.add("DDT");
|
||||
supportedSets.add("IMA");
|
||||
// supportedSets.add("E02");
|
||||
// supportedSets.add("V17");
|
||||
// supportedSets.add("UST");
|
||||
// supportedSets.add("RIX");
|
||||
// supportedSets.add("A25");
|
||||
// supportedSets.add("DOM");
|
||||
// supportedSets.add("M19");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateURL(CardDownloadData card) throws Exception {
|
||||
return "https://api.scryfall.com/cards/" + formatSetName(card.getSet()) + "/" + card.getCollectorId() + "?format=image";
|
||||
return "https://api.scryfall.com/cards/" + formatSetName(card.getSet()) + "/"
|
||||
+ card.getCollectorId()
|
||||
+ (card.isSecondSide() ? "b" : "")
|
||||
+ "?format=image";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -40,7 +40,7 @@ public class CardDownloadData {
|
|||
}
|
||||
|
||||
public CardDownloadData(String name, String set, String collectorId, boolean usesVariousArt, Integer type, String tokenSetCode, String tokenDescriptor, boolean token, boolean twoFacedCard, boolean secondSide) {
|
||||
this(name, set, collectorId, usesVariousArt, type, tokenSetCode, tokenDescriptor, token, false, false, "");
|
||||
this(name, set, collectorId, usesVariousArt, type, tokenSetCode, tokenDescriptor, token, twoFacedCard, secondSide, "");
|
||||
}
|
||||
|
||||
public CardDownloadData(String name, String set, String collectorId, boolean usesVariousArt, Integer type, String tokenSetCode, String tokenDescriptor, boolean token, boolean twoFacedCard, boolean secondSide, String tokenClassName) {
|
||||
|
@ -72,7 +72,7 @@ public class CardDownloadData {
|
|||
this.usesVariousArt = card.usesVariousArt;
|
||||
this.tokenSetCode = card.tokenSetCode;
|
||||
this.tokenDescriptor = card.tokenDescriptor;
|
||||
this.tokenClassName = tokenClassName;
|
||||
this.tokenClassName = card.tokenClassName;
|
||||
this.fileName = card.fileName;
|
||||
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ public class CardDownloadData {
|
|||
public String getTokenDescriptor() {
|
||||
return tokenDescriptor;
|
||||
}
|
||||
|
||||
|
||||
public void setTokenClassName(String tokenClassName) {
|
||||
this.tokenClassName = tokenClassName;
|
||||
}
|
||||
|
|
|
@ -429,9 +429,13 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
|
|||
if (card.getSecondSideName() == null || card.getSecondSideName().trim().isEmpty()) {
|
||||
throw new IllegalStateException("Second side card can't have empty name.");
|
||||
}
|
||||
|
||||
url = new CardDownloadData(card.getSecondSideName(), card.getSetCode(), card.getCardNumber(), card.usesVariousArt(), 0, "", "", false, card.isDoubleFaced(), true);
|
||||
url.setType2(isType2);
|
||||
allCardsUrls.add(url);
|
||||
if (card.getSetCode().equals("XLN")) {
|
||||
logger.info(card.getSetCode() + "second side: " + card.getSecondSideName() + " -name: " + card.getName());
|
||||
}
|
||||
}
|
||||
if (card.isFlipCard()) {
|
||||
if (card.getFlipCardName() == null || card.getFlipCardName().trim().isEmpty()) {
|
||||
|
@ -444,11 +448,11 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
|
|||
allCardsUrls.add(cardDownloadData);
|
||||
}
|
||||
} else if (card.getCardNumber().isEmpty() || "0".equals(card.getCardNumber())) {
|
||||
System.err.println("There was a critical error!");
|
||||
logger.error("Card has no collector ID and won't be sent to client: " + card.getName());
|
||||
} else if (card.getSetCode().isEmpty()) {
|
||||
System.err.println("There was a critical error!");
|
||||
logger.error("Card has no set name and won't be sent to client:" + card.getName());
|
||||
} else {
|
||||
logger.info("Card was not selected: " + card.getName());
|
||||
}
|
||||
});
|
||||
allCardsUrls.addAll(getTokenCardUrls());
|
||||
|
|
|
@ -74,6 +74,6 @@ dd3evg=ddaevg
|
|||
dd3gvl=ddagvl
|
||||
dd3jvc=ddajvc
|
||||
# Remove setname as soon as the images can be downloaded
|
||||
ignore.urls=TOK,DDT,V17,IMA,RIX,E02,M19,M25,DOM,UST,H17
|
||||
ignore.urls=TOK,DDT,V17,RIX,E02,M19,M25,DOM,UST,H17
|
||||
# sets ordered by release time (newest goes first)
|
||||
token.lookup.order=M19,M25,DOM,E02,RIX,UST,XLN,IMA,H17,C17,V17,E01,DDT,CMA,HOU,MM3,DDS,AKH,DD3DVD,DD3EVG,DD3GVL,DD3JVC,H09,AER,PCA,C16,V16,MPS,KLD,DDR,CN2,EMN,EMA,SOI,DDQ,CP,CMA,ARENA,SUS,APAC,EURO,UGIN,C15,OGW,EXP,DDP,BFZ,DRB,V09,V10,V11,V12,V13,V14,V15,TPR,MPRP,DD3,DDO,ORI,MM2,PTC,DTK,FRF,KTK,M15,VMA,CNS,JOU,BNG,THS,DDL,M14,MMA,DGM,GTC,RTR,M13,AVR,DDI,DKA,ISD,M12,NPH,MBS,SOM,M11,ROE,DDE,WWK,ZEN,M10,GVL,ARB,DVD,CFX,JVC,ALA,EVE,SHM,EVG,MOR,LRW,10E,CLS,CHK,GRC
|
Loading…
Reference in a new issue