Skip to content

Commit 9f3a9e2

Browse files
Fixed: Only one ZIM file was displayed when multiple ZIM files had the same title and language.
* The issue occurred because ZIM files in the local library were being filtered based on their title and language. As a result, if multiple ZIM files shared the same title and language (e.g., English), only one of them was shown on the Local Library screen. * Since each ZIM file has a unique bookId, we now remove duplicates based on the bookId instead.
1 parent 3092c09 commit 9f3a9e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/kiwix/kiwixmobile/core/data/Repository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class Repository @Inject internal constructor(
7474
} else {
7575
listOf(bookOnDisk)
7676
}
77-
}.distinctBy { it.book.language to it.book.title }
77+
}.distinctBy { it.book.id }
7878
.sortedBy { it.book.language + it.book.title }
7979
}
8080
.map { items ->

0 commit comments

Comments
 (0)