Case insensitive sort in Source tab (#7067)

This commit is contained in:
FourTOne5 2022-05-03 18:45:34 +06:00 committed by GitHub
parent ed8a54bd2a
commit 55a1cdb1c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,7 @@ class GetEnabledSources(
sources sources
.filter { it.lang in enabledLanguages || it.id == LocalSource.ID } .filter { it.lang in enabledLanguages || it.id == LocalSource.ID }
.filterNot { it.id.toString() in disabledSources } .filterNot { it.id.toString() in disabledSources }
.sortedBy { it.name } .sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { it.name })
.flatMap { .flatMap {
val flag = if ("${it.id}" in pinnedSourceIds) Pins.pinned else Pins.unpinned val flag = if ("${it.id}" in pinnedSourceIds) Pins.pinned else Pins.unpinned
val source = it.copy(pin = flag) val source = it.copy(pin = flag)