mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 19:55:11 +01:00
when grouping by tags, tags with different casing will be grouped together
This commit is contained in:
parent
71872df9d0
commit
a03ee4943f
@ -25,6 +25,7 @@ import eu.kanade.tachiyomi.ui.library.filter.FilterBottomSheet
|
||||
import eu.kanade.tachiyomi.ui.library.filter.FilterBottomSheet.Companion.STATE_EXCLUDE
|
||||
import eu.kanade.tachiyomi.ui.library.filter.FilterBottomSheet.Companion.STATE_IGNORE
|
||||
import eu.kanade.tachiyomi.ui.library.filter.FilterBottomSheet.Companion.STATE_INCLUDE
|
||||
import eu.kanade.tachiyomi.util.lang.capitalizeWords
|
||||
import eu.kanade.tachiyomi.util.lang.removeArticles
|
||||
import eu.kanade.tachiyomi.util.system.executeOnIO
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
@ -536,7 +537,7 @@ class LibraryPresenter(
|
||||
listOf("Unknown")
|
||||
} else {
|
||||
manga.genre?.split(",")?.mapNotNull {
|
||||
val tag = it.trim()
|
||||
val tag = it.trim().capitalizeWords()
|
||||
if (tag.isBlank()) null else tag
|
||||
} ?: listOf("Unknown")
|
||||
}
|
||||
|
@ -35,6 +35,11 @@ fun String.truncateCenter(count: Int, replacement: String = "..."): String {
|
||||
return "${take(pieceLength)}$replacement${takeLast(pieceLength)}"
|
||||
}
|
||||
|
||||
fun String.capitalizeWords(): String {
|
||||
val firstReplace = split(" ").joinToString(" ") { it.capitalize() }
|
||||
return firstReplace.split("-").joinToString("-") { it.capitalize() }
|
||||
}
|
||||
|
||||
/**
|
||||
* Case-insensitive natural comparator for strings.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user