Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class FileUploadWorker(
}
}

private var currentUploadIndex: Int = 1
private var lastPercent = 0
private val notificationManager = UploadNotificationManager(context, viewThemeUtils)
private val intents = FileUploaderIntents(context)
Expand Down Expand Up @@ -164,7 +165,7 @@ class FileUploadWorker(
setWorkerState(user.get(), uploadsPerPage)

run uploads@{
uploadsPerPage.forEachIndexed { currentUploadIndex, upload ->
uploadsPerPage.forEach { upload ->
if (isStopped) {
return@uploads
}
Expand All @@ -178,12 +179,16 @@ class FileUploadWorker(
uploadFileOperation,
cancelPendingIntent = intents.startIntent(uploadFileOperation),
startIntent = intents.notificationStartIntent(uploadFileOperation),
currentUploadIndex = currentUploadIndex + 1,
currentUploadIndex = currentUploadIndex,
totalUploadSize = totalUploadSize
)

val result = upload(uploadFileOperation, user.get())

if (result.isSuccess) {
currentUploadIndex += 1
}

currentUploadFileOperation = null

fileUploaderDelegate.sendBroadcastUploadFinished(
Expand Down
Loading