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:
Jack Hamilton 2024-10-11 21:07:17 -05:00 committed by GitHub
parent 2eb1580788
commit 078758391e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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(