From e12455612740aa25ca7b2d140912551d5ceebb44 Mon Sep 17 00:00:00 2001 From: Ellet Date: Sun, 23 Jun 2024 18:56:19 +0300 Subject: [PATCH] refactor: rename all variable names that override to end with override for consistency --- admin/src/main/kotlin/gui/tabs/ModsConverterTab.kt | 8 ++++---- admin/src/main/kotlin/launchers/LauncherDataSource.kt | 2 +- .../kotlin/launchers/atLauncher/ATLauncherDataSource.kt | 4 ++-- .../launchers/modrinth/ModrinthLauncherDataSource.kt | 2 +- .../launchers/prismLauncher/PrismLauncherDataSource.kt | 4 ++-- .../main/kotlin/services/modsConverter/ModsConverter.kt | 2 +- .../kotlin/services/modsConverter/ModsConverterImpl.kt | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/admin/src/main/kotlin/gui/tabs/ModsConverterTab.kt b/admin/src/main/kotlin/gui/tabs/ModsConverterTab.kt index 55969cc..5d40c8e 100644 --- a/admin/src/main/kotlin/gui/tabs/ModsConverterTab.kt +++ b/admin/src/main/kotlin/gui/tabs/ModsConverterTab.kt @@ -188,7 +188,7 @@ private class ConversionInputDialog( ), JButton("Continue").onClick { convertMods( - overrideCurseForgeApiKey = null, + curseForgeApiKeyOverride = null, isCurseForgeForStudiosTermsOfServiceAccepted = false, ) }, @@ -198,7 +198,7 @@ private class ConversionInputDialog( } private fun convertMods( - overrideCurseForgeApiKey: String?, + curseForgeApiKeyOverride: String?, isCurseForgeForStudiosTermsOfServiceAccepted: Boolean, ) { coroutineScope.launch { @@ -208,7 +208,7 @@ private class ConversionInputDialog( launcherInstanceDirectoryPath = launcherInstanceDirectoryTextField.text, convertMode = modsConvertModeComboBox.getSelectedItemOrThrow(), prettyFormat = prettyFormatCheckBox.isSelected, - overrideCurseForgeApiKey = overrideCurseForgeApiKey, + curseForgeApiKeyOverride = curseForgeApiKeyOverride, isCurseForgeForStudiosTermsOfServiceAccepted = isCurseForgeForStudiosTermsOfServiceAccepted, ) when (result) { @@ -330,7 +330,7 @@ private class ConversionInputDialog( return@launch } convertMods( - overrideCurseForgeApiKey = userCurseForgeApiKey, + curseForgeApiKeyOverride = userCurseForgeApiKey, isCurseForgeForStudiosTermsOfServiceAccepted = true, ) } diff --git a/admin/src/main/kotlin/launchers/LauncherDataSource.kt b/admin/src/main/kotlin/launchers/LauncherDataSource.kt index 5bb8383..62932c5 100644 --- a/admin/src/main/kotlin/launchers/LauncherDataSource.kt +++ b/admin/src/main/kotlin/launchers/LauncherDataSource.kt @@ -34,6 +34,6 @@ interface LauncherDataSource { * */ suspend fun getMods( launcherInstanceDirectory: File, - overrideCurseForgeApiKey: String?, + curseForgeApiKeyOverride: String?, ): Result> } diff --git a/admin/src/main/kotlin/launchers/atLauncher/ATLauncherDataSource.kt b/admin/src/main/kotlin/launchers/atLauncher/ATLauncherDataSource.kt index 4f30198..8a57fbe 100644 --- a/admin/src/main/kotlin/launchers/atLauncher/ATLauncherDataSource.kt +++ b/admin/src/main/kotlin/launchers/atLauncher/ATLauncherDataSource.kt @@ -65,7 +65,7 @@ class ATLauncherDataSource : LauncherDataSource { override suspend fun getMods( launcherInstanceDirectory: File, - overrideCurseForgeApiKey: String?, + curseForgeApiKeyOverride: String?, ): Result> = try { val instance = getInstance(launcherInstanceDirectory = launcherInstanceDirectory).getOrThrow() @@ -92,7 +92,7 @@ class ATLauncherDataSource : LauncherDataSource { .getModFile( modId = atLauncherMod.curseForgeProjectId.toString(), fileId = atLauncherMod.curseForgeFileId.toString(), - overrideApiKey = overrideCurseForgeApiKey, + overrideApiKey = curseForgeApiKeyOverride, ).getOrThrow() downloadUrl = curseForgeModFile.data.downloadUrl fileIntegrityInfo = curseForgeModFile.data.getFileIntegrityInfo() diff --git a/admin/src/main/kotlin/launchers/modrinth/ModrinthLauncherDataSource.kt b/admin/src/main/kotlin/launchers/modrinth/ModrinthLauncherDataSource.kt index 70f03d4..ffe14ab 100644 --- a/admin/src/main/kotlin/launchers/modrinth/ModrinthLauncherDataSource.kt +++ b/admin/src/main/kotlin/launchers/modrinth/ModrinthLauncherDataSource.kt @@ -35,7 +35,7 @@ class ModrinthLauncherDataSource : LauncherDataSource { override suspend fun getMods( launcherInstanceDirectory: File, - overrideCurseForgeApiKey: String?, + curseForgeApiKeyOverride: String?, ): Result> = try { val instance = getInstance(launcherInstanceDirectory = launcherInstanceDirectory).getOrThrow() diff --git a/admin/src/main/kotlin/launchers/prismLauncher/PrismLauncherDataSource.kt b/admin/src/main/kotlin/launchers/prismLauncher/PrismLauncherDataSource.kt index 84036f9..78fea0e 100644 --- a/admin/src/main/kotlin/launchers/prismLauncher/PrismLauncherDataSource.kt +++ b/admin/src/main/kotlin/launchers/prismLauncher/PrismLauncherDataSource.kt @@ -79,7 +79,7 @@ class PrismLauncherDataSource : LauncherDataSource { override suspend fun getMods( launcherInstanceDirectory: File, - overrideCurseForgeApiKey: String?, + curseForgeApiKeyOverride: String?, ): Result> = try { // TODO: use File.exist(), check of File.exist() might need to be shared to avoid duplications @@ -108,7 +108,7 @@ class PrismLauncherDataSource : LauncherDataSource { modId = prismLauncherModMetadata.update.curseForge.projectId .toString(), - overrideApiKey = overrideCurseForgeApiKey, + overrideApiKey = curseForgeApiKeyOverride, ).getOrThrow() .data } diff --git a/admin/src/main/kotlin/services/modsConverter/ModsConverter.kt b/admin/src/main/kotlin/services/modsConverter/ModsConverter.kt index 10ab388..59a9bd3 100644 --- a/admin/src/main/kotlin/services/modsConverter/ModsConverter.kt +++ b/admin/src/main/kotlin/services/modsConverter/ModsConverter.kt @@ -13,7 +13,7 @@ interface ModsConverter { launcherInstanceDirectoryPath: String, convertMode: ModsConvertMode, prettyFormat: Boolean, - overrideCurseForgeApiKey: String?, + curseForgeApiKeyOverride: String?, isCurseForgeForStudiosTermsOfServiceAccepted: Boolean, ): ModsConvertResult } diff --git a/admin/src/main/kotlin/services/modsConverter/ModsConverterImpl.kt b/admin/src/main/kotlin/services/modsConverter/ModsConverterImpl.kt index 5b5ca32..e223253 100644 --- a/admin/src/main/kotlin/services/modsConverter/ModsConverterImpl.kt +++ b/admin/src/main/kotlin/services/modsConverter/ModsConverterImpl.kt @@ -16,7 +16,7 @@ class ModsConverterImpl : ModsConverter { launcherInstanceDirectoryPath: String, convertMode: ModsConvertMode, prettyFormat: Boolean, - overrideCurseForgeApiKey: String?, + curseForgeApiKeyOverride: String?, isCurseForgeForStudiosTermsOfServiceAccepted: Boolean, ): ModsConvertResult { return try { @@ -64,7 +64,7 @@ class ModsConverterImpl : ModsConverter { launcherDataSource .getMods( launcherInstanceDirectory = launcherInstanceDirectory, - overrideCurseForgeApiKey = overrideCurseForgeApiKey?.ifBlank { null }, + curseForgeApiKeyOverride = curseForgeApiKeyOverride?.ifBlank { null }, ).getOrElse { return ModsConvertResult.Failure( error =