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) {
|
if (librarySubscription == null || librarySubscription!!.isCancelled) {
|
||||||
librarySubscription = presenterScope.launchIO {
|
librarySubscription = presenterScope.launchIO {
|
||||||
combine(getLibraryFlow(), getTracksPerManga.subscribe(), filterChanges /* SY --> */, groupChanges/* SY <-- */) { library, tracks, _, _ ->
|
combine(
|
||||||
library.mangaMap
|
getLibraryFlow(),
|
||||||
.applyFilters(tracks)
|
getTracksPerManga.subscribe(),
|
||||||
.applySort(library.categories)
|
filterChanges,
|
||||||
// SY -->
|
// SY -->
|
||||||
.applyGrouping(library.categories)
|
groupChanges,
|
||||||
|
libraryPreferences.librarySortingMode().changes(),
|
||||||
|
// SY <--
|
||||||
|
) { library, tracks, _, _, _ ->
|
||||||
|
library.mangaMap
|
||||||
|
// SY -->
|
||||||
|
.applyGrouping(library.categories).let {
|
||||||
|
it.copy(mangaMap = it.mangaMap.applyFilters(tracks).applySort(it.categories))
|
||||||
|
}
|
||||||
// SY <--
|
// SY <--
|
||||||
}
|
}
|
||||||
.collectLatest {
|
.collectLatest {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user