mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Revert "Remove provider language (#141)"
This reverts commit a43e950a48
.
This commit is contained in:
parent
64303eab8d
commit
ddae2ddf3c
5 changed files with 13 additions and 36 deletions
|
@ -18,7 +18,8 @@ import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTvSet
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils.toJson
|
import com.lagradost.cloudstream3.utils.AppUtils.toJson
|
||||||
import com.lagradost.cloudstream3.utils.Coroutines.threadSafeListOf
|
import com.lagradost.cloudstream3.utils.Coroutines.threadSafeListOf
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
import com.lagradost.cloudstream3.utils.SubtitleHelper
|
import com.lagradost.cloudstream3.utils.Qualities
|
||||||
|
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
@ -193,26 +194,17 @@ object APIHolder {
|
||||||
return list.filter { names.contains(it) }.map { DubStatus.valueOf(it) }.toHashSet()
|
return list.filter { names.contains(it) }.map { DubStatus.valueOf(it) }.toHashSet()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets all the activated provider languages
|
|
||||||
* Used to obey the preference provider_lang_key
|
|
||||||
* but it turned out too complicated and unnecessary with extensions.
|
|
||||||
**/
|
|
||||||
fun Context.getApiProviderLangSettings(): HashSet<String> {
|
fun Context.getApiProviderLangSettings(): HashSet<String> {
|
||||||
val langs = apis.map { it.lang }.toSet()
|
val settingsManager = PreferenceManager.getDefaultSharedPreferences(this)
|
||||||
.sortedBy { SubtitleHelper.fromTwoLettersToLanguage(it) }
|
val hashSet = HashSet<String>()
|
||||||
return langs.toHashSet()
|
hashSet.add("en") // def is only en
|
||||||
|
val list = settingsManager.getStringSet(
|
||||||
|
this.getString(R.string.provider_lang_key),
|
||||||
|
hashSet.toMutableSet()
|
||||||
|
)
|
||||||
|
|
||||||
// val settingsManager = PreferenceManager.getDefaultSharedPreferences(this)
|
if (list.isNullOrEmpty()) return hashSet
|
||||||
// val hashSet = HashSet<String>()
|
return list.toHashSet()
|
||||||
// hashSet.add("en") // def is only en
|
|
||||||
// val list = settingsManager.getStringSet(
|
|
||||||
// this.getString(R.string.provider_lang_key),
|
|
||||||
// hashSet.toMutableSet()
|
|
||||||
// )
|
|
||||||
//
|
|
||||||
// if (list.isNullOrEmpty()) return hashSet
|
|
||||||
// return list.toHashSet()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.getApiTypeSettings(): HashSet<TvType> {
|
fun Context.getApiTypeSettings(): HashSet<TvType> {
|
||||||
|
|
|
@ -96,7 +96,7 @@ class SetupFragmentExtensions : Fragment() {
|
||||||
next_btt?.setOnClickListener {
|
next_btt?.setOnClickListener {
|
||||||
// Continue setup
|
// Continue setup
|
||||||
if (isSetup)
|
if (isSetup)
|
||||||
findNavController().navigate(R.id.action_navigation_setup_extensions_to_navigation_setup_media)
|
findNavController().navigate(R.id.action_navigation_setup_extensions_to_navigation_setup_provider_languages)
|
||||||
else
|
else
|
||||||
findNavController().navigate(R.id.navigation_home)
|
findNavController().navigate(R.id.navigation_home)
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ class SetupFragmentLanguage : Fragment() {
|
||||||
&& PluginManager.getPluginsLocal().isEmpty()
|
&& PluginManager.getPluginsLocal().isEmpty()
|
||||||
//&& PREBUILT_REPOSITORIES.isNotEmpty()
|
//&& PREBUILT_REPOSITORIES.isNotEmpty()
|
||||||
) R.id.action_navigation_global_to_navigation_setup_extensions
|
) R.id.action_navigation_global_to_navigation_setup_extensions
|
||||||
else R.id.action_navigation_setup_language_to_navigation_setup_media
|
else R.id.action_navigation_setup_language_to_navigation_setup_provider_languages
|
||||||
|
|
||||||
findNavController().navigate(
|
findNavController().navigate(
|
||||||
nextDestination,
|
nextDestination,
|
||||||
|
|
|
@ -522,13 +522,6 @@
|
||||||
app:exitAnim="@anim/exit_anim"
|
app:exitAnim="@anim/exit_anim"
|
||||||
app:popEnterAnim="@anim/enter_anim"
|
app:popEnterAnim="@anim/enter_anim"
|
||||||
app:popExitAnim="@anim/exit_anim" />
|
app:popExitAnim="@anim/exit_anim" />
|
||||||
<action
|
|
||||||
android:id="@+id/action_navigation_setup_language_to_navigation_setup_media"
|
|
||||||
app:destination="@id/navigation_setup_media"
|
|
||||||
app:enterAnim="@anim/enter_anim"
|
|
||||||
app:exitAnim="@anim/exit_anim"
|
|
||||||
app:popEnterAnim="@anim/enter_anim"
|
|
||||||
app:popExitAnim="@anim/exit_anim" />
|
|
||||||
</fragment>
|
</fragment>
|
||||||
|
|
||||||
<action
|
<action
|
||||||
|
@ -560,13 +553,6 @@
|
||||||
app:exitAnim="@anim/exit_anim"
|
app:exitAnim="@anim/exit_anim"
|
||||||
app:popEnterAnim="@anim/enter_anim"
|
app:popEnterAnim="@anim/enter_anim"
|
||||||
app:popExitAnim="@anim/exit_anim" />
|
app:popExitAnim="@anim/exit_anim" />
|
||||||
<action
|
|
||||||
android:id="@+id/action_navigation_setup_extensions_to_navigation_setup_media"
|
|
||||||
app:destination="@id/navigation_setup_media"
|
|
||||||
app:enterAnim="@anim/enter_anim"
|
|
||||||
app:exitAnim="@anim/exit_anim"
|
|
||||||
app:popEnterAnim="@anim/enter_anim"
|
|
||||||
app:popExitAnim="@anim/exit_anim" />
|
|
||||||
</fragment>
|
</fragment>
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<Preference
|
<Preference
|
||||||
app:isPreferenceVisible="false"
|
|
||||||
android:icon="@drawable/ic_baseline_language_24"
|
android:icon="@drawable/ic_baseline_language_24"
|
||||||
android:key="@string/provider_lang_key"
|
android:key="@string/provider_lang_key"
|
||||||
android:title="@string/provider_lang_settings" />
|
android:title="@string/provider_lang_settings" />
|
||||||
|
|
Loading…
Reference in a new issue