From 6a8ca4db7793baa53220899fb59b36d87f38acd3 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Tue, 29 Oct 2024 10:27:09 +0100 Subject: [PATCH] trigger worker via mFilesForDirectDownload Signed-off-by: alperozturk --- .../android/operations/SynchronizeFolderOperation.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/operations/SynchronizeFolderOperation.java b/app/src/main/java/com/owncloud/android/operations/SynchronizeFolderOperation.java index 9f48c9ce92..aa75ac2531 100644 --- a/app/src/main/java/com/owncloud/android/operations/SynchronizeFolderOperation.java +++ b/app/src/main/java/com/owncloud/android/operations/SynchronizeFolderOperation.java @@ -40,6 +40,7 @@ import java.util.List; import java.util.Map; import java.util.Vector; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Consumer; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -129,7 +130,6 @@ public class SynchronizeFolderOperation extends SyncOperation { if (result.isSuccess()) { if (mRemoteFolderChanged) { result = fetchAndSyncRemoteFolder(client); - } else { prepareOpsFromLocalKnowledge(); } @@ -419,7 +419,6 @@ public class SynchronizeFolderOperation extends SyncOperation { if (!child.isFolder()) { if (!child.isDown()) { mFilesForDirectDownload.add(child); - } else { /// this should result in direct upload of files that were locally modified SynchronizeFileOperation operation = new SynchronizeFileOperation( @@ -431,7 +430,6 @@ public class SynchronizeFolderOperation extends SyncOperation { getStorageManager() ); mFilesToSyncContents.add(operation); - } } } @@ -442,9 +440,8 @@ public class SynchronizeFolderOperation extends SyncOperation { startContentSynchronizations(mFilesToSyncContents); } - private void startDirectDownloads() { - FileDownloadHelper.Companion.instance().downloadFile(user, mLocalFolder); + mFilesForDirectDownload.forEach(file -> FileDownloadHelper.Companion.instance().downloadFile(user, file)); } /**