Skip to content

Commit

Permalink
Fix empty response in faphub category (#993)
Browse files Browse the repository at this point in the history
**Background**

Right now we filter in incorrect way faphub category items

**Changes**

Distinct items inside content request, not after

**Test plan**

Try open category folder and switch between sort type
  • Loading branch information
LionZXY authored Nov 26, 2024
1 parent b5f3df1 commit bcebc1c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# 1.8.1 - In Progress

- [FIX] Fix empty response in faphub category
- [FIX] New file manager uploading progress
- [FIX] Fix build when no metrics enabled

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class FapsListViewModel @Inject constructor(
PagingConfig(pageSize = FAPS_PAGE_SIZE)
) {
FapsPagingSource(fapNetworkApi, sortType, target, hiddenItems)
}.flow
}.flatMapLatest { it }.distinctBy { it.id }.cachedIn(viewModelScope)
}.flow.distinctBy { it.id }
}.flatMapLatest { it }.cachedIn(viewModelScope)

fun getFapsFlow(): Flow<PagingData<FapItemShort>> = faps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class FapHubCategoryViewModel @AssistedInject constructor(
PagingConfig(pageSize = FAPS_PAGE_SIZE)
) {
FapsCategoryPagingSource(fapNetworkApi, category, sortType, target, hiddenItems)
}.flow
}.flatMapLatest { it }.distinctBy { it.id }.cachedIn(viewModelScope)
}.flow.distinctBy { it.id }
}.flatMapLatest { it }.cachedIn(viewModelScope)

fun getFapsFlow() = faps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class FapHubSearchViewModel @Inject constructor(
}
Pager(PagingConfig(pageSize = FAPS_PAGE_SIZE)) {
FapsSearchPagingSource(fapNetworkApi, searchRequest, target, hiddenItems)
}.flow
}.flatMapLatest { it }.distinctBy { it.id }.cachedIn(viewModelScope)
}.flow.distinctBy { it.id }
}.flatMapLatest { it }.cachedIn(viewModelScope)

fun getSearchRequest() = searchRequestFlow.asStateFlow()

Expand Down

0 comments on commit bcebc1c

Please sign in to comment.