mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
~ update set token image location
This commit is contained in:
@@ -102,8 +102,9 @@ public final class ImageKeys {
|
||||
|
||||
final String dir;
|
||||
final String filename;
|
||||
String[] tempdata = null;
|
||||
if (key.startsWith(ImageKeys.TOKEN_PREFIX)) {
|
||||
String[] tempdata = key.substring(ImageKeys.TOKEN_PREFIX.length()).split("\\|");
|
||||
tempdata = key.substring(ImageKeys.TOKEN_PREFIX.length()).split("\\|");
|
||||
String tokenname = tempdata[0] + "_" + tempdata[1];
|
||||
if (tempdata.length > 2) {
|
||||
tokenname += "_" + tempdata[2];
|
||||
@@ -150,6 +151,29 @@ public final class ImageKeys {
|
||||
cachedCards.put(filename, file);
|
||||
return file;
|
||||
}
|
||||
if (dir.equals(CACHE_TOKEN_PICS_DIR)) {
|
||||
String setlessFilename = tempdata[0];
|
||||
String setCode = tempdata[1];
|
||||
String collectorNumber = tempdata.length > 2 ? tempdata[2] : "";
|
||||
|
||||
if (!collectorNumber.isEmpty()) {
|
||||
file = findFile(dir, setCode + "/" + collectorNumber + "_" + setlessFilename);
|
||||
if (file != null) {
|
||||
cachedCards.put(filename, file);
|
||||
return file;
|
||||
}
|
||||
}
|
||||
file = findFile(dir, setCode + "/" + setlessFilename);
|
||||
if (file != null) {
|
||||
cachedCards.put(filename, file);
|
||||
return file;
|
||||
}
|
||||
file = findFile(dir, setlessFilename);
|
||||
if (file != null) {
|
||||
cachedCards.put(filename, file);
|
||||
return file;
|
||||
}
|
||||
}
|
||||
|
||||
// AE -> Ae and Ae -> AE for older cards with different file names
|
||||
// on case-sensitive file systems
|
||||
@@ -231,30 +255,7 @@ public final class ImageKeys {
|
||||
return file;
|
||||
}
|
||||
}
|
||||
if (dir.equals(CACHE_TOKEN_PICS_DIR)) {
|
||||
String[] tempdata = key.substring(ImageKeys.TOKEN_PREFIX.length()).split("\\|");
|
||||
String setlessFilename = tempdata[0];
|
||||
String setCode = tempdata[1];
|
||||
String collectorNumber = tempdata.length > 2 ? tempdata[2] : "";
|
||||
|
||||
if (!collectorNumber.isEmpty()) {
|
||||
file = findFile(dir, setlessFilename + "_" + setCode + "_" + collectorNumber);
|
||||
if (file != null) {
|
||||
cachedCards.put(filename, file);
|
||||
return file;
|
||||
}
|
||||
}
|
||||
file = findFile(dir, setlessFilename + "_" + setCode);
|
||||
if (file != null) {
|
||||
cachedCards.put(filename, file);
|
||||
return file;
|
||||
}
|
||||
file = findFile(dir, setlessFilename);
|
||||
if (file != null) {
|
||||
cachedCards.put(filename, file);
|
||||
return file;
|
||||
}
|
||||
} else if (filename.contains("/")) {
|
||||
if (filename.contains("/")) {
|
||||
String setlessFilename = filename.substring(filename.indexOf('/') + 1);
|
||||
file = findFile(dir, setlessFilename);
|
||||
if (file != null) {
|
||||
|
||||
@@ -232,11 +232,12 @@ public abstract class ImageFetcher {
|
||||
String tokenName = tempdata[0];
|
||||
String setCode = tempdata[1];
|
||||
|
||||
StringBuilder sb = new StringBuilder(tokenName);
|
||||
sb.append("_").append(setCode);
|
||||
StringBuilder sb = new StringBuilder(setCode);
|
||||
sb.append("/");
|
||||
if (tempdata.length > 2) {
|
||||
sb.append("_").append(tempdata[2]);
|
||||
sb.append(tempdata[2]).append("_");
|
||||
}
|
||||
sb.append(tokenName);
|
||||
sb.append(".jpg");
|
||||
|
||||
final String filename = sb.toString();
|
||||
|
||||
Reference in New Issue
Block a user