mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
Fixed image download when name contains ":"
This commit is contained in:
parent
cc306b2119
commit
e049f39cb1
2 changed files with 5 additions and 2 deletions
|
|
@ -456,7 +456,10 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
File temporaryFile = new File(Constants.IO.imageBaseDir + File.separator + card.hashCode() + "." + card.getName() + ".jpg");
|
StringBuilder filePath = new StringBuilder();
|
||||||
|
filePath.append(Constants.IO.imageBaseDir).append(File.separator);
|
||||||
|
filePath.append(card.hashCode()).append(".").append(card.getName().replace(":", "")).append(".jpg");
|
||||||
|
File temporaryFile = new File(filePath.toString());
|
||||||
String imagePath = CardImageUtils.getImagePath(card, imagesPath);
|
String imagePath = CardImageUtils.getImagePath(card, imagesPath);
|
||||||
TFile outputFile = new TFile(imagePath);
|
TFile outputFile = new TFile(imagePath);
|
||||||
if (!outputFile.exists()) {
|
if (!outputFile.exists()) {
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ public class CardImageUtils {
|
||||||
String imageName;
|
String imageName;
|
||||||
|
|
||||||
String type = card.getType() != 0 ? " " + Integer.toString(card.getType()) : "";
|
String type = card.getType() != 0 ? " " + Integer.toString(card.getType()) : "";
|
||||||
String name = card.getName();
|
String name = card.getName().replace(":", "");
|
||||||
|
|
||||||
if (basicLandPattern.matcher(name).matches()) {
|
if (basicLandPattern.matcher(name).matches()) {
|
||||||
imageName = name + "." + card.getCollectorId() + ".full.jpg";
|
imageName = name + "." + card.getCollectorId() + ".full.jpg";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue