diff --git a/app/src/main/java/io/legado/app/data/dao/BookmarkDao.kt b/app/src/main/java/io/legado/app/data/dao/BookmarkDao.kt index 14e852352..16fdff455 100644 --- a/app/src/main/java/io/legado/app/data/dao/BookmarkDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/BookmarkDao.kt @@ -8,8 +8,8 @@ import io.legado.app.data.entities.Bookmark @Dao interface BookmarkDao { - @Query("select * from bookmarks") - fun all(): List + @get:Query("select * from bookmarks") + val all: List @Query("select * from bookmarks where bookUrl = :bookUrl or (bookName = :bookName and bookAuthor = :bookAuthor)") fun observeByBook( diff --git a/app/src/main/java/io/legado/app/help/storage/Backup.kt b/app/src/main/java/io/legado/app/help/storage/Backup.kt index 5b1e88186..135330690 100644 --- a/app/src/main/java/io/legado/app/help/storage/Backup.kt +++ b/app/src/main/java/io/legado/app/help/storage/Backup.kt @@ -42,6 +42,7 @@ object Backup { withContext(IO) { synchronized(this@Backup) { writeListToJson(App.db.bookDao().all, "bookshelf.json", backupPath) + writeListToJson(App.db.bookmarkDao().all, "bookmark.json", backupPath) writeListToJson(App.db.bookGroupDao().all, "bookGroup.json", backupPath) writeListToJson(App.db.bookSourceDao().all, "bookSource.json", backupPath) writeListToJson(App.db.rssSourceDao().all, "rssSource.json", backupPath) diff --git a/app/src/main/java/io/legado/app/help/storage/Restore.kt b/app/src/main/java/io/legado/app/help/storage/Restore.kt index bed5cd7ce..c2c527ddd 100644 --- a/app/src/main/java/io/legado/app/help/storage/Restore.kt +++ b/app/src/main/java/io/legado/app/help/storage/Restore.kt @@ -113,6 +113,9 @@ object Restore { fileToListT(path, "bookshelf.json")?.let { App.db.bookDao().insert(*it.toTypedArray()) } + fileToListT(path, "bookmark.json")?.let { + App.db.bookmarkDao().insert(*it.toTypedArray()) + } fileToListT(path, "bookGroup.json")?.let { App.db.bookGroupDao().insert(*it.toTypedArray()) }