diff --git a/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/window/settings/instance/ModsTab.kt b/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/window/settings/instance/ModsTab.kt index 3000f3b..da6e31e 100644 --- a/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/window/settings/instance/ModsTab.kt +++ b/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/window/settings/instance/ModsTab.kt @@ -127,19 +127,18 @@ class ModsTab(window: InstanceSettingsWindow) : SettingsTab = when (page) { Page.CURSEFORGE -> { - val cf = CurseforgeApi.search(instance.gameVersion, currentSearchString, 0, "Popularity") //TODO allow user to choose sort mode - cf.mapNotNull { + //TODO allow user to choose sort mode + CurseforgeApi.search(instance.gameVersion, currentSearchString, 0, "Popularity").mapNotNull { cf -> if (isCancelled) return@submit - val file = it.latestFilesIndexes.firstOrNull { it.gameVersion == instance.gameVersion } //TODO support compatible minor versions + val file = cf.latestFilesIndexes.firstOrNull { it.gameVersion == instance.gameVersion } //TODO support compatible minor versions if (file == null) null - else CurseforgeModSource(it.id, file.fileId) + else CurseforgeModSource(cf.id, file.fileId) } } Page.MODRINTH -> { - val mr = ModrinthApi.search(currentSearchString, 0, instance.gameVersion, ModrinthProjectType.mod).hits - mr.mapNotNull { + ModrinthApi.search(currentSearchString, 0, instance.gameVersion, ModrinthProjectType.mod).hits.mapNotNull { mr -> if (isCancelled) return@submit - val file = ModrinthApi.getLatestVersions(it.project_id, instance.gameVersion).best + val file = ModrinthApi.getLatestVersions(mr.project_id, instance.gameVersion).best if (file == null) null else ModrinthModSource(file.id) }