mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-16 23:12:12 +00:00
feat: Add local filters to Trakt Library view all screen
- Added "All", "Movies", and "Series" FilterChips to the `CatalogHeader`. - Computed `filteredItems` to apply filtering for the Trakt Library screen based on the item type (movies vs series/tv). - Applied Material Theme `FilterChipDefaults` properties to ensure accurate theming. - Filter out aggressive loading of next pages if a filter other than 'All' is currently selected to avoid consecutive requests for missing data matching conditions.
This commit is contained in:
parent
b73cccc43b
commit
074cbfe864
3 changed files with 14 additions and 1 deletions
|
|
@ -111,7 +111,7 @@ fun CatalogScreen(
|
|||
lastVisible >= layoutInfo.totalItemsCount - 6
|
||||
}
|
||||
.distinctUntilChanged()
|
||||
.filter { it && uiState.canLoadMore && !uiState.isLoading }
|
||||
.filter { it && uiState.canLoadMore && !uiState.isLoading && selectedFilter == 0 } // Prevent aggressive fetching when filtered
|
||||
.collect {
|
||||
CatalogRepository.loadMore()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ import com.nuvio.app.core.ui.NuvioNetworkOfflineCard
|
|||
import coil3.compose.AsyncImage
|
||||
import com.nuvio.app.core.format.formatReleaseDateForDisplay
|
||||
import com.nuvio.app.core.ui.NuvioBackButton
|
||||
import com.nuvio.app.features.catalog.INTERNAL_LIBRARY_MANIFEST_URL
|
||||
import com.nuvio.app.core.ui.rememberPosterCardStyleUiState
|
||||
import com.nuvio.app.core.ui.posterCardClickable
|
||||
import com.nuvio.app.core.ui.nuvioSafeBottomPadding
|
||||
|
|
|
|||
12
patch4.diff
Normal file
12
patch4.diff
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
--- composeApp/src/commonMain/kotlin/com/nuvio/app/features/catalog/CatalogScreen.kt
|
||||
+++ composeApp/src/commonMain/kotlin/com/nuvio/app/features/catalog/CatalogScreen.kt
|
||||
@@ -107,7 +107,7 @@
|
||||
val lastVisible = layoutInfo.visibleItemsInfo.lastOrNull()?.index ?: -1
|
||||
lastVisible >= layoutInfo.totalItemsCount - 6
|
||||
}
|
||||
.distinctUntilChanged()
|
||||
- .filter { it && uiState.canLoadMore && !uiState.isLoading }
|
||||
+ .filter { it && uiState.canLoadMore && !uiState.isLoading && selectedFilter == 0 } // Prevent aggressive fetching when filtered
|
||||
.collect {
|
||||
CatalogRepository.loadMore()
|
||||
}
|
||||
Loading…
Reference in a new issue