Fix #3644: 修复下载 - 模组界面无法正常翻页、Category 会在切换下载源时出错的问题 (#3768)

This commit is contained in:
Burning_TNT
2025-04-09 11:35:56 +08:00
committed by GitHub
parent a3cb871928
commit c33ef5170b
3 changed files with 26 additions and 15 deletions

View File

@@ -102,7 +102,9 @@ public final class CurseForgeRemoteModRepository implements RemoteModRepository
@Override
public SearchResult search(String gameVersion, @Nullable RemoteModRepository.Category category, int pageOffset, int pageSize, String searchFilter, SortType sortType, SortOrder sortOrder) throws IOException {
int categoryId = 0;
if (category != null) categoryId = ((CurseAddon.Category) category.getSelf()).getId();
if (category != null && category.getSelf() instanceof CurseAddon.Category) {
categoryId = ((CurseAddon.Category) category.getSelf()).getId();
}
Response<List<CurseAddon>> response = HttpRequest.GET(PREFIX + "/v1/mods/search",
pair("gameId", "432"),
pair("classId", Integer.toString(section)),