mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Check for setless fullborder while calculating downloads
This commit is contained in:
@@ -23,6 +23,7 @@ import forge.model.FModel;
|
||||
import forge.properties.ForgeConstants;
|
||||
import forge.util.ImageUtil;
|
||||
import forge.util.TextUtil;
|
||||
import forge.ImageKeys;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
@@ -63,21 +64,8 @@ public class GuiDownloadPicturesLQ extends GuiDownloadService {
|
||||
private void addDLObject(final PaperCard c, final boolean backFace) {
|
||||
final String imageKey = ImageUtil.getImageKey(c, backFace, false);
|
||||
final String destPath = ForgeConstants.CACHE_CARD_PICS_DIR + imageKey + ".jpg";
|
||||
final String setcode2 = StaticData.instance().getEditions().getCode2ByCode(c.getEdition());
|
||||
String modifier = !imageKey.contains(".full") ? ".fullborder" : "";
|
||||
final String fullborderPath = ForgeConstants.CACHE_CARD_PICS_DIR + setcode2 + ForgeConstants.PATH_SEPARATOR + TextUtil.fastReplace(imageKey,".full",".fullborder") + modifier + ".jpg";
|
||||
final File existingFB = new File (fullborderPath);
|
||||
final File existingFB2 = new File (TextUtil.fastReplace(fullborderPath, "1.fullborder", ".fullborder"));
|
||||
|
||||
if (existingFB.exists()) {
|
||||
return; //don't download equivalent full image with an existing fullborder image
|
||||
}
|
||||
|
||||
if (existingFB2.exists()) {
|
||||
return; //check 2
|
||||
}
|
||||
|
||||
if (existingImages.contains(imageKey + ".jpg")) {
|
||||
if (ImageKeys.getImageFile(imageKey) != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user