Don't show error when download was cancelled (#6476)

This commit is contained in:
ByteHamster 2023-05-06 17:54:47 +02:00 committed by GitHub
parent 6d7bfef8a5
commit eaae6585d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -146,7 +146,7 @@ public class FeedUpdateWorker extends Worker {
downloader.call(); downloader.call();
if (!downloader.getResult().isSuccessful()) { if (!downloader.getResult().isSuccessful()) {
if (downloader.cancelled) { if (downloader.cancelled || downloader.getResult().getReason() == DownloadError.ERROR_DOWNLOAD_CANCELLED) {
return; return;
} }
DBWriter.setFeedLastUpdateFailed(request.getFeedfileId(), true); DBWriter.setFeedLastUpdateFailed(request.getFeedfileId(), true);

View File

@ -317,6 +317,7 @@ public class HttpDownloader extends Downloader {
private void onCancelled() { private void onCancelled() {
Log.d(TAG, "Download was cancelled"); Log.d(TAG, "Download was cancelled");
result.setCancelled(); result.setCancelled();
cancelled = true;
cleanup(); cleanup();
} }