mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
* HQ Image source mtgImage - Removed wrong set name conversion. Fixed name creation for split cards.
This commit is contained in:
parent
73e0cfb91a
commit
b930c5aae7
1 changed files with 8 additions and 8 deletions
|
|
@ -28,12 +28,8 @@
|
||||||
|
|
||||||
package org.mage.plugins.card.dl.sources;
|
package org.mage.plugins.card.dl.sources;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import mage.cards.SplitCard;
|
||||||
import java.util.Map;
|
|
||||||
import static javax.swing.UIManager.put;
|
|
||||||
import mage.client.dialog.PreferencesDialog;
|
|
||||||
import org.mage.plugins.card.images.CardDownloadData;
|
import org.mage.plugins.card.images.CardDownloadData;
|
||||||
import org.mage.plugins.card.utils.CardImageUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -58,11 +54,15 @@ public class MtgImageSource implements CardImageSource {
|
||||||
if (collectorId == null || cardSet == null) {
|
if (collectorId == null || cardSet == null) {
|
||||||
throw new Exception("Wrong parameters for image: collector id: " + collectorId + ",card set: " + cardSet);
|
throw new Exception("Wrong parameters for image: collector id: " + collectorId + ",card set: " + cardSet);
|
||||||
}
|
}
|
||||||
String set = CardImageUtils.updateSet(cardSet, true);
|
|
||||||
|
|
||||||
StringBuilder url = new StringBuilder("http://mtgimage.com/set/");
|
StringBuilder url = new StringBuilder("http://mtgimage.com/set/");
|
||||||
url.append(set.toUpperCase()).append("/").append(card.getName());
|
url.append(cardSet.toUpperCase()).append("/");
|
||||||
|
|
||||||
|
if (card.isSplitCard()) {
|
||||||
|
url.append(card.getName().replaceAll(" // ", ""));
|
||||||
|
} else {
|
||||||
|
url.append(card.getName());
|
||||||
|
}
|
||||||
|
|
||||||
if (card.isTwoFacedCard()) {
|
if (card.isTwoFacedCard()) {
|
||||||
url.append(card.isSecondSide() ? "b" : "a");
|
url.append(card.isSecondSide() ? "b" : "a");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue