diff options
author | ByteHamster <info@bytehamster.com> | 2019-09-28 13:04:40 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-09-28 13:04:40 +0200 |
commit | 3041336b92f84f902c75e897316aa19075f9a34d (patch) | |
tree | 8e60a301e3ada198f0172e6f4cc9e60a560a0cd2 /core/src/main/java | |
parent | 3e01d66cbdd14f141a4e75799731d0dc0de33b81 (diff) | |
download | AntennaPod-3041336b92f84f902c75e897316aa19075f9a34d.zip |
Do not notify cancelled downloads
Diffstat (limited to 'core/src/main/java')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java index 0f346893e..37d778fd6 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java @@ -1058,7 +1058,13 @@ public class DownloadService extends Service { private final Runnable postDownloaderTask = new Runnable() { @Override public void run() { - List<Downloader> list = Collections.unmodifiableList(downloads); + List<Downloader> runningDownloads = new ArrayList<>(); + for (Downloader downloader : downloads) { + if (!downloader.cancelled) { + runningDownloads.add(downloader); + } + } + List<Downloader> list = Collections.unmodifiableList(runningDownloads); EventBus.getDefault().postSticky(DownloadEvent.refresh(list)); postHandler.postDelayed(postDownloaderTask, 1500); } @@ -1076,6 +1082,9 @@ public class DownloadService extends Service { private static String compileNotificationString(List<Downloader> downloads) { List<String> lines = new ArrayList<>(downloads.size()); for (Downloader downloader : downloads) { + if (downloader.cancelled) { + continue; + } StringBuilder line = new StringBuilder("• "); DownloadRequest request = downloader.getDownloadRequest(); switch (request.getFeedfileType()) { |