fix: remove unnecessary sorting and adjust type options in SearchRepository; add spacer in SearchScreen

This commit is contained in:
tapframe 2026-03-30 13:49:27 +05:30
parent d998c2d7b4
commit b11988ecbb
2 changed files with 3 additions and 5 deletions

View file

@ -84,7 +84,6 @@ object SearchRepository {
val sections = results
.mapNotNull { it.getOrNull() }
.sortedBy { it.title.lowercase() }
val firstFailure = results.firstNotNullOfOrNull { it.exceptionOrNull()?.message }
val allFailed = results.isNotEmpty() && results.all { it.isFailure }
@ -138,7 +137,7 @@ object SearchRepository {
}
val current = _discoverUiState.value
val typeOptions = sources.map { it.type }.distinct().sortedBy { it.typeSortKey() }
val typeOptions = sources.map { it.type }.distinct()
val selectedType = current.selectedType
?.takeIf { type -> typeOptions.contains(type) }
?: typeOptions.first()
@ -279,9 +278,7 @@ object SearchRepository {
supportsPagination = catalog.supportsPagination(),
)
}
}.sortedWith(
compareBy<DiscoverCatalogOption>({ it.type.typeSortKey() }, { it.addonName.lowercase() }, { it.catalogName.lowercase() }),
)
}
private suspend fun SearchCatalogRequest.toSection(): HomeCatalogSection {
val manifest = requireNotNull(addon.manifest)

View file

@ -140,6 +140,7 @@ fun SearchScreen(
placeholder = "Search movies, shows...",
)
}
androidx.compose.foundation.layout.Spacer(modifier = Modifier.height(14.dp))
}
}