mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 21:55:48 +03:00
Fix a bug
This commit is contained in:
parent
4f461b788e
commit
c9749698fa
1 changed files with 6 additions and 1 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue