mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
update imagefetcher
This commit is contained in:
@@ -169,6 +169,17 @@ public class ImageUtil {
|
|||||||
String cardCollectorNumber = cp.getCollectorNumber();
|
String cardCollectorNumber = cp.getCollectorNumber();
|
||||||
// Hack to account for variations in Arabian Nights
|
// Hack to account for variations in Arabian Nights
|
||||||
cardCollectorNumber = cardCollectorNumber.replace("+", "†");
|
cardCollectorNumber = cardCollectorNumber.replace("+", "†");
|
||||||
|
// override old planechase sets from their modified id since scryfall move the planechase cards outside their original setcode
|
||||||
|
if (cardCollectorNumber.startsWith("OHOP")) {
|
||||||
|
editionCode = "ohop";
|
||||||
|
cardCollectorNumber = cardCollectorNumber.substring("OHOP".length());
|
||||||
|
} else if (cardCollectorNumber.startsWith("OPCA")) {
|
||||||
|
editionCode = "opca";
|
||||||
|
cardCollectorNumber = cardCollectorNumber.substring("OPCA".length());
|
||||||
|
} else if (cardCollectorNumber.startsWith("OPC2")) {
|
||||||
|
editionCode = "opc2";
|
||||||
|
cardCollectorNumber = cardCollectorNumber.substring("OPC2".length());
|
||||||
|
}
|
||||||
String versionParam = useArtCrop ? "art_crop" : "normal";
|
String versionParam = useArtCrop ? "art_crop" : "normal";
|
||||||
String faceParam = "";
|
String faceParam = "";
|
||||||
if (cp.getRules().getOtherPart() != null) {
|
if (cp.getRules().getOtherPart() != null) {
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ public class SwingImageFetcher extends ImageFetcher {
|
|||||||
private void doFetch(String urlToDownload) throws IOException {
|
private void doFetch(String urlToDownload) throws IOException {
|
||||||
String newdespath = urlToDownload.contains(".fullborder.jpg") ?
|
String newdespath = urlToDownload.contains(".fullborder.jpg") ?
|
||||||
TextUtil.fastReplace(destPath, ".full.jpg", ".fullborder.jpg") : destPath;
|
TextUtil.fastReplace(destPath, ".full.jpg", ".fullborder.jpg") : destPath;
|
||||||
|
if (!newdespath.contains(".full") && urlToDownload.startsWith(ForgeConstants.URL_PIC_SCRYFALL_DOWNLOAD))
|
||||||
|
newdespath = newdespath.replace(".jpg", ".fullborder.jpg"); //fix planes/phenomenon for round border options
|
||||||
URL url = new URL(urlToDownload);
|
URL url = new URL(urlToDownload);
|
||||||
System.out.println("Attempting to fetch: " + url);
|
System.out.println("Attempting to fetch: " + url);
|
||||||
BufferedImage image = ImageIO.read(url);
|
BufferedImage image = ImageIO.read(url);
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ public class LibGDXImageFetcher extends ImageFetcher {
|
|||||||
private void doFetch(String urlToDownload) throws IOException {
|
private void doFetch(String urlToDownload) throws IOException {
|
||||||
String newdespath = urlToDownload.contains(".fullborder.") || urlToDownload.startsWith(ForgeConstants.URL_PIC_SCRYFALL_DOWNLOAD) ?
|
String newdespath = urlToDownload.contains(".fullborder.") || urlToDownload.startsWith(ForgeConstants.URL_PIC_SCRYFALL_DOWNLOAD) ?
|
||||||
TextUtil.fastReplace(destPath, ".full.", ".fullborder.") : destPath;
|
TextUtil.fastReplace(destPath, ".full.", ".fullborder.") : destPath;
|
||||||
|
if (!newdespath.contains(".full") && urlToDownload.startsWith(ForgeConstants.URL_PIC_SCRYFALL_DOWNLOAD))
|
||||||
|
newdespath = newdespath.replace(".jpg", ".fullborder.jpg"); //fix planes/phenomenon for round border options
|
||||||
URL url = new URL(urlToDownload);
|
URL url = new URL(urlToDownload);
|
||||||
System.out.println("Attempting to fetch: " + url);
|
System.out.println("Attempting to fetch: " + url);
|
||||||
java.net.URLConnection c = url.openConnection();
|
java.net.URLConnection c = url.openConnection();
|
||||||
|
|||||||
Reference in New Issue
Block a user