isUploadingNow for uploads after file conflict resolved

Signed-off-by: Jonas Mayer <jonas.a.mayer@gmx.net>
This commit is contained in:
Jonas Mayer 2023-12-07 16:56:41 +01:00
parent 1d2a7c9d53
commit ad34893419

View file

@ -1266,16 +1266,23 @@ public class FileUploader extends Service
if (useFilesUploadWorker(getApplicationContext())){ if (useFilesUploadWorker(getApplicationContext())){
UploadFileOperation currentUploadFileOperation = FilesUploadWorker.Companion.getCurrentUploadFileOperation(); UploadFileOperation currentUploadFileOperation = FilesUploadWorker.Companion.getCurrentUploadFileOperation();
if (currentUploadFileOperation == null || currentUploadFileOperation.getUser() == null) return false; if (currentUploadFileOperation == null || currentUploadFileOperation.getUser() == null) return false;
return upload != null && if (upload == null || (!upload.getAccountName().equals(currentUploadFileOperation.getUser().getAccountName()))) return false;
currentUploadFileOperation.getUser().getAccountName() != null && if (currentUploadFileOperation.getOldFile() != null){
upload.getAccountName().equals(currentUploadFileOperation.getUser().getAccountName()) && // For file conflicts check old file remote path
upload.getRemotePath().equals(currentUploadFileOperation.getRemotePath()); return upload.getRemotePath().equals(currentUploadFileOperation.getRemotePath()) ||
upload.getRemotePath().equals(currentUploadFileOperation.getOldFile().getRemotePath());
}
return upload.getRemotePath().equals(currentUploadFileOperation.getRemotePath());
}else { }else {
return upload != null && return upload != null &&
mCurrentAccount != null && mCurrentAccount != null &&
mCurrentUpload != null && mCurrentUpload != null &&
upload.getAccountName().equals(mCurrentAccount.name) && upload.getAccountName().equals(mCurrentAccount.name) &&
upload.getRemotePath().equals(mCurrentUpload.getRemotePath()); (upload.getRemotePath().equals(mCurrentUpload.getRemotePath()) ||
(mCurrentUpload.getOldFile() != null &&
upload.getRemotePath().equals(mCurrentUpload.getOldFile().getRemotePath())));
} }
} }