|
|
|
@ -203,14 +203,12 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
|
|
|
|
|
List<PluginModel> pluginModels = new ArrayList<>(); |
|
|
|
|
String version = "v" + ProductConstants.MAIN_VERSION; |
|
|
|
|
if (!Collections.isEmpty(jsonObjects)) { |
|
|
|
|
jsonObjects = jsonObjects.stream() |
|
|
|
|
pluginModels = jsonObjects.stream() |
|
|
|
|
.filter(o -> ((Integer) o.get(version)) == 1) |
|
|
|
|
.sorted(Comparator.comparingLong(PluginSearchManager::parseTime).reversed()) |
|
|
|
|
.sorted((Map map1, Map map2) -> Long.compare(parseTime(map2), parseTime(map1))) |
|
|
|
|
.limit(DEFAULT_LIST_SIZE) |
|
|
|
|
.map(jsonObject -> getPluginModel(new JSONObject(jsonObject), false)) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
for (Map jsonObject : jsonObjects) { |
|
|
|
|
pluginModels.add(getPluginModel(new JSONObject(jsonObject), false)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return pluginModels; |
|
|
|
|
} |
|
|
|
|