Remove 'outer' label from mapNotNull

This commit is contained in:
Jace 2022-11-13 10:31:09 +08:00
parent 53a6e4affb
commit 4c592763b6

View file

@ -294,23 +294,23 @@ object PluginManager {
//Log.i(TAG, "providerLang => ${providerLang.toJson()}") //Log.i(TAG, "providerLang => ${providerLang.toJson()}")
// Iterate online repos and returns not downloaded plugins // Iterate online repos and returns not downloaded plugins
val notDownloadedPlugins = onlinePlugins.mapNotNull outer@{ onlineData -> val notDownloadedPlugins = onlinePlugins.mapNotNull { onlineData ->
val sitePlugin = onlineData.second val sitePlugin = onlineData.second
//Don't include empty urls //Don't include empty urls
if (sitePlugin.url.isBlank()) { return@outer null } if (sitePlugin.url.isBlank()) { return@mapNotNull null }
if (sitePlugin.repositoryUrl.isNullOrBlank()) { return@outer null } if (sitePlugin.repositoryUrl.isNullOrBlank()) { return@mapNotNull null }
//Omit already existing plugins //Omit already existing plugins
if (getPluginPath(activity, sitePlugin.internalName, onlineData.first).exists()) { if (getPluginPath(activity, sitePlugin.internalName, onlineData.first).exists()) {
Log.i(TAG, "Skip > ${sitePlugin.internalName}") Log.i(TAG, "Skip > ${sitePlugin.internalName}")
return@outer null return@mapNotNull null
} }
//Omit lang not selected on language setting //Omit lang not selected on language setting
val lang = sitePlugin.language ?: return@outer null val lang = sitePlugin.language ?: return@mapNotNull null
//If set to 'universal', don't skip any language //If set to 'universal', don't skip any language
if (!providerLang.contains(AllLanguagesName) && !providerLang.contains(lang)) { if (!providerLang.contains(AllLanguagesName) && !providerLang.contains(lang)) {
return@outer null return@mapNotNull null
} }
//Log.i(TAG, "sitePlugin lang => $lang") //Log.i(TAG, "sitePlugin lang => $lang")
@ -318,7 +318,7 @@ object PluginManager {
sitePlugin.tvTypes?.let { tvtypes -> sitePlugin.tvTypes?.let { tvtypes ->
if (!settingsForProvider.enableAdult) { if (!settingsForProvider.enableAdult) {
if (tvtypes.contains(TvType.NSFW.name)) { if (tvtypes.contains(TvType.NSFW.name)) {
return@outer null return@mapNotNull null
} }
} }
} }