Fix Local and Other lang sources showing up in seperate Other Categories (#6024)
* group LocalSource and Other lang source together * use better kotlin syntactic sugar * add lang "other" to local * remove duplicate LocalSource entries in Browse * linting * revert unnecessary linting was a manually adding change * Revert previous two commit but not the most recent This reverts commit 30250f2f82fc5e38a1b30c7b55c445efec23a114 This also reversts commit 359ed5a8cda91577216b593a4138280e971e0126 * better way to avoid duplicate Local Sources * more linting by plugin * `""` lang is no longer used anywhere (cherry picked from commit 2d1404d15523484d5f900ae3808c7f31058c2a8c) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcePresenter.kt
This commit is contained in:
parent
353a3ffe00
commit
1d80725ea9
@ -82,7 +82,7 @@ class LocalSource(private val context: Context) : CatalogueSource {
|
||||
|
||||
override val id = ID
|
||||
override val name = context.getString(R.string.local_source)
|
||||
override val lang = ""
|
||||
override val lang = "other"
|
||||
override val supportsLatest = true
|
||||
|
||||
override fun toString() = context.getString(R.string.local_source)
|
||||
|
@ -179,10 +179,9 @@ class SourcePresenter(
|
||||
val disabledSourceIds = preferences.disabledSources().get()
|
||||
|
||||
return sourceManager.getVisibleCatalogueSources()
|
||||
.filter { it.lang in languages }
|
||||
.filter { it.lang in languages || it.id == LocalSource.ID }
|
||||
.filterNot { it.id.toString() in disabledSourceIds }
|
||||
.sortedBy { "(${it.lang}) ${it.name.lowercase()}" } +
|
||||
sourceManager.get(LocalSource.ID) as LocalSource
|
||||
.sortedBy { "(${it.lang}) ${it.name.lowercase()}" }
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@ -21,9 +21,9 @@ object LocaleHelper {
|
||||
}
|
||||
// SY <--
|
||||
return when (lang) {
|
||||
"" -> context.getString(R.string.other_source)
|
||||
SourcePresenter.LAST_USED_KEY -> context.getString(R.string.last_used_source)
|
||||
SourcePresenter.PINNED_KEY -> context.getString(R.string.pinned_sources)
|
||||
"other" -> context.getString(R.string.other_source)
|
||||
"all" -> context.getString(R.string.all_lang)
|
||||
else -> getDisplayName(lang)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user