mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Remove 'outer' label from mapNotNull
This commit is contained in:
parent
53a6e4affb
commit
4c592763b6
1 changed files with 7 additions and 7 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue