Merge pull request #1345 from kiwix/abdulwd/issue1342

Add only distinct zims to local database
This commit is contained in:
Isaac Hutt 2019-08-11 11:50:24 +02:00 committed by GitHub
commit fd0b08cca1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ class NewBookDao @Inject constructor(private val box: Box<BookOnDiskEntity>) {
inValues(BookOnDiskEntity_.bookId, booksOnDisk.map { it.book.id }.toTypedArray())
}
.remove()
box.put(booksOnDisk.map(::BookOnDiskEntity))
box.put(booksOnDisk.distinctBy { it.book.id }.map(::BookOnDiskEntity))
}
}