mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
* Fixed land image downloading from gatherer and handling of Anthology Duel Decks.
This commit is contained in:
parent
ed9d0a5fc1
commit
809bf663df
256 changed files with 293 additions and 270 deletions
|
|
@ -527,17 +527,17 @@ public class ConstructedFormats {
|
|||
if (format.equals("Starter 2000")) {
|
||||
return Arrays.asList("S00");
|
||||
}
|
||||
if (format.equals("Duel Decks: Anthology, Elves vs. Goblins")) {
|
||||
return Arrays.asList("DD3");
|
||||
}
|
||||
if (format.equals("Duel Decks: Anthology, Jace vs. Chandra")) {
|
||||
return Arrays.asList("DD3");
|
||||
}
|
||||
if (format.equals("Duel Decks: Anthology, Divine vs. Demonic")) {
|
||||
return Arrays.asList("DD3");
|
||||
return Arrays.asList("DD3A");
|
||||
}
|
||||
if (format.equals("Duel Decks: Anthology, Elves vs. Goblins")) {
|
||||
return Arrays.asList("DD3B");
|
||||
}
|
||||
if (format.equals("Duel Decks: Anthology, Garruk vs. Liliana")) {
|
||||
return Arrays.asList("DD3");
|
||||
return Arrays.asList("DD3C");
|
||||
}
|
||||
if (format.equals("Duel Decks: Anthology, Jace vs. Chandra")) {
|
||||
return Arrays.asList("DD3D");
|
||||
}
|
||||
if (format.equals("Duel Decks: Elves vs. Goblins")) {
|
||||
return Arrays.asList("EVG");
|
||||
|
|
|
|||
|
|
@ -34,7 +34,8 @@ public class GathererSets implements Iterable<DownloadJob> {
|
|||
"POR", "PO2", "PTK"};
|
||||
|
||||
private static final String[] withMythics = {"M10", "M11", "M12", "M13", "M14", "M15", "ORI",
|
||||
"DDF", "DDG", "DDH", "DDI", "DDJ", "DDK", "DDL", "DDM", "DDN", "DD3", "DDO",
|
||||
"DDF", "DDG", "DDH", "DDI", "DDJ", "DDK", "DDL", "DDM", "DDN",
|
||||
"DD3", "DD3B", "DDO",
|
||||
"ALA", "CON", "ARB",
|
||||
"ZEN", "WWK", "ROE",
|
||||
"SOM", "MBS", "NPH",
|
||||
|
|
@ -80,6 +81,10 @@ public class GathererSets implements Iterable<DownloadJob> {
|
|||
symbolsReplacements.put("2ED", "2U");
|
||||
symbolsReplacements.put("LEB", "2E");
|
||||
symbolsReplacements.put("LEA", "1E");
|
||||
symbolsReplacements.put("DD3A", "DD3");
|
||||
symbolsReplacements.put("DD3B", "DD3");
|
||||
symbolsReplacements.put("DD3C", "DD3");
|
||||
symbolsReplacements.put("DD3D", "DD3");
|
||||
}
|
||||
|
||||
public GathererSets(String path) {
|
||||
|
|
|
|||
|
|
@ -76,10 +76,10 @@ public class MagicCardsImageSource implements CardImageSource {
|
|||
put("M10", "magic-2010");
|
||||
put("EVG", "duel-decks-elves-vs-goblins");
|
||||
put("DD2", "duel-decks-jace-vs-chandra");
|
||||
put("DD3", "duel-decks-anthology-elves-vs-goblins");
|
||||
put("DD3", "duel-decks-anthology-divine-vs-demonic");
|
||||
put("DD3", "duel-decks-anthology-garruk-vs-liliana");
|
||||
put("DD3", "duel-decks-anthology-jace-vs-chandra");
|
||||
put("DD3A", "duel-decks-anthology-divine-vs-demonic");
|
||||
put("DD3B", "duel-decks-anthology-elves-vs-goblins");
|
||||
put("DD3C", "duel-decks-anthology-garruk-vs-liliana");
|
||||
put("DD3D", "duel-decks-anthology-jace-vs-chandra");
|
||||
put("DDC", "duel-decks-divine-vs-demonic");
|
||||
put("DDD", "duel-decks-garruk-vs-liliana");
|
||||
put("DDE", "duel-decks-phyrexia-vs-the-coalition");
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import mage.remote.Connection;
|
|||
import mage.remote.Connection.ProxyType;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.select.Elements;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
|
|
@ -76,7 +77,10 @@ public class WizardCardsImageSource implements CardImageSource {
|
|||
setsAliases.put("CON", "Conflux");
|
||||
setsAliases.put("CSP", "Coldsnap");
|
||||
setsAliases.put("DD2", "Duel Decks: Jace vs. Chandra");
|
||||
setsAliases.put("DD3", "Duel Decks Anthology, Divine vs. Demonic^Duel Decks Anthology, Elves vs. Goblins^Duel Decks Anthology, Garruk vs. Liliana^Duel Decks Anthology, Jace vs. Chandra");
|
||||
setsAliases.put("DD3A", "Duel Decks Anthology, Divine vs. Demonic");
|
||||
setsAliases.put("DD3B", "Duel Decks Anthology, Elves vs. Goblins");
|
||||
setsAliases.put("DD3C", "Duel Decks Anthology, Garruk vs. Liliana");
|
||||
setsAliases.put("DD3D", "Duel Decks Anthology, Jace vs. Chandra");
|
||||
setsAliases.put("DDC", "Duel Decks: Divine vs. Demonic");
|
||||
setsAliases.put("DDD", "Duel Decks: Garruk vs. Liliana");
|
||||
setsAliases.put("DDE", "Duel Decks: Phyrexia vs. the Coalition");
|
||||
|
|
@ -221,7 +225,7 @@ public class WizardCardsImageSource implements CardImageSource {
|
|||
|
||||
uc.connect();
|
||||
|
||||
String line = null;
|
||||
String line;
|
||||
StringBuffer tmp = new StringBuffer();
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream()));
|
||||
while ((line = in.readLine()) != null) {
|
||||
|
|
@ -246,13 +250,20 @@ public class WizardCardsImageSource implements CardImageSource {
|
|||
String cardName = normalizeName(cardsImages.get(i).attr("alt"));
|
||||
if (cardName != null && !cardName.isEmpty()) {
|
||||
if (cardName.equals("Forest") || cardName.equals("Swamp") || cardName.equals("Mountain") || cardName.equals("Island") || cardName.equals("Plains")) {
|
||||
Integer multiverseId = Integer.parseInt(cardsImages.get(i).attr("src").replaceAll("[^\\d]", ""));
|
||||
String urlLandDocument = "http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=" + multiverseId;
|
||||
Document landDoc = Jsoup.connect(urlLandDocument).get();
|
||||
Elements variations = landDoc.select("a.variationlink");
|
||||
int landNumber = 1;
|
||||
while (setLinks.get((cardName + landNumber).toLowerCase()) != null) {
|
||||
for (Element variation : variations) {
|
||||
Integer landMultiverseId = Integer.parseInt(variation.attr("onclick").replaceAll("[^\\d]", ""));
|
||||
// ""
|
||||
setLinks.put((cardName + landNumber).toLowerCase(), "/Handlers/Image.ashx?multiverseid=" +landMultiverseId + "&type=card");
|
||||
landNumber++;
|
||||
}
|
||||
cardName += landNumber;
|
||||
} else {
|
||||
setLinks.put(cardName.toLowerCase(), cardsImages.get(i).attr("src").substring(5));
|
||||
}
|
||||
setLinks.put(cardName.toLowerCase(), cardsImages.get(i).attr("src").substring(5));
|
||||
}
|
||||
}
|
||||
page++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue