mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-18 11:55:38 -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
|
import javax.inject.Inject
|
||||||
|
|
||||||
class NewBookmarksDao @Inject constructor(val box: Box<BookmarkEntity>) {
|
class NewBookmarksDao @Inject constructor(val box: Box<BookmarkEntity>) {
|
||||||
fun getBookmarks(fromCurrentBook: Boolean): List<BookmarkItem> {
|
fun getBookmarks(fromCurrentBook: Boolean) = box.query {
|
||||||
return box.query {
|
|
||||||
if (fromCurrentBook) {
|
if (fromCurrentBook) {
|
||||||
equal(BookmarkEntity_.zimId, ZimContentProvider.getId() ?: "")
|
equal(BookmarkEntity_.zimName, ZimContentProvider.getName() ?: "")
|
||||||
}
|
}
|
||||||
order(BookmarkEntity_.bookmarkTitle)
|
order(BookmarkEntity_.bookmarkTitle)
|
||||||
}.find()
|
}.find()
|
||||||
.map(::BookmarkItem)
|
.map(::BookmarkItem)
|
||||||
}
|
|
||||||
|
|
||||||
fun getCurrentZimBookmarksUrl() = box.query {
|
fun getCurrentZimBookmarksUrl() = box.query {
|
||||||
equal(BookmarkEntity_.zimId, ZimContentProvider.getId() ?: "")
|
equal(BookmarkEntity_.zimId, ZimContentProvider.getId() ?: "")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user