Hide hidden sources from sources filter

This commit is contained in:
Jobobby04 2022-05-04 23:15:16 -04:00
parent cdebb6db67
commit 7b470640b6

View File

@ -4,6 +4,7 @@ import eu.kanade.domain.source.model.Source
import eu.kanade.domain.source.repository.SourceRepository import eu.kanade.domain.source.repository.SourceRepository
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.util.system.LocaleHelper
import exh.source.BlacklistedSources
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.combine
@ -18,7 +19,7 @@ class GetLanguagesWithSources(
preferences.disabledSources().asFlow(), preferences.disabledSources().asFlow(),
repository.getOnlineSources() repository.getOnlineSources()
) { enabledLanguage, disabledSource, onlineSources -> ) { enabledLanguage, disabledSource, onlineSources ->
val sortedSources = onlineSources.sortedWith( val sortedSources = onlineSources.filterNot { it.id in BlacklistedSources.HIDDEN_SOURCES }.sortedWith(
compareBy<Source> { it.id.toString() in disabledSource } compareBy<Source> { it.id.toString() in disabledSource }
.thenBy(String.CASE_INSENSITIVE_ORDER) { it.name } .thenBy(String.CASE_INSENSITIVE_ORDER) { it.name }
) )