Change sources sort to case-insensitive (#3743)
(cherry picked from commit 4b493ebbaf879a532305a5e6b13930dc6784d721) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/MigrationSourcesPresenter.kt # app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceFilterController.kt
This commit is contained in:
parent
a5a79c1127
commit
d83361dfe3
@ -112,7 +112,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
|
||||
.forEach {
|
||||
val preferenceBlock = {
|
||||
it.value
|
||||
.sortedWith(compareBy({ !it.isEnabled() }, { it.name }))
|
||||
.sortedWith(compareBy({ !it.isEnabled() }, { it.name.toLowerCase() }))
|
||||
.forEach { source ->
|
||||
val sourcePrefs = mutableListOf<Preference>()
|
||||
|
||||
|
@ -32,7 +32,7 @@ class MigrationSourcesPresenter(
|
||||
return library.map { it.source }.toSet()
|
||||
// SY -->
|
||||
.mapNotNull { if (it != LocalSource.ID && it != MERGED_SOURCE_ID) sourceManager.getOrStub(it) else null }
|
||||
.sortedBy { it.name.toLowerCase(Locale.ROOT) }
|
||||
.sortedBy { it.name.toLowerCase() }
|
||||
// SY <--
|
||||
.map { SourceItem(it, header) }
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ class SourceFilterController : SettingsController() {
|
||||
}
|
||||
|
||||
private fun sortedSources(sources: List<HttpSource>?): List<HttpSource> {
|
||||
val sourceAlpha = sources.orEmpty().sortedBy { it.name }
|
||||
val sourceAlpha = sources.orEmpty().sortedBy { it.name.toLowerCase() }
|
||||
return if (sorting == SourcesSort.Enabled) {
|
||||
val disabledSourceIds = preferences.disabledSources().get()
|
||||
sourceAlpha.filter { it.id.toString() !in disabledSourceIds } +
|
||||
|
@ -183,7 +183,7 @@ class SourcePresenter(
|
||||
return sourceManager.getVisibleCatalogueSources()
|
||||
.filter { it.lang in languages }
|
||||
.filterNot { it.id.toString() in disabledSourceIds }
|
||||
.sortedBy { "(${it.lang}) ${it.name}" } +
|
||||
.sortedBy { "(${it.lang}) ${it.name.toLowerCase()}" } +
|
||||
sourceManager.get(LocalSource.ID) as LocalSource
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ open class GlobalSearchPresenter(
|
||||
return sourceManager.getVisibleCatalogueSources()
|
||||
.filter { it.lang in languages }
|
||||
.filterNot { it.id.toString() in disabledSourceIds }
|
||||
.sortedWith(compareBy({ it.id.toString() !in pinnedSourceIds }, { "${it.name} (${it.lang})" }))
|
||||
.sortedWith(compareBy({ it.id.toString() !in pinnedSourceIds }, { "${it.name.toLowerCase()} (${it.lang})" }))
|
||||
}
|
||||
|
||||
private fun getSourcesToQuery(): List<CatalogueSource> {
|
||||
@ -190,7 +190,7 @@ open class GlobalSearchPresenter(
|
||||
{ it.results.isNullOrEmpty() },
|
||||
// Same as initial sort, i.e. pinned first then alphabetically
|
||||
{ it.source.id.toString() !in pinnedSourceIds },
|
||||
{ "${it.source.name} (${it.source.lang})" }
|
||||
{ "${it.source.name.toLowerCase()} (${it.source.lang})" }
|
||||
)
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user