Fix deleted file update in media scanner

This commit is contained in:
Juan Carlos González Cabrero 2016-04-15 14:18:57 +02:00
parent 04dc4b2f45
commit e615b9a20d

View file

@ -379,16 +379,15 @@ public class UploadFileOperation extends SyncOperation {
mFile.setStoragePath("");
} else {
mFile.setStoragePath(expectedPath);
File fileToMove;
if (temporalFile != null) { // FileUploader.LOCAL_BEHAVIOUR_COPY
fileToMove = temporalFile;
move(temporalFile, expectedFile);
} else { // FileUploader.LOCAL_BEHAVIOUR_MOVE
fileToMove = originalFile;
move(originalFile, expectedFile);
getStorageManager().deleteFileInMediaScan(originalFile.getAbsolutePath());
}
move(fileToMove, expectedFile);
}
FileDataStorageManager.triggerMediaScan(originalFile.getAbsolutePath());
FileDataStorageManager.triggerMediaScan(expectedFile.getAbsolutePath());
}
} else if (result.getHttpCode() == HttpStatus.SC_PRECONDITION_FAILED ) {
result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT);