From f01c17c8a20192ef3f57f71106d7ea67cb71a3de Mon Sep 17 00:00:00 2001 From: Dmitry Brant Date: Thu, 14 Nov 2024 16:33:07 -0500 Subject: [PATCH] Deduplicate. --- app/src/main/java/org/wikipedia/page/PageActivity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/wikipedia/page/PageActivity.kt b/app/src/main/java/org/wikipedia/page/PageActivity.kt index 0d0c1f9812a..d3ff8f458f9 100644 --- a/app/src/main/java/org/wikipedia/page/PageActivity.kt +++ b/app/src/main/java/org/wikipedia/page/PageActivity.kt @@ -835,8 +835,8 @@ class PageActivity : BaseActivity(), PageFragment.Callback, LinkPreviewDialog.Lo val pages = mutableListOf() historyEntries.forEach { entry -> - val response = ServiceFactory.get(title.wikiSite).searchMoreLike("morelike:${entry.apiTitle}", 5, 5) - response.query?.pages?.let { pages.addAll(it) } + val response = ServiceFactory.get(title.wikiSite).searchMoreLike("morelike:${entry.apiTitle}", 10, 10) + response.query?.pages?.filter { it.title != historyEntries[0].apiTitle && it.title != historyEntries[1].apiTitle }?.take(5)?.let { pages.addAll(it) } } if (pages.isNotEmpty()) {