Pinned sources now listed first in global search
This commit is contained in:
parent
1cca914c8f
commit
b809f57950
1 changed files with 2 additions and 0 deletions
|
@ -102,11 +102,13 @@ open class SourceSearchPresenter(
|
||||||
protected open fun getEnabledSources(): List<CatalogueSource> {
|
protected open fun getEnabledSources(): List<CatalogueSource> {
|
||||||
val languages = preferencesHelper.enabledLanguages().getOrDefault()
|
val languages = preferencesHelper.enabledLanguages().getOrDefault()
|
||||||
val hiddenCatalogues = preferencesHelper.hiddenSources().getOrDefault()
|
val hiddenCatalogues = preferencesHelper.hiddenSources().getOrDefault()
|
||||||
|
val pinnedCatalogues = preferencesHelper.pinnedCatalogues().getOrDefault()
|
||||||
|
|
||||||
return sourceManager.getCatalogueSources()
|
return sourceManager.getCatalogueSources()
|
||||||
.filter { it.lang in languages }
|
.filter { it.lang in languages }
|
||||||
.filterNot { it.id.toString() in hiddenCatalogues }
|
.filterNot { it.id.toString() in hiddenCatalogues }
|
||||||
.sortedBy { "(${it.lang}) ${it.name}" }
|
.sortedBy { "(${it.lang}) ${it.name}" }
|
||||||
|
.sortedBy { it.id.toString() !in pinnedCatalogues }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getSourcesToQuery(): List<CatalogueSource> {
|
private fun getSourcesToQuery(): List<CatalogueSource> {
|
||||||
|
|
Reference in a new issue