mirror of
https://github.com/mihonapp/mihon.git
synced 2025-02-08 00:05:02 +01:00
Update app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
parent
2eb1580788
commit
078758391e
@ -305,16 +305,15 @@ class LibraryScreenModel(
|
||||
}
|
||||
|
||||
return mapValues { (key, value) ->
|
||||
when (key.sort.type) {
|
||||
LibrarySort.Type.Random -> value.shuffled(Random(libraryPreferences.currentRandomSortSeed().get()))
|
||||
else -> {
|
||||
val comparator = key.sort.comparator()
|
||||
.let { if (key.sort.isAscending) it else it.reversed() }
|
||||
.thenComparator(sortAlphabetically)
|
||||
if (key.sort.type == LibrarySort.Type.Random) {
|
||||
return@mapValues value.shuffled(Random(libraryPreferences.currentRandomSortSeed().get()))
|
||||
}
|
||||
|
||||
value.sortedWith(comparator)
|
||||
}
|
||||
}
|
||||
val comparator = key.sort.comparator()
|
||||
.let { if (key.sort.isAscending) it else it.reversed() }
|
||||
.thenComparator(sortAlphabetically)
|
||||
|
||||
value.sortedWith(comparator)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user