Fix local source not working if english was disabled. Closes #848
Cette révision appartient à :
Parent
5fec956ce6
révision
74a7e2a17e
2 fichiers modifiés avec 4 ajouts et 7 suppressions
|
@ -57,7 +57,7 @@ class LocalSource(private val context: Context) : CatalogueSource {
|
|||
|
||||
override val id = ID
|
||||
override val name = "LocalSource"
|
||||
override val lang = "en"
|
||||
override val lang = ""
|
||||
override val supportsLatest = true
|
||||
|
||||
override fun toString() = context.getString(R.string.local_source)
|
||||
|
|
|
@ -11,6 +11,7 @@ import eu.kanade.tachiyomi.data.database.models.MangaCategory
|
|||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.data.preference.getOrDefault
|
||||
import eu.kanade.tachiyomi.source.CatalogueSource
|
||||
import eu.kanade.tachiyomi.source.LocalSource
|
||||
import eu.kanade.tachiyomi.source.Source
|
||||
import eu.kanade.tachiyomi.source.SourceManager
|
||||
import eu.kanade.tachiyomi.source.model.Filter
|
||||
|
@ -303,15 +304,11 @@ open class CataloguePresenter(
|
|||
val languages = prefs.enabledLanguages().getOrDefault()
|
||||
val hiddenCatalogues = prefs.hiddenCatalogues().getOrDefault()
|
||||
|
||||
// Ensure at least one language
|
||||
if (languages.isEmpty()) {
|
||||
languages.add("en")
|
||||
}
|
||||
|
||||
return sourceManager.getCatalogueSources()
|
||||
.filter { it.lang in languages }
|
||||
.filterNot { it.id.toString() in hiddenCatalogues }
|
||||
.sortedBy { "(${it.lang}) ${it.name}" }
|
||||
.sortedBy { "(${it.lang}) ${it.name}" } +
|
||||
sourceManager.get(LocalSource.ID) as LocalSource
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Référencer dans un nouveau ticket