diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2022-01-06 14:36:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-06 14:36:11 +0100 |
commit | 849bf4ad854973d39698613c3a356c09c87e687c (patch) | |
tree | fbd07d17fe5f26b8c91f9ce4ff8020046070431f /app/src/main/java/de/danoeh/antennapod/view | |
parent | 8252eb2183c6a478fdfd9317586c8800a24054ca (diff) | |
download | AntennaPod-849bf4ad854973d39698613c3a356c09c87e687c.zip |
Rewrite download request creation (#5530)
Android has a limit on the size of Intent parameters. When enqueuing
a huge number of items, it just ignored the argument and did not call
onNewIntent. We now load the list over in DownloadService.
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/view')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java b/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java index 8d1810ecb..d231e522f 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java +++ b/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java @@ -21,6 +21,8 @@ import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.adapter.CoverLoader; import de.danoeh.antennapod.adapter.actionbutton.ItemActionButton; +import de.danoeh.antennapod.core.service.download.DownloadRequest; +import de.danoeh.antennapod.core.service.download.DownloadService; import de.danoeh.antennapod.event.playback.PlaybackPositionEvent; import de.danoeh.antennapod.core.util.DateFormatter; import de.danoeh.antennapod.model.feed.FeedItem; @@ -28,9 +30,7 @@ import de.danoeh.antennapod.model.feed.FeedMedia; import de.danoeh.antennapod.model.playback.MediaType; import de.danoeh.antennapod.core.feed.util.ImageResourceUtils; import de.danoeh.antennapod.core.preferences.UserPreferences; -import de.danoeh.antennapod.core.service.download.DownloadRequest; import de.danoeh.antennapod.core.service.playback.PlaybackService; -import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.util.Converter; import de.danoeh.antennapod.core.util.FeedItemUtil; import de.danoeh.antennapod.core.util.NetworkUtils; @@ -145,8 +145,8 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder { itemView.setBackgroundResource(ThemeUtils.getDrawableFromAttr(activity, R.attr.selectableItemBackground)); } - if (DownloadRequester.getInstance().isDownloadingFile(media)) { - final DownloadRequest downloadRequest = DownloadRequester.getInstance().getRequestFor(media); + if (DownloadService.isDownloadingFile(media.getDownload_url())) { + final DownloadRequest downloadRequest = DownloadService.findRequest(media.getDownload_url()); float percent = 0.01f * downloadRequest.getProgressPercent(); secondaryActionProgress.setPercentage(Math.max(percent, 0.01f), item); } else if (media.isDownloaded()) { |