fix for decks with cards in development (that have no valid setinfo)

This commit is contained in:
Maxmtg
2011-09-11 14:53:18 +00:00
parent ee204a4aa9
commit b5cdcb3f9e
2 changed files with 9 additions and 3 deletions

View File

@@ -105,9 +105,9 @@ public final class CardDb {
String cardName = name;
if (pipePos >= 0) {
cardName = name.substring(0, pipePos);
String setName = name.substring(pipePos + 1);
String setName = name.substring(pipePos + 1).trim();
// only if set is not blank try to load it
if (StringUtils.isNotBlank(setName)) {
if (StringUtils.isNotBlank(setName) && !"???".equals(setName)) {
return getCard(cardName, setName);
}
}

View File

@@ -507,7 +507,13 @@ public class DeckManager {
List<Entry<CardPrinted, Integer>> main2sort = pool.getOrderedList();
Collections.sort(main2sort, TableSorter.byNameThenSet);
for (Entry<CardPrinted, Integer> e : main2sort) {
out.write(format("%d %s|%s%n", e.getValue(), e.getKey().getName(), e.getKey().getSet()));
CardPrinted card = e.getKey();
boolean hasBadSetInfo = "???".equals(card.getSet()) || StringUtils.isBlank(card.getSet());
if (hasBadSetInfo) {
out.write(format("%d %s%n", e.getValue(), card.getName()));
} else {
out.write(format("%d %s|%s%n", e.getValue(), card.getName(), card.getSet()));
}
}
}