mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 09:48:02 +00:00
Merge branch 'newBranch' into 'master'
Update LQ Downloader See merge request core-developers/forge!2297
This commit is contained in:
@@ -22,6 +22,7 @@ import forge.item.PaperCard;
|
||||
import forge.model.FModel;
|
||||
import forge.properties.ForgeConstants;
|
||||
import forge.util.ImageUtil;
|
||||
import forge.util.TextUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
@@ -62,6 +63,13 @@ 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());
|
||||
final String fullborderPath = ForgeConstants.CACHE_CARD_PICS_DIR + setcode2 + "\\" + TextUtil.fastReplace(imageKey,".full",".fullborder") + ".jpg";
|
||||
final File existingFB = new File (fullborderPath);
|
||||
|
||||
if (existingFB.exists()) {
|
||||
return; //don't download equivalent full image with an existing fullborder image
|
||||
}
|
||||
|
||||
if (existingImages.contains(imageKey + ".jpg")) {
|
||||
return;
|
||||
|
||||
@@ -24,6 +24,7 @@ import forge.item.PaperCard;
|
||||
import forge.model.FModel;
|
||||
import forge.properties.ForgeConstants;
|
||||
import forge.util.ImageUtil;
|
||||
import forge.util.TextUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
@@ -83,6 +84,12 @@ public class GuiDownloadSetPicturesLQ extends GuiDownloadService {
|
||||
|
||||
private static void addDLObject(final String urlPath, final String filename, final Map<String, String> downloads) {
|
||||
final File destFile = new File(ForgeConstants.CACHE_CARD_PICS_DIR, filename + ".jpg");
|
||||
String modifier = !filename.contains(".full") ? ".fullborder" : "";
|
||||
final File fullborder = new File(ForgeConstants.CACHE_CARD_PICS_DIR, TextUtil.fastReplace(filename, ".full", ".fullborder") + modifier + ".jpg");
|
||||
|
||||
if (fullborder.exists())
|
||||
return; //don't add on download if you have an existing fullborder image in this set...
|
||||
|
||||
// System.out.println(filename);
|
||||
if (!destFile.exists()) {
|
||||
downloads.put(destFile.getAbsolutePath(), ForgeConstants.URL_PIC_DOWNLOAD + urlPath);
|
||||
|
||||
Reference in New Issue
Block a user