pull/52/head
kunfei 5 years ago
parent 97f9b1575c
commit df470fcb2a
  1. 3
      app/src/main/java/io/legado/app/service/DownloadService.kt

@ -40,12 +40,13 @@ class DownloadService : BaseService() {
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
tasks.clear()
searchPool.close() searchPool.close()
} }
private fun download(bookUrl: String?, start: Int, end: Int) { private fun download(bookUrl: String?, start: Int, end: Int) {
if (bookUrl == null) return if (bookUrl == null) return
val task = Coroutine.async { val task = Coroutine.async(this) {
val book = App.db.bookDao().getBook(bookUrl) ?: return@async val book = App.db.bookDao().getBook(bookUrl) ?: return@async
val bookSource = App.db.bookSourceDao().getBookSource(book.origin) ?: return@async val bookSource = App.db.bookSourceDao().getBookSource(book.origin) ?: return@async
val webBook = WebBook(bookSource) val webBook = WebBook(bookSource)

Loading…
Cancel
Save