diff --git a/core/util/src/main/res/values/strings.xml b/core/util/src/main/res/values/strings.xml index 8b4b8a6a1..5f667a7f4 100644 --- a/core/util/src/main/res/values/strings.xml +++ b/core/util/src/main/res/values/strings.xml @@ -197,7 +197,7 @@ %1$d selected - All providers has been installed! + All providers have been installed! Checking for updates… Link has been copied You could open a github issue and paste this stack trace. diff --git a/data/provider/src/main/kotlin/com/flixclusive/data/provider/ProviderManager.kt b/data/provider/src/main/kotlin/com/flixclusive/data/provider/ProviderManager.kt index b7e80a536..5424fa76c 100644 --- a/data/provider/src/main/kotlin/com/flixclusive/data/provider/ProviderManager.kt +++ b/data/provider/src/main/kotlin/com/flixclusive/data/provider/ProviderManager.kt @@ -139,8 +139,11 @@ class ProviderManager @Inject constructor( = providerSettings.providers.any { it.filePath == providerFile.absolutePath }.not() + val isNotUpdaterJsonFile + = !providerFile.name + .equals("updater.json", true) - if (isProviderNotYetLoaded) { + if (isProviderNotYetLoaded && isNotUpdaterJsonFile) { appSettingsManager.updateProviderSettings { it.copy( providers = @@ -179,7 +182,7 @@ class ProviderManager @Inject constructor( val providerData = updaterJsonList.find { it.name.plus(".flx").equals(providerName, true) } if (providerData == null) { - errorLog("Provider cannot be found on the updater.json file!") + errorLog("Provider [$providerName] cannot be found on the updater.json file!") return } @@ -352,9 +355,12 @@ class ProviderManager @Inject constructor( val provider = providers[providerData.name] val file = context.provideValidProviderPath(providerData) - if (provider != null && file.exists()) { - unloadProvider(provider, file) + if (provider == null || !file.exists()) { + errorLog("Provider [${providerData.name}] not found. Cannot be unloaded") + return } + + unloadProvider(provider, file) } /** @@ -367,9 +373,12 @@ class ProviderManager @Inject constructor( val provider = providers[providerPreference.name] val file = File(providerPreference.filePath) - if (provider != null && file.exists()) { - unloadProvider(provider, file) + if (provider == null || !file.exists()) { + errorLog("Provider [${providerPreference.name}] not found. Cannot be unloaded") + return } + + unloadProvider(provider, file) } private suspend fun unloadProvider(