From 733cf99bb4bdb85aa3d2c941d058d4a10816a0bd Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 26 Dec 2021 11:34:56 -0500 Subject: [PATCH] Fix incorrect locale name casing in extension details (fixes #6391) Also closing https://github.com/tachiyomiorg/tachiyomi-extensions/issues/10007 since multisource extensions aren't really a thing anymore. --- .../details/ExtensionDetailsController.kt | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsController.kt index 89acafbb3b..68c2582997 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsController.kt @@ -36,7 +36,6 @@ import eu.kanade.tachiyomi.ui.base.controller.openInBrowser import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.util.preference.DSL import eu.kanade.tachiyomi.util.preference.onChange -import eu.kanade.tachiyomi.util.preference.preferenceCategory import eu.kanade.tachiyomi.util.preference.switchPreference import eu.kanade.tachiyomi.util.preference.switchSettingsPreference import eu.kanade.tachiyomi.util.system.LocaleHelper @@ -122,11 +121,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) : .map { source -> LocaleHelper.getSourceDisplayName(source.lang, context) to source } .sortedWith(compareBy({ (_, source) -> !source.isEnabled() }, { (lang, _) -> lang.lowercase() })) .forEach { (lang, source) -> - val preferenceBlock = { - sourceSwitchPreference(source, LocaleHelper.getSourceDisplayName(lang, context)) - } - - preferenceBlock() + sourceSwitchPreference(source, lang) } } @@ -135,19 +130,11 @@ class ExtensionDetailsController(bundle: Bundle? = null) : .groupBy { (it as CatalogueSource).lang } .toSortedMap(compareBy { LocaleHelper.getSourceDisplayName(it, context) }) .forEach { entry -> - val preferenceBlock = { - entry.value - .sortedWith(compareBy({ source -> !source.isEnabled() }, { source -> source.name.lowercase() })) - .forEach { source -> - sourceSwitchPreference(source, source.toString()) - } - } - - preferenceCategory { - title = LocaleHelper.getSourceDisplayName(entry.key, context) - - preferenceBlock() - } + entry.value + .sortedWith(compareBy({ source -> !source.isEnabled() }, { source -> source.name.lowercase() })) + .forEach { source -> + sourceSwitchPreference(source, source.toString()) + } } }