diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MtgOnlTokensImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MtgOnlTokensImageSource.java index 41207d6b9c..618b4cf464 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MtgOnlTokensImageSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MtgOnlTokensImageSource.java @@ -376,4 +376,10 @@ public enum MtgOnlTokensImageSource implements CardImageSource { @Override public void doPause(String httpImageUrl) { } + + @Override + public boolean isImageProvided(String setCode, String cardName) { + return true; + } + } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/TokensMtgImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/TokensMtgImageSource.java index 95f4294a05..c009da8916 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/TokensMtgImageSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/TokensMtgImageSource.java @@ -34,8 +34,10 @@ import java.io.InputStreamReader; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.logging.Level; import org.apache.log4j.Logger; import org.mage.plugins.card.images.CardDownloadData; @@ -53,6 +55,11 @@ public enum TokensMtgImageSource implements CardImageSource { private HashMap> tokensData; private final Object tokensDataSync = new Object(); + private final Set supportedSets; + + private TokensMtgImageSource() { + this.supportedSets = new LinkedHashSet<>(); + } @Override public String getSourceName() { @@ -201,6 +208,7 @@ public enum TokensMtgImageSource implements CardImageSource { List siteTokensData = parseTokensData(inputStream); for (TokenData siteData : siteTokensData) { String key = siteData.getExpansionSetCode() + "/" + siteData.getName(); + supportedSets.add(siteData.getExpansionSetCode()); ArrayList list = tokensData.get(key); if (list == null) { list = new ArrayList<>(); @@ -335,4 +343,10 @@ public enum TokensMtgImageSource implements CardImageSource { return false; } + @Override + public ArrayList getSupportedSets() { + ArrayList supportedSetsCopy = new ArrayList<>(); + supportedSetsCopy.addAll(supportedSets); + return supportedSetsCopy; + } } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPictures.java b/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPictures.java index 2e81ebd36c..1396082fc7 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPictures.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPictures.java @@ -81,12 +81,12 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab WIZARDS("wizards.com", WizardCardsImageSource.instance), MYTHICSPOILER("mythicspoiler.com", MythicspoilerComSource.instance), TOKENS("tokens.mtg.onl", TokensMtgImageSource.instance), - MTG_ONL("mtg.onl", MtgOnlTokensImageSource.instance), + // MTG_ONL("mtg.onl", MtgOnlTokensImageSource.instance), ALTERNATIVE("alternative.mtg.onl", AltMtgOnlTokensImageSource.instance), GRAB_BAG("GrabBag", GrabbagImageSource.instance), MAGIDEX("magidex.com", MagidexImageSource.instance), - SCRYFALL("scryfall.com", ScryfallImageSource.instance), - MAGICCARDS("magiccards.info", MagicCardsImageSource.instance); + SCRYFALL("scryfall.com", ScryfallImageSource.instance); + // MAGICCARDS("magiccards.info", MagicCardsImageSource.instance) private final String text; private final CardImageSource source; @@ -276,6 +276,8 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab } } break; + case ALL_TOKENS: + break; default: int nonSetEntries = 0; if (cardImageSource.getSupportedSets() != null) { @@ -290,8 +292,9 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab int numberTokenImagesAvailable = 0; int numberCardImagesAvailable = 0; for (CardDownloadData data : allCardsMissingImage) { - if (data.isToken() && cardImageSource.isTokenSource()) { - if (cardImageSource.isImageProvided(data.getSet(), data.getName())) { + if (data.isToken()) { + if (cardImageSource.isTokenSource() + && cardImageSource.isImageProvided(data.getSet(), data.getName())) { numberTokenImagesAvailable++; cardsToDownload.add(data); } diff --git a/Mage.Server.Plugins/Mage.Game.PennyDreadfulCommanderFreeForAll/target/maven-archiver/pom.properties b/Mage.Server.Plugins/Mage.Game.PennyDreadfulCommanderFreeForAll/target/maven-archiver/pom.properties index 03ac9e7681..9ea86aa6e9 100644 --- a/Mage.Server.Plugins/Mage.Game.PennyDreadfulCommanderFreeForAll/target/maven-archiver/pom.properties +++ b/Mage.Server.Plugins/Mage.Game.PennyDreadfulCommanderFreeForAll/target/maven-archiver/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven -#Sun Sep 03 07:46:59 CEST 2017 +#Fri Sep 15 22:14:29 CEST 2017 version=1.4.26 groupId=org.mage artifactId=mage-game-pennydreadfulcommanderfreeforall