优化下载

pull/1298/head
gedoor 3 years ago
parent 2977b2aab4
commit 54eeb31767
  1. 9
      app/src/main/java/io/legado/app/service/CacheBookService.kt

@ -58,7 +58,7 @@ class CacheBookService : BaseService() {
intent.getIntExtra("end", 0) intent.getIntExtra("end", 0)
) )
IntentAction.remove -> removeDownload(intent.getStringExtra("bookUrl")) IntentAction.remove -> removeDownload(intent.getStringExtra("bookUrl"))
IntentAction.stop -> stopDownload() IntentAction.stop -> stopSelf()
} }
} }
return super.onStartCommand(intent, flags, startId) return super.onStartCommand(intent, flags, startId)
@ -97,13 +97,6 @@ class CacheBookService : BaseService() {
} }
} }
private fun stopDownload() {
CacheBook.cacheBookMap.forEach {
it.value.waitDownloadSet.clear()
}
stopSelf()
}
private fun upNotificationContent() { private fun upNotificationContent() {
notificationContent = notificationContent =
"正在下载:${CacheBook.onDownloadCount}/等待中:${CacheBook.waitDownloadCount}/成功:${CacheBook.successDownloadCount}" "正在下载:${CacheBook.onDownloadCount}/等待中:${CacheBook.waitDownloadCount}/成功:${CacheBook.successDownloadCount}"

Loading…
Cancel
Save