mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-16 19:05:27 -04:00
#1323 Bookmarks are not permanent over ZIM files update
This commit is contained in:
parent
189e1b4b9f
commit
45d7953f22
@ -26,15 +26,13 @@ import org.kiwix.kiwixmobile.database.newdb.entities.BookmarkEntity_
|
||||
import javax.inject.Inject
|
||||
|
||||
class NewBookmarksDao @Inject constructor(val box: Box<BookmarkEntity>) {
|
||||
fun getBookmarks(fromCurrentBook: Boolean): List<BookmarkItem> {
|
||||
return box.query {
|
||||
if (fromCurrentBook) {
|
||||
equal(BookmarkEntity_.zimId, ZimContentProvider.getId() ?: "")
|
||||
}
|
||||
order(BookmarkEntity_.bookmarkTitle)
|
||||
}.find()
|
||||
.map(::BookmarkItem)
|
||||
}
|
||||
fun getBookmarks(fromCurrentBook: Boolean) = box.query {
|
||||
if (fromCurrentBook) {
|
||||
equal(BookmarkEntity_.zimName, ZimContentProvider.getName() ?: "")
|
||||
}
|
||||
order(BookmarkEntity_.bookmarkTitle)
|
||||
}.find()
|
||||
.map(::BookmarkItem)
|
||||
|
||||
fun getCurrentZimBookmarksUrl() = box.query {
|
||||
equal(BookmarkEntity_.zimId, ZimContentProvider.getId() ?: "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user