File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
library/src/commonMain/kotlin/project/pipepipe/app/viewmodel Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -282,11 +282,13 @@ class SearchViewModel() : BaseViewModel<SearchUiState>(SearchUiState()) {
282282 }
283283
284284 // Apply filters
285+ val shouldFilter = result.pagedData?.itemList?.getOrNull(0 ) is StreamInfo
286+
285287 val rawItems = (result.pagedData?.itemList as ? List <StreamInfo >) ? : emptyList()
286- val (filteredItems, _) = FilterHelper .filterStreamInfoList(
288+ val (filteredItems, _) = if (shouldFilter) FilterHelper .filterStreamInfoList(
287289 rawItems,
288290 FilterHelper .FilterScope .SEARCH_RESULT
289- )
291+ ) else Pair (emptyList(), 0 )
290292
291293 setState {
292294 it.copy(
@@ -295,7 +297,7 @@ class SearchViewModel() : BaseViewModel<SearchUiState>(SearchUiState()) {
295297 error = null
296298 ),
297299 list = it.list.copy(
298- itemList = it.list.itemList + filteredItems,
300+ itemList = it.list.itemList + ( if (shouldFilter) filteredItems else result.pagedData?.itemList ? : emptyList()) ,
299301 nextPageUrl = result.pagedData?.nextPageUrl
300302 )
301303 )
You can’t perform that action at this time.
0 commit comments