Fix sorting and filtering for grouping library
This commit is contained in:
parent
61c2aee0c4
commit
e943b4ed09
@ -213,12 +213,20 @@ class LibraryPresenter(
|
||||
*/
|
||||
if (librarySubscription == null || librarySubscription!!.isCancelled) {
|
||||
librarySubscription = presenterScope.launchIO {
|
||||
combine(getLibraryFlow(), getTracksPerManga.subscribe(), filterChanges /* SY --> */, groupChanges/* SY <-- */) { library, tracks, _, _ ->
|
||||
combine(
|
||||
getLibraryFlow(),
|
||||
getTracksPerManga.subscribe(),
|
||||
filterChanges,
|
||||
// SY -->
|
||||
groupChanges,
|
||||
libraryPreferences.librarySortingMode().changes(),
|
||||
// SY <--
|
||||
) { library, tracks, _, _, _ ->
|
||||
library.mangaMap
|
||||
.applyFilters(tracks)
|
||||
.applySort(library.categories)
|
||||
// SY -->
|
||||
.applyGrouping(library.categories)
|
||||
.applyGrouping(library.categories).let {
|
||||
it.copy(mangaMap = it.mangaMap.applyFilters(tracks).applySort(it.categories))
|
||||
}
|
||||
// SY <--
|
||||
}
|
||||
.collectLatest {
|
||||
|
Loading…
x
Reference in New Issue
Block a user