Skip to content

Commit 99ce2ae

Browse files
Merge pull request #13904 from nextcloud/backport/13897/stable-3.30
[stable-3.30] BugFix - Unnecessary Sync
2 parents f233ea7 + 2582d8d commit 99ce2ae

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

app/src/main/java/com/owncloud/android/operations/SynchronizeFolderOperation.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import java.util.Map;
4141
import java.util.Vector;
4242
import java.util.concurrent.atomic.AtomicBoolean;
43+
import java.util.function.Consumer;
4344

4445
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
4546

@@ -129,7 +130,6 @@ protected RemoteOperationResult run(OwnCloudClient client) {
129130
if (result.isSuccess()) {
130131
if (mRemoteFolderChanged) {
131132
result = fetchAndSyncRemoteFolder(client);
132-
133133
} else {
134134
prepareOpsFromLocalKnowledge();
135135
}
@@ -419,7 +419,6 @@ private void prepareOpsFromLocalKnowledge() throws OperationCancelledException {
419419
if (!child.isFolder()) {
420420
if (!child.isDown()) {
421421
mFilesForDirectDownload.add(child);
422-
423422
} else {
424423
/// this should result in direct upload of files that were locally modified
425424
SynchronizeFileOperation operation = new SynchronizeFileOperation(
@@ -431,7 +430,6 @@ private void prepareOpsFromLocalKnowledge() throws OperationCancelledException {
431430
getStorageManager()
432431
);
433432
mFilesToSyncContents.add(operation);
434-
435433
}
436434
}
437435
}
@@ -442,9 +440,8 @@ private void syncContents() throws OperationCancelledException {
442440
startContentSynchronizations(mFilesToSyncContents);
443441
}
444442

445-
446443
private void startDirectDownloads() {
447-
FileDownloadHelper.Companion.instance().downloadFile(user, mLocalFolder);
444+
mFilesForDirectDownload.forEach(file -> FileDownloadHelper.Companion.instance().downloadFile(user, file));
448445
}
449446

450447
/**

0 commit comments

Comments
 (0)