diff --git a/app/src/main/java/de/danoeh/antennapod/ui/episodeslist/EpisodeMultiSelectActionHandler.java b/app/src/main/java/de/danoeh/antennapod/ui/episodeslist/EpisodeMultiSelectActionHandler.java index 2a9f76939..76ed47de5 100644 --- a/app/src/main/java/de/danoeh/antennapod/ui/episodeslist/EpisodeMultiSelectActionHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/ui/episodeslist/EpisodeMultiSelectActionHandler.java @@ -91,12 +91,14 @@ public class EpisodeMultiSelectActionHandler { private void downloadChecked(List items) { // download the check episodes in the same order as they are currently displayed + int downloaded = 0; for (FeedItem episode : items) { - if (episode.hasMedia() && !episode.getFeed().isLocalFeed()) { + if (episode.hasMedia() && !episode.isDownloaded() && !episode.getFeed().isLocalFeed()) { DownloadServiceInterface.get().download(activity, episode); + downloaded++; } } - showMessage(R.plurals.downloading_batch_label, items.size()); + showMessage(R.plurals.downloading_batch_label, downloaded); } private void deleteChecked(List items) { diff --git a/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/DownloadServiceInterfaceImpl.java b/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/DownloadServiceInterfaceImpl.java index 37a7f30e0..0b5be92b8 100644 --- a/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/DownloadServiceInterfaceImpl.java +++ b/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/DownloadServiceInterfaceImpl.java @@ -36,6 +36,9 @@ public class DownloadServiceInterfaceImpl extends DownloadServiceInterface { } public void download(Context context, FeedItem item) { + if (item.isDownloaded()) { + return; + } OneTimeWorkRequest.Builder workRequest = getRequest(context, item); workRequest.setConstraints(getConstraints()); WorkManager.getInstance(context).enqueueUniqueWork(item.getMedia().getDownloadUrl(),