Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BugFix - Add Missing mTransferWasRequested #14539

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading