Skip to content

Commit

Permalink
change database query to only return uploads for right account
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Mayer <[email protected]>
  • Loading branch information
JonasMayerDev committed Feb 6, 2024
1 parent 67ac9e1 commit 1c1e593
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
Expand All @@ -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);
}

Expand All @@ -586,7 +586,7 @@ public OCUpload[] getCurrentAndPendingUploadsForAccount(final @NonNull String ac
* If <code>afterId</code> is -1, returns the first page
*/
public List<OCUpload> 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 +
Expand All @@ -595,7 +595,7 @@ public List<OCUpload> 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);
}

Expand Down

0 comments on commit 1c1e593

Please sign in to comment.