diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 562e97c02..25114ef87 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -3,6 +3,10 @@ * 请关注公众号[开源阅读]()支持我,同时关注合作公众号[小说拾遗](),阅读公众号小编。 * 新公众号[开源阅读]()已启用,[开源阅读软件]()备用 +**2020/06/16** +* 刷新时只刷新当前书架 +* 修复恢复备份需要退出重进的问题 + **2020/06/15** * 添加 E-Ink 模式 by Modificator * 修复发现打开书时可能的错误 diff --git a/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt b/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt index 61c951ae5..4dcd3560d 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt @@ -4,6 +4,7 @@ import android.app.Application import io.legado.app.App import io.legado.app.base.BaseViewModel import io.legado.app.constant.EventBus +import io.legado.app.data.entities.Book import io.legado.app.data.entities.RssSource import io.legado.app.help.http.HttpHelper import io.legado.app.help.storage.Restore @@ -17,9 +18,9 @@ import kotlinx.coroutines.delay class MainViewModel(application: Application) : BaseViewModel(application) { val updateList = hashSetOf() - fun upChapterList() { + fun upChapterList(books: List) { execute { - App.db.bookDao().hasUpdateBooks.forEach { book -> + books.forEach { book -> if (!updateList.contains(book.bookUrl)) { App.db.bookSourceDao().getBookSource(book.origin)?.let { bookSource -> synchronized(this) { diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt index e061a510e..f9346c7ef 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt @@ -67,7 +67,7 @@ class BooksFragment : BaseFragment(R.layout.fragment_books), refresh_layout.setColorSchemeColors(accentColor) refresh_layout.setOnRefreshListener { refresh_layout.isRefreshing = false - activityViewModel.upChapterList() + activityViewModel.upChapterList(booksAdapter.getItems()) } val bookshelfLayout = getPrefInt(PreferKey.bookshelfLayout) if (bookshelfLayout == 0) {