Co-Authored-By: arkon <4098258+arkon@users.noreply.github.com>
This commit is contained in:
Jays2Kings 2021-05-06 15:29:58 -04:00
parent a503d95bec
commit e4b5f084a9
2 changed files with 8 additions and 3 deletions

View File

@ -185,7 +185,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
val prefs = mutableListOf<Preference>()
val block: (@DSL SwitchPreferenceCompat).() -> Unit = {
key = source.getPreferenceKey()
key = source.getPreferenceKey() + "_enabled"
title = when {
isMultiSource && !isMultiLangSingleSource -> source.toString()
else -> LocaleHelper.getSourceDisplayName(source.lang, context)

View File

@ -53,12 +53,17 @@ class SourceItem(val source: CatalogueSource, header: LangItem? = null, val isPi
override fun equals(other: Any?): Boolean {
if (other is SourceItem) {
return source.id == other.source.id && header?.code == other.header?.code
return source.id == other.source.id &&
header?.code == other.header?.code &&
isPinned == other.isPinned
}
return false
}
override fun hashCode(): Int {
return source.id.hashCode() + (header?.code?.hashCode() ?: 0).toInt()
var result = source.id.hashCode()
result = 31 * result + (header?.hashCode() ?: 0)
result = 31 * result + isPinned.hashCode()
return result
}
}