remove duplicate LocalSource entries in Browse

This commit is contained in:
curche 2021-10-04 13:13:50 +05:30
parent 1acc2d60e0
commit 30250f2f82

View File

@ -119,11 +119,13 @@ class SourcePresenter(
val languages = preferences.enabledLanguages().get()
val disabledSourceIds = preferences.disabledSources().get()
val localSource = sourceManager.get(LocalSource.ID)
return sourceManager.getCatalogueSources()
.filter { it.lang in languages }
.filterNot { it.id.toString() in disabledSourceIds }
.filterNot { it.id.toString() == localSource.toString() }
.sortedBy { "(${it.lang}) ${it.name.lowercase()}" } +
sourceManager.get(LocalSource.ID) as LocalSource
localSource as LocalSource
}
companion object {