pull/52/head
kunfei 5 years ago
parent e8fb9b0694
commit a9221654f6
  1. 20
      app/src/main/java/io/legado/app/service/DownloadService.kt

@ -50,16 +50,18 @@ class DownloadService : BaseService() {
val webBook = WebBook(bookSource) val webBook = WebBook(bookSource)
for (index in start..end) { for (index in start..end) {
App.db.bookChapterDao().getChapter(bookUrl, index)?.let { chapter -> App.db.bookChapterDao().getChapter(bookUrl, index)?.let { chapter ->
webBook.getContent(book, chapter, scope = this, context = searchPool) if (!BookHelp.hasContent(book, chapter)) {
.onStart { webBook.getContent(book, chapter, scope = this, context = searchPool)
updateNotification("${chapter.title}开始下载") .onStart {
} updateNotification("${chapter.title}开始下载")
.onSuccess { content ->
content?.let {
BookHelp.saveContent(book, chapter, content)
} }
updateNotification("${chapter.title}下载完成") .onSuccess { content ->
} content?.let {
BookHelp.saveContent(book, chapter, content)
}
updateNotification("${chapter.title}下载完成")
}
}
} }
} }
} }

Loading…
Cancel
Save