Skip to content

Commit

Permalink
0.9.7.2: Fixed myWykop entries duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
feelfreelinux committed Nov 2, 2018
1 parent 69a415f commit dcbdd2e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Expand Up @@ -6,13 +6,15 @@ class EntryLink(
) {
override fun equals(other: Any?): Boolean {
return if (other !is EntryLink) false
else (other.link != null && link != null && other.link!!.id == link!!.id && other.entry != null && entry != null && other.entry!!.id == entry!!.id)
else (other.hashCode() == hashCode())
}

override fun hashCode(): Int {
return link?.hashCode() ?: entry!!.hashCode()
}



companion object {
const val TYPE_LINK = "LINK"
const val TYPE_ENTRY = "ENTRY"
Expand Down
Expand Up @@ -38,7 +38,7 @@ class EntryLinksAdapter @Inject constructor(

override fun addData(items: List<EntryLink>, shouldClearAdapter: Boolean) {
super.addData(
items.filterNot { settingsPreferencesApi.hideBlacklistedViews && if (it.entry != null) it.entry!!.isBlocked else it.link!!.isBlocked },
items.asSequence().filter { !dataset.contains(it) }.filterNot { settingsPreferencesApi.hideBlacklistedViews && if (it.entry != null) it.entry!!.isBlocked else it.link!!.isBlocked }.toList(),
shouldClearAdapter
)
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -27,7 +27,7 @@ allprojects {
versionMajor = 0
versionMinor = 9
versionPatch = 7
versionBuild = 1
versionBuild = 2
}
}

Expand Down

0 comments on commit dcbdd2e

Please sign in to comment.