Improved Android downloader for token images.
This commit is contained in:
@@ -4093,8 +4093,7 @@ public class ImgDownloader {
|
|||||||
if(card != null && hasToken(id)) {
|
if(card != null && hasToken(id)) {
|
||||||
String text = (String) card.get("oracle_text");
|
String text = (String) card.get("oracle_text");
|
||||||
String nametoken = findTokenName(card, id, "Copy");
|
String nametoken = findTokenName(card, id, "Copy");
|
||||||
if (!nametoken.isEmpty() || (text != null && !text.isEmpty() && !text.trim().toLowerCase().contains("nontoken") && ((text.trim().toLowerCase().contains("create") && text.trim().toLowerCase().contains("creature token")) ||
|
if (!nametoken.isEmpty() || (text != null && !text.isEmpty() && !text.trim().toLowerCase().contains("nontoken") && ((text.trim().toLowerCase().contains("investigate")) || (text.trim().toLowerCase().contains("create") && text.trim().toLowerCase().contains("creature token")) || (text.trim().toLowerCase().contains("put") && text.trim().toLowerCase().contains("token"))))) {
|
||||||
(text.trim().toLowerCase().contains("put") && text.trim().toLowerCase().contains("token"))))) {
|
|
||||||
System.out.println("The card: " + mappa.get(id) + " (" + id + ".jpg) can create a token, i will try to download that image too as " + id + "t.jpg");
|
System.out.println("The card: " + mappa.get(id) + " (" + id + ".jpg) can create a token, i will try to download that image too as " + id + "t.jpg");
|
||||||
String specialtokenurl = findTokenImageUrl(card, id, "large", "Copy");
|
String specialtokenurl = findTokenImageUrl(card, id, "large", "Copy");
|
||||||
if (!specialtokenurl.isEmpty()) {
|
if (!specialtokenurl.isEmpty()) {
|
||||||
@@ -4763,7 +4762,7 @@ public class ImgDownloader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (hasToken(id) && !text.trim().toLowerCase().contains("nontoken") && ((text.trim().toLowerCase().contains("create") && text.trim().toLowerCase().contains("creature token")) || (text.trim().toLowerCase().contains("put") && text.trim().toLowerCase().contains("token")))) {
|
if (hasToken(id) && !text.trim().toLowerCase().contains("nontoken") && ((text.trim().toLowerCase().contains("investigate")) || (text.trim().toLowerCase().contains("create") && text.trim().toLowerCase().contains("creature token")) || (text.trim().toLowerCase().contains("put") && text.trim().toLowerCase().contains("token")))) {
|
||||||
System.out.println("The card: " + mappa.get(id) + " (" + id + ".jpg) can create a token, i will try to download that image too as " + id + "t.jpg");
|
System.out.println("The card: " + mappa.get(id) + " (" + id + ".jpg) can create a token, i will try to download that image too as " + id + "t.jpg");
|
||||||
boolean tokenfound = false;
|
boolean tokenfound = false;
|
||||||
String arrays[] = text.trim().split(" ");
|
String arrays[] = text.trim().split(" ");
|
||||||
@@ -4774,6 +4773,10 @@ public class ImgDownloader {
|
|||||||
String color1 = "";
|
String color1 = "";
|
||||||
String color2 = "";
|
String color2 = "";
|
||||||
for (int l = 1; l < arrays.length - 1; l++) {
|
for (int l = 1; l < arrays.length - 1; l++) {
|
||||||
|
if(text.trim().toLowerCase().contains("investigate")) {
|
||||||
|
nametoken = "Clue";
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (arrays[l].equalsIgnoreCase("creature") && arrays[l + 1].toLowerCase().contains("token")) {
|
if (arrays[l].equalsIgnoreCase("creature") && arrays[l + 1].toLowerCase().contains("token")) {
|
||||||
nametoken = arrays[l - 1];
|
nametoken = arrays[l - 1];
|
||||||
if (l - 3 > 0) {
|
if (l - 3 > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user