Merge remote-tracking branch 'upstream/master' into fix-deck-editor-custom-editions-image-view

This commit is contained in:
leriomaggio
2021-05-31 09:12:32 +01:00
86 changed files with 1020 additions and 227 deletions

View File

@@ -194,10 +194,15 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
} catch (NumberFormatException ex) {
String nonNumeric = sortableCollNr.replaceAll("[0-9]", "");
String onlyNumeric = sortableCollNr.replaceAll("[^0-9]", "");
if (sortableCollNr.startsWith(onlyNumeric)) // e.g. 12a, 37+, 2018f,
sortableCollNr = String.format("%05d", Integer.parseInt(onlyNumeric)) + nonNumeric;
try {
collNr = Integer.parseInt(onlyNumeric);
} catch (NumberFormatException exon) {
collNr = 0; // this is the case of ONLY-letters collector numbers
}
if ((collNr > 0) && (sortableCollNr.startsWith(onlyNumeric))) // e.g. 12a, 37+, 2018f,
sortableCollNr = String.format("%05d", collNr) + nonNumeric;
else // e.g. WS6, S1
sortableCollNr = nonNumeric + String.format("%05d", Integer.parseInt(onlyNumeric));
sortableCollNr = nonNumeric + String.format("%05d", collNr);
}
return sortableCollNr;
}