Update remote path of the upload in the database just after rename

This commit is contained in:
Juan Carlos González Cabrero 2016-03-22 10:46:40 +01:00
parent 15eb8b493b
commit def9478d44
2 changed files with 5 additions and 1 deletions

View file

@ -660,7 +660,7 @@ public class FileUploader extends Service
UploadFileOperation upload = removeResult.first;
if (upload == null &&
mCurrentUpload != null && mCurrentAccount != null &&
remotePath.contains(mCurrentUpload.getFileName()) &&
mCurrentUpload.getRemotePath().startsWith(remotePath) &&
accountName.equals(mCurrentAccount.name)) {
upload = mCurrentUpload;

View file

@ -26,6 +26,7 @@ import android.net.Uri;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.datamodel.UploadsStorageManager;
import com.owncloud.android.db.OCUpload;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.lib.common.OwnCloudClient;
@ -363,6 +364,9 @@ public class UploadFileOperation extends SyncOperation {
createNewOCFile(remotePath);
Log_OC.d(TAG, "File renamed as " + remotePath);
}
mRemotePath = remotePath;
UploadsStorageManager usm = new UploadsStorageManager(mContext.getContentResolver());
usm.updateDatabaseUploadStart(this);
}
if (mCancellationRequested.get()) {