Skip to content

Commit

Permalink
Deduplicate.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrant committed Nov 14, 2024
1 parent c016b74 commit f01c17c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/org/wikipedia/page/PageActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,8 @@ class PageActivity : BaseActivity(), PageFragment.Callback, LinkPreviewDialog.Lo

val pages = mutableListOf<MwQueryPage>()
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()) {
Expand Down

0 comments on commit f01c17c

Please sign in to comment.