1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-03 17:00:16 -09:00

Refactor images path code

This commit is contained in:
Oleg Agafonov 2018-05-02 00:16:41 +04:00
parent e767c79429
commit 4d31294ee9

View file

@ -212,20 +212,11 @@ public final class CardImageUtils {
String finalFileName = ""; String finalFileName = "";
if (card.getUsesVariousArt()) { if (card.getUsesVariousArt()) {
finalFileName = cardName + '.' + card.getCollectorId() + ".full.jpg"; // different arts uses name + collector id
finalFileName = cardName + prefixType + '.' + card.getCollectorId() + ".full.jpg";
} else { } else {
if (card.getUsesVariousArt()) { // basic arts uses name
// only various arts can be same name, but different postfixes (a,b,c,d,e) finalFileName = cardName + prefixType + ".full.jpg";
int len = card.getCollectorId().length();
if (Character.isLetter(card.getCollectorId().charAt(len - 1))) {
finalFileName = cardName + card.getCollectorId().charAt(len - 1) + ".full.jpg";
} else {
finalFileName = cardName + prefixType + ".full.jpg";
}
} else {
// normal cards with same names;
finalFileName = cardName + prefixType + ".full.jpg";
}
} }
// if image file exists, correct name (for case sensitive systems) // if image file exists, correct name (for case sensitive systems)