From 7027c5b2b4e55bcb2500ac12a12264f3a16233d7 Mon Sep 17 00:00:00 2001 From: Jonas Mayer Date: Tue, 6 Feb 2024 14:35:51 +0100 Subject: [PATCH] change database query to only return uploads for right account Signed-off-by: Jonas Mayer --- .../owncloud/android/datamodel/UploadsStorageManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/datamodel/UploadsStorageManager.java b/app/src/main/java/com/owncloud/android/datamodel/UploadsStorageManager.java index acc9dc9cd79a..850c95006816 100644 --- a/app/src/main/java/com/owncloud/android/datamodel/UploadsStorageManager.java +++ b/app/src/main/java/com/owncloud/android/datamodel/UploadsStorageManager.java @@ -567,7 +567,7 @@ public OCUpload[] getCurrentAndPendingUploadsForCurrentAccount() { } public OCUpload[] getCurrentAndPendingUploadsForAccount(final @NonNull String accountName) { - return getUploads(ProviderTableMeta.UPLOADS_STATUS + "==" + UploadStatus.UPLOAD_IN_PROGRESS.value + + return getUploads("( " + ProviderTableMeta.UPLOADS_STATUS + "==" + UploadStatus.UPLOAD_IN_PROGRESS.value + " OR " + ProviderTableMeta.UPLOADS_LAST_RESULT + "==" + UploadResult.DELAYED_FOR_WIFI.getValue() + " OR " + ProviderTableMeta.UPLOADS_LAST_RESULT + @@ -576,7 +576,7 @@ public OCUpload[] getCurrentAndPendingUploadsForAccount(final @NonNull String ac "==" + UploadResult.DELAYED_FOR_CHARGING.getValue() + " OR " + ProviderTableMeta.UPLOADS_LAST_RESULT + "==" + UploadResult.DELAYED_IN_POWER_SAVE_MODE.getValue() + - " AND " + ProviderTableMeta.UPLOADS_ACCOUNT_NAME + "== ?", + " ) AND " + ProviderTableMeta.UPLOADS_ACCOUNT_NAME + "== ?", accountName); } @@ -586,7 +586,7 @@ public OCUpload[] getCurrentAndPendingUploadsForAccount(final @NonNull String ac * If afterId is -1, returns the first page */ public List getCurrentAndPendingUploadsForAccountPageAscById(final long afterId, final @NonNull String accountName) { - final String selection = ProviderTableMeta.UPLOADS_STATUS + "==" + UploadStatus.UPLOAD_IN_PROGRESS.value + + final String selection = "( " + ProviderTableMeta.UPLOADS_STATUS + "==" + UploadStatus.UPLOAD_IN_PROGRESS.value + " OR " + ProviderTableMeta.UPLOADS_LAST_RESULT + "==" + UploadResult.DELAYED_FOR_WIFI.getValue() + " OR " + ProviderTableMeta.UPLOADS_LAST_RESULT + @@ -595,7 +595,7 @@ public List getCurrentAndPendingUploadsForAccountPageAscById(final lon "==" + UploadResult.DELAYED_FOR_CHARGING.getValue() + " OR " + ProviderTableMeta.UPLOADS_LAST_RESULT + "==" + UploadResult.DELAYED_IN_POWER_SAVE_MODE.getValue() + - " AND " + ProviderTableMeta.UPLOADS_ACCOUNT_NAME + "== ?"; + " ) AND " + ProviderTableMeta.UPLOADS_ACCOUNT_NAME + "== ?"; return getUploadPage(afterId, false, selection, accountName); }