Merge pull request #5861 from rafaeldamasceno/fix-gatherer-sets

Fix set symbols in gatherer
This commit is contained in:
Oleg Agafonov 2019-06-24 01:12:58 +02:00 committed by GitHub
commit 994769e825
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,12 +6,14 @@ import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import mage.cards.ExpansionSet;
import mage.cards.Sets;
import mage.client.constants.Constants;
import mage.constants.Rarity;
import org.apache.log4j.Logger;
import org.mage.plugins.card.dl.DownloadJob;
import static org.mage.plugins.card.dl.DownloadJob.fromURL;
import static org.mage.plugins.card.dl.DownloadJob.toFile;
import static org.mage.plugins.card.utils.CardImageUtils.getImagesDir;
@ -27,12 +29,12 @@ public class GathererSets implements Iterable<DownloadJob> {
boolean haveRare;
boolean haveMyth;
private CheckResult(String ACode, ExpansionSet ASet, boolean AHaveCommon, boolean AHaveUncommon, boolean AHhaveRare, boolean AHaveMyth) {
private CheckResult(String ACode, ExpansionSet ASet, boolean AHaveCommon, boolean AHaveUncommon, boolean AHaveRare, boolean AHaveMyth) {
code = ACode;
set = ASet;
haveCommon = AHaveCommon;
haveUncommon = AHaveUncommon;
haveRare = AHhaveRare;
haveRare = AHaveRare;
haveMyth = AHaveMyth;
}
}
@ -65,8 +67,9 @@ public class GathererSets implements Iterable<DownloadJob> {
"W16", "W17",
// "APAC" -- gatherer do not have that set, scryfall has PALP
// "ARENA" -- is't many set with different codes, not one
"CLASH", "CP", "DD3GVL", "DPA", "EURO", "FNMP", "GPX", "GRC", "GUR", "H17", "JR", "MBP", "MGDC", "MLP", "MPRP", "MPS-AKH", "PTC", "S00", "S99", "SUS", "SWS", "UGIN", "UGL", "V10", "V17", "WMCQ", // need to fix
"H09", "PD2", "PD3", "UNH", "CM1", "V11", "A25", "UST", "IMA", "DD2", "EVG", "DDC", "DDE", "DDD", "8EB", "9EB", "CHR" // ok
// "ATH" -- has cards from many sets, symbol does not exist on gatherer
// "CLASH", "CP", "DPA", "EURO", "FNMP", "GPX", "GRC", "GUR", "H17", "JR", "MBP", "MGDC", "MLP", "MPRP", "PTC", "SUS", "SWS", "WMCQ", // need to fix
"H09", "PD2", "PD3", "UNH", "CM1", "V11", "A25", "UST", "IMA", "DD2", "EVG", "DDC", "DDE", "DDD", "8EB", "9EB", "CHR", "G18", "DD3GVL", "S00", "S99", "UGL" // ok
// current testing
};
@ -84,7 +87,7 @@ public class GathererSets implements Iterable<DownloadJob> {
"THS", "BNG", "JOU",
"CNS", "CN2",
"VMA", "TPR",
"KTK", "FRF", "DTK",
"KTK", "FRF", "UGIN", "DTK",
"BFZ", "OGW",
"SOI", "EMN",
"KLD", "AER",
@ -92,14 +95,19 @@ public class GathererSets implements Iterable<DownloadJob> {
"XLN", "C17",
"RIX", "DOM", "M19",
"E01", "CM2", "E02",
"GS1", "BBD", "C18"
"GS1", "BBD", "C18",
"GNT", "UMA", "GRN",
"RNA", "WAR", "MH1",
"M20"
// "HHO", "ANA" -- do not exist on gatherer
};
private static final String[] symbolsOnlyMyth = {
"DRB", "V09", "V12", "V13", "V14", "V15", "V16", "EXP"
"DRB", "V09", "V10", "V12", "V13", "V14", "V15", "V16", "V17", "EXP", "MEDM"
// "HTR" does not exist
};
private static final String[] symbolsOnlySpecial = {
"MPS"
"MPS", "MPS-AKH"
};
private static final HashMap<String, String> codeReplacements = new HashMap<>();
@ -116,8 +124,10 @@ public class GathererSets implements Iterable<DownloadJob> {
codeReplacements.put("ARN", "AN");
codeReplacements.put("ATQ", "AQ");
codeReplacements.put("CMA", "CM1");
codeReplacements.put("CHR", "CH");
codeReplacements.put("DD3DVD", "DD3_DVD");
codeReplacements.put("DD3EVG", "DD3_EVG");
codeReplacements.put("DD3GVL", "DD3_GVL");
codeReplacements.put("DD3JVC", "DD3_JVC");
codeReplacements.put("DRK", "DK");
codeReplacements.put("EXO", "EX");
@ -128,7 +138,9 @@ public class GathererSets implements Iterable<DownloadJob> {
codeReplacements.put("LEA", "1E");
codeReplacements.put("LEB", "2E");
codeReplacements.put("LEG", "LE");
codeReplacements.put("MEDM", "MPS_WAR");
codeReplacements.put("MPS", "MPS_KLD");
codeReplacements.put("MPS-AKH", "MPS_AKH");
codeReplacements.put("MIR", "MI");
codeReplacements.put("MMQ", "MM");
codeReplacements.put("NEM", "NE");
@ -138,16 +150,19 @@ public class GathererSets implements Iterable<DownloadJob> {
codeReplacements.put("POR", "PO");
codeReplacements.put("P02", "P2");
codeReplacements.put("PTK", "PK");
codeReplacements.put("S00", "P4");
codeReplacements.put("S99", "P3");
codeReplacements.put("STH", "ST");
codeReplacements.put("TMP", "TE");
codeReplacements.put("UDS", "CG");
codeReplacements.put("UGIN", "FRF_UGIN");
codeReplacements.put("UGL", "UG");
codeReplacements.put("ULG", "GU");
codeReplacements.put("USG", "UZ");
codeReplacements.put("VIS", "VI");
codeReplacements.put("WTH", "WL");
codeReplacements.put("8EB", "8ED"); // inner xmage set for 8th edition
codeReplacements.put("9EB", "8ED"); // inner xmage set for 9th edition
codeReplacements.put("CHR", "CH");
}
public GathererSets() {