pull/2102/head
kunfei 2 years ago
parent 13d0adc1b1
commit 3c56acbd96
  1. 2
      app/src/main/java/io/legado/app/model/CacheBook.kt
  2. 1
      app/src/main/java/io/legado/app/service/CacheBookService.kt

@ -161,6 +161,7 @@ object CacheBook {
fun stop() { fun stop() {
waitDownloadSet.clear() waitDownloadSet.clear()
isStopped = true isStopped = true
postEvent(EventBus.UP_DOWNLOAD, book.bookUrl)
} }
@Synchronized @Synchronized
@ -171,6 +172,7 @@ object CacheBook {
waitDownloadSet.add(i) waitDownloadSet.add(i)
} }
} }
postEvent(EventBus.UP_DOWNLOAD, book.bookUrl)
} }
@Synchronized @Synchronized

@ -85,7 +85,6 @@ class CacheBookService : BaseService() {
execute { execute {
val cacheBook = CacheBook.getOrCreate(bookUrl) ?: return@execute val cacheBook = CacheBook.getOrCreate(bookUrl) ?: return@execute
cacheBook.addDownload(start, end) cacheBook.addDownload(start, end)
postEvent(EventBus.UP_DOWNLOAD, "")
upNotification(CacheBook.downloadSummary) upNotification(CacheBook.downloadSummary)
if (downloadJob == null) { if (downloadJob == null) {
download() download()

Loading…
Cancel
Save