mirror of
https://github.com/nextcloud/android.git
synced 2024-12-18 15:01:57 +03:00
Merge pull request #14162 from nextcloud/bugfix/upload-current-file-index
BugFix - Upload Current File Index
This commit is contained in:
commit
907cd130e0
1 changed files with 7 additions and 2 deletions
|
@ -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)
|
||||
|
@ -167,7 +168,7 @@ class FileUploadWorker(
|
|||
setWorkerState(user.get(), uploadsPerPage)
|
||||
|
||||
run uploads@{
|
||||
uploadsPerPage.forEachIndexed { currentUploadIndex, upload ->
|
||||
uploadsPerPage.forEach { upload ->
|
||||
if (isStopped) {
|
||||
return@uploads
|
||||
}
|
||||
|
@ -181,12 +182,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(
|
||||
|
|
Loading…
Reference in a new issue