diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt index 71e2001a6..74c963763 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt @@ -65,17 +65,15 @@ class BookshelfViewModel(application: Application) : BaseViewModel(application) origin = bookSource.bookSourceUrl, originName = bookSource.bookSourceName ) - suspend { - WebBook(bookSource).getBookInfo(book, this) - .onSuccess(IO) { - it?.let { book -> - App.db.bookDao().insert(book) - successCount++ - } - }.onError { - throw Exception(it.localizedMessage) + WebBook(bookSource).getBookInfo(book, this) + .onSuccess(IO) { + it?.let { book -> + App.db.bookDao().insert(book) + successCount++ } - } + }.onError { + throw Exception(it.localizedMessage) + } } } }.onSuccess {