kopia lustrzana https://github.com/JOSM/MapWithAI
Partially Revert "Remove unnecessary code and modify tests"
This reverts commit ba93db04a61cd779d3e8ad2706637a560c273173. Signed-off-by: Taylor Smock <taylor.smock@kaart.com>pull/1/head
rodzic
71eb63c135
commit
348c324275
|
@ -78,6 +78,27 @@ public final class MapWithAIPreferenceHelper {
|
||||||
returnMap.add(layerMap);
|
returnMap.add(layerMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (returnMap.isEmpty()) {
|
||||||
|
final List<String> defaultAPIs = Collections.singletonList(DEFAULT_MAPWITHAI_API);
|
||||||
|
final List<String> defaultList = Config.getPref().getList(API_CONFIG).isEmpty() ? defaultAPIs
|
||||||
|
: Config.getPref().getList(API_CONFIG);
|
||||||
|
returnMap.addAll(defaultList.stream().map(string -> {
|
||||||
|
final TreeMap<String, String> map = new TreeMap<>();
|
||||||
|
map.put(URL_STRING, string);
|
||||||
|
return map;
|
||||||
|
}).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
returnMap.parallelStream().forEach(map -> {
|
||||||
|
final String url = map.get(URL_STRING);
|
||||||
|
if (DEFAULT_MAPWITHAI_API.equals(url)) {
|
||||||
|
map.putIfAbsent(SOURCE_STRING, MapWithAIPlugin.NAME);
|
||||||
|
map.putIfAbsent(ENABLED_STRING, "true");
|
||||||
|
map.putIfAbsent(PARAMETERS_STRING, DEFAULT_MAPWITHAI_API_PARAMETERS);
|
||||||
|
} else {
|
||||||
|
map.putIfAbsent(SOURCE_STRING, url);
|
||||||
|
map.putIfAbsent(ENABLED_STRING, Boolean.FALSE.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
return returnMap;
|
return returnMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue