From fc9bfe539599f4f988e0e827dd26e25704128eb4 Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 9 Sep 2021 23:02:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/model/CacheBook.kt | 4 ++-- app/src/main/java/io/legado/app/service/CacheBookService.kt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/CacheBook.kt b/app/src/main/java/io/legado/app/model/CacheBook.kt index 766069e33..ab88bbfab 100644 --- a/app/src/main/java/io/legado/app/model/CacheBook.kt +++ b/app/src/main/java/io/legado/app/model/CacheBook.kt @@ -70,10 +70,10 @@ class CacheBook(var bookSource: BookSource, var book: Book) { } } - fun start(context: Context, book: Book, start: Int, end: Int) { + fun start(context: Context, bookUrl: String, start: Int, end: Int) { context.startService { action = IntentAction.start - putExtra("bookUrl", book.bookUrl) + putExtra("bookUrl", bookUrl) putExtra("start", start) putExtra("end", end) } diff --git a/app/src/main/java/io/legado/app/service/CacheBookService.kt b/app/src/main/java/io/legado/app/service/CacheBookService.kt index 7d411775d..4bfc21b20 100644 --- a/app/src/main/java/io/legado/app/service/CacheBookService.kt +++ b/app/src/main/java/io/legado/app/service/CacheBookService.kt @@ -76,6 +76,7 @@ class CacheBookService : BaseService() { execute { val cacheBook = CacheBook.getOrCreate(bookUrl) ?: return@execute cacheBook.addDownload(start, end) + upNotification(CacheBook.downloadSummary) if (downloadJob == null) { download() }