Remove hash comment when rebuilding JSON database

This commit is contained in:
md678685 2018-08-25 16:54:09 +01:00
parent fec655a29c
commit 1be7fbd8a6

View File

@ -99,7 +99,10 @@ public class FlatItemDbProvider extends ItemDbProvider {
@Override
public void rebuild(List<String> lines) {
String json = String.join("\n", lines);
String json = lines.stream()
.filter(line -> !line.startsWith("#"))
.collect(Collectors.joining("\n"));
JsonObject map = (new JsonParser()).parse(json).getAsJsonObject();
for (Map.Entry<String, JsonElement> entry : map.entrySet()) {