fixup! DownloadWorkerUtil: Rework cancelAll logic to only cancel request downloads
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -134,7 +134,6 @@ class DownloadWorker @AssistedInject constructor(
|
|||||||
downloadDao.updateSharedLibs(download.packageName, download.sharedLibs)
|
downloadDao.updateSharedLibs(download.packageName, download.sharedLibs)
|
||||||
|
|
||||||
// Download and verify all files exists
|
// Download and verify all files exists
|
||||||
notifyStatus(DownloadStatus.DOWNLOADING)
|
|
||||||
requestList.forEach { request ->
|
requestList.forEach { request ->
|
||||||
downloading = true
|
downloading = true
|
||||||
runCatching { downloadFile(request); download.downloadedFiles++ }
|
runCatching { downloadFile(request); download.downloadedFiles++ }
|
||||||
@@ -315,7 +314,7 @@ class DownloadWorker @AssistedInject constructor(
|
|||||||
downloadDao.updateStatus(download.packageName, status)
|
downloadDao.updateStatus(download.packageName, status)
|
||||||
|
|
||||||
when (status) {
|
when (status) {
|
||||||
DownloadStatus.DOWNLOADING, DownloadStatus.CANCELLED -> return
|
DownloadStatus.CANCELLED -> return
|
||||||
DownloadStatus.COMPLETED -> {
|
DownloadStatus.COMPLETED -> {
|
||||||
// Mark progress as 100 manually to avoid race conditions
|
// Mark progress as 100 manually to avoid race conditions
|
||||||
download.progress = 100
|
download.progress = 100
|
||||||
|
|||||||
Reference in New Issue
Block a user