mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-03-07 17:36:52 +08:00
Revert "Update ModrinthRemoteModRepository.java"
This reverts commit 40b7c1d59d
.
This commit is contained in:
parent
4404daf0ea
commit
2027c9ef4c
@ -79,9 +79,12 @@ public final class ModrinthRemoteModRepository implements RemoteModRepository {
|
||||
if (StringUtils.isNotBlank(gameVersion)) {
|
||||
facets.add(Collections.singletonList("versions:" + gameVersion));
|
||||
}
|
||||
/*
|
||||
if (StringUtils.isNotBlank(category.getId())) {
|
||||
facets.add(Collections.singletonList("categories:" + category.getId()));
|
||||
}
|
||||
|
||||
*/
|
||||
Map<String, String> query = mapOf(
|
||||
pair("query", searchFilter),
|
||||
pair("facets", JsonUtils.UGLY_GSON.toJson(facets)),
|
||||
@ -135,8 +138,14 @@ public final class ModrinthRemoteModRepository implements RemoteModRepository {
|
||||
}
|
||||
|
||||
public List<Category> getCategoriesImpl() throws IOException {
|
||||
List<Category> reorganizedCategories = new ArrayList<>();
|
||||
List<Category> categories = HttpRequest.GET(PREFIX + "/v2/tag/category").getJson(new TypeToken<List<Category>>() {}.getType());
|
||||
return categories.stream().filter(category -> category.getProjectType().equals(projectType)).collect(Collectors.toList());
|
||||
for (Category category : categories) {
|
||||
if (category.getProjectType().equals(projectType)) {
|
||||
reorganizedCategories.add(category);
|
||||
}
|
||||
}
|
||||
return reorganizedCategories;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user