mirror of
https://github.com/mihonapp/mihon.git
synced 2025-02-08 08:15:06 +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,9 +305,10 @@ class LibraryScreenModel(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return mapValues { (key, value) ->
|
return mapValues { (key, value) ->
|
||||||
when (key.sort.type) {
|
if (key.sort.type == LibrarySort.Type.Random) {
|
||||||
LibrarySort.Type.Random -> value.shuffled(Random(libraryPreferences.currentRandomSortSeed().get()))
|
return@mapValues value.shuffled(Random(libraryPreferences.currentRandomSortSeed().get()))
|
||||||
else -> {
|
}
|
||||||
|
|
||||||
val comparator = key.sort.comparator()
|
val comparator = key.sort.comparator()
|
||||||
.let { if (key.sort.isAscending) it else it.reversed() }
|
.let { if (key.sort.isAscending) it else it.reversed() }
|
||||||
.thenComparator(sortAlphabetically)
|
.thenComparator(sortAlphabetically)
|
||||||
@ -315,8 +316,6 @@ class LibraryScreenModel(
|
|||||||
value.sortedWith(comparator)
|
value.sortedWith(comparator)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getLibraryItemPreferencesFlow(): Flow<ItemPreferences> {
|
private fun getLibraryItemPreferencesFlow(): Flow<ItemPreferences> {
|
||||||
return combine(
|
return combine(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user