Fix a bug

This commit is contained in:
Mario Danic 2017-03-03 10:35:51 +01:00 committed by AndyScherzinger
parent 4f461b788e
commit c9749698fa
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -427,9 +427,9 @@ public class UploadFileOperation extends SyncOperation {
} }
if (result.isSuccess()) { if (result.isSuccess()) {
saveUploadedFile(client);
if (mLocalBehaviour == FileUploader.LOCAL_BEHAVIOUR_FORGET) { if (mLocalBehaviour == FileUploader.LOCAL_BEHAVIOUR_FORGET) {
String temporalPath = FileStorageUtils.getTemporalPath(mAccount.name) + mFile.getRemotePath(); String temporalPath = FileStorageUtils.getTemporalPath(mAccount.name) + mFile.getRemotePath();
if (mOriginalStoragePath.equals(temporalPath)) { if (mOriginalStoragePath.equals(temporalPath)) {
// delete local file is was pre-copied in temporary folder (see .ui.helpers.UriUploader) // delete local file is was pre-copied in temporary folder (see .ui.helpers.UriUploader)
@ -437,10 +437,13 @@ public class UploadFileOperation extends SyncOperation {
temporalFile.delete(); temporalFile.delete();
} }
mFile.setStoragePath(""); mFile.setStoragePath("");
saveUploadedFile(client);
} else if (mLocalBehaviour == FileUploader.LOCAL_BEHAVIOUR_DELETE) { } else if (mLocalBehaviour == FileUploader.LOCAL_BEHAVIOUR_DELETE) {
originalFile.delete(); originalFile.delete();
getStorageManager().deleteFileInMediaScan(originalFile.getAbsolutePath()); getStorageManager().deleteFileInMediaScan(originalFile.getAbsolutePath());
saveUploadedFile(client);
} else { } else {
mFile.setStoragePath(expectedPath); mFile.setStoragePath(expectedPath);
@ -458,6 +461,8 @@ public class UploadFileOperation extends SyncOperation {
} }
getStorageManager().deleteFileInMediaScan(originalFile.getAbsolutePath()); getStorageManager().deleteFileInMediaScan(originalFile.getAbsolutePath());
} }
mFile.setStoragePath(expectedFile.getAbsolutePath());
saveUploadedFile(client);
FileDataStorageManager.triggerMediaScan(expectedFile.getAbsolutePath()); FileDataStorageManager.triggerMediaScan(expectedFile.getAbsolutePath());
} }
} else if (result.getCode() == ResultCode.SYNC_CONFLICT) { } else if (result.getCode() == ResultCode.SYNC_CONFLICT) {