Prioritize FTP images before scryfall

This commit is contained in:
Anthony Calosa
2020-10-01 00:41:46 +08:00
parent 23c00c290e
commit 645fa3af3b

View File

@@ -63,6 +63,11 @@ public abstract class ImageFetcher {
final String filename = ImageUtil.getImageKey(paperCard, backFace, true);
destFile = new File(ForgeConstants.CACHE_CARD_PICS_DIR + "/" + filename + ".jpg");
//move priority of ftp image here
StringBuilder setDownload = new StringBuilder(ForgeConstants.URL_PIC_DOWNLOAD);
setDownload.append(ImageUtil.getDownloadUrl(paperCard, backFace));
downloadUrls.add(setDownload.toString());
int artIndex = 1;
final Pattern pattern = Pattern.compile("^.:([^|]*\\|){2}(\\d+).*$");
Matcher matcher = pattern.matcher(imageKey);
@@ -89,10 +94,6 @@ public abstract class ImageFetcher {
editionMciCode, cardNum, suffix, langCode));
}
StringBuilder setDownload = new StringBuilder(ForgeConstants.URL_PIC_DOWNLOAD);
setDownload.append(ImageUtil.getDownloadUrl(paperCard, backFace));
downloadUrls.add(setDownload.toString());
} else if (prefix.equals(ImageKeys.TOKEN_PREFIX)) {
if (tokenImages == null) {
tokenImages = new HashMap<>();