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()) {
saveUploadedFile(client);
if (mLocalBehaviour == FileUploader.LOCAL_BEHAVIOUR_FORGET) {
String temporalPath = FileStorageUtils.getTemporalPath(mAccount.name) + mFile.getRemotePath();
if (mOriginalStoragePath.equals(temporalPath)) {
// 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();
}
mFile.setStoragePath("");
saveUploadedFile(client);
} else if (mLocalBehaviour == FileUploader.LOCAL_BEHAVIOUR_DELETE) {
originalFile.delete();
getStorageManager().deleteFileInMediaScan(originalFile.getAbsolutePath());
saveUploadedFile(client);
} else {
mFile.setStoragePath(expectedPath);
@ -458,6 +461,8 @@ public class UploadFileOperation extends SyncOperation {
}
getStorageManager().deleteFileInMediaScan(originalFile.getAbsolutePath());
}
mFile.setStoragePath(expectedFile.getAbsolutePath());
saveUploadedFile(client);
FileDataStorageManager.triggerMediaScan(expectedFile.getAbsolutePath());
}
} else if (result.getCode() == ResultCode.SYNC_CONFLICT) {