Fixing multiple spaces causing issues in the card filter

This commit is contained in:
Christian 'ketura' McCarty
2025-01-01 18:03:45 -06:00
parent ff443011fd
commit f9a6f11ef4

View File

@@ -250,7 +250,7 @@ public class SortAndFilterCards {
// any combination of the two.
//Note that this coerces the key into lowercase
private Map<String, List<String>> parseFilterParams(String filter) {
String[] params = filter.split(" ");
String[] params = filter.split(" +");
Map<String, List<String>> result = new HashMap<>();
for (String param : params) {
@@ -260,6 +260,9 @@ public class SortAndFilterCards {
var parts = param.split(":");
String key = parts[0].toLowerCase();
if(parts.length < 2)
continue;
if(!result.containsKey(key)) {
var list = new ArrayList<>(Arrays.stream(parts[1].split(",")).toList());
result.put(key, list);