mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
PaperToken: cleanup imageKey without collectorNumber
This commit is contained in:
@@ -62,8 +62,7 @@ public class PaperToken implements InventoryItemFromSet, IPaperCard {
|
|||||||
this.collectorNumber = collectorNumber;
|
this.collectorNumber = collectorNumber;
|
||||||
this.artist = artist;
|
this.artist = artist;
|
||||||
|
|
||||||
if (edition != null && edition.getTokens().containsKey(imageFileName)) {
|
if (collectorNumber != null && !collectorNumber.isEmpty() && edition != null && edition.getTokens().containsKey(imageFileName)) {
|
||||||
if (collectorNumber != null && !collectorNumber.isEmpty()) {
|
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
// count the one with the same collectorNumber
|
// count the one with the same collectorNumber
|
||||||
for (CardEdition.TokenInSet t : edition.getTokens().get(imageFileName)) {
|
for (CardEdition.TokenInSet t : edition.getTokens().get(imageFileName)) {
|
||||||
@@ -76,15 +75,11 @@ public class PaperToken implements InventoryItemFromSet, IPaperCard {
|
|||||||
this.imageFileName.add(String.format("%s|%s|%s|%d", imageFileName, edition.getCode().toLowerCase(), collectorNumber, idx));
|
this.imageFileName.add(String.format("%s|%s|%s|%d", imageFileName, edition.getCode().toLowerCase(), collectorNumber, idx));
|
||||||
}
|
}
|
||||||
this.artIndex = this.imageFileName.size();
|
this.artIndex = this.imageFileName.size();
|
||||||
}
|
} else if (null == edition || CardEdition.UNKNOWN == edition) {
|
||||||
} else if (imageFileName != null) {
|
|
||||||
String formatEdition = null == edition || CardEdition.UNKNOWN == edition ? "" : "_" + edition.getCode().toLowerCase();
|
|
||||||
|
|
||||||
if (null == edition || CardEdition.UNKNOWN == edition) {
|
|
||||||
this.imageFileName.add(imageFileName);
|
this.imageFileName.add(imageFileName);
|
||||||
}
|
} else {
|
||||||
// Fallback for if the Edition doesn't know about the Token
|
// Fallback if CollectorNumber is not used
|
||||||
this.imageFileName.add(String.format("%s|%s", imageFileName, formatEdition));
|
this.imageFileName.add(String.format("%s|%s", imageFileName, edition.getCode().toLowerCase()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user