Skip to content

Commit

Permalink
Merge pull request #14539 from nextcloud/bugfix/set-transfer-was-requ…
Browse files Browse the repository at this point in the history
…est-to-true-for-download-with-notifications

BugFix - Add Missing mTransferWasRequested
  • Loading branch information
tobiasKaminsky authored Feb 12, 2025
2 parents 7923598 + cbd1817 commit 3c88be4
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,29 +302,29 @@ private void requestForUpload(OCFile file) {

private void requestForDownload(OCFile file) {
final var fileDownloadHelper = FileDownloadHelper.Companion.instance();

final var filename = file.getFileName();

if (syncInBackgroundWorker) {
Log_OC.d("InternalTwoWaySyncWork", "download file: " + file.getFileName());
Log_OC.d(TAG, "downloading file without notification: " + filename);

try {
final var operation = new DownloadFileOperation(mUser, file, mContext);
var result = operation.execute(getClient());
final var result = operation.execute(getClient());

mTransferWasRequested = true;

String filename = file.getFileName();
if (filename != null) {
if (result.isSuccess()) {
fileDownloadHelper.saveFile(file, operation, getStorageManager());
Log_OC.d(TAG, "requestForDownload completed for: " + file.getFileName());
} else {
Log_OC.d(TAG, "requestForDownload failed for: " + file.getFileName());
}
if (result.isSuccess()) {
fileDownloadHelper.saveFile(file, operation, getStorageManager());
Log_OC.d(TAG, "requestForDownload completed for: " + filename);
} else {
Log_OC.d(TAG, "requestForDownload failed for: " + filename);
}
} catch (Exception e) {
Log_OC.d(TAG, "Exception caught at requestForDownload" + e);
}
} else {
Log_OC.d(TAG, "downloading file with notification: " + filename);
mTransferWasRequested = true;
fileDownloadHelper.downloadFile(mUser, file);
}
}
Expand Down

0 comments on commit 3c88be4

Please sign in to comment.