mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-07-26 22:42:17 +00:00
fix: remove unnecessary sorting and adjust type options in SearchRepository; add spacer in SearchScreen
This commit is contained in:
parent
d998c2d7b4
commit
b11988ecbb
2 changed files with 3 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ fun SearchScreen(
|
|||
placeholder = "Search movies, shows...",
|
||||
)
|
||||
}
|
||||
androidx.compose.foundation.layout.Spacer(modifier = Modifier.height(14.dp))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue