summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2023-09-24 10:03:50 +0200
committerGitHub <noreply@github.com>2023-09-24 10:03:50 +0200
commit0e52f08aa56a52cd5516cbeb2a85415a99d6963b (patch)
tree6549c9e30cd4d1baa681188321cec5789203a050 /net
parent8073de55af3c7cb749b6be2b80768bc07807e16c (diff)
downloadAntennaPod-0e52f08aa56a52cd5516cbeb2a85415a99d6963b.zip
Fix file deletion and queueing after download (#6652)
WorkManager does not tell us whether it was cancelled by the user (not retried) or by the system (retried later). So we need to delete the file and remove from queue when we know that it was actually the user. Also make sure to always delete the file when the download fails. Also, don't show "will retry" message on last retry attempt.
Diffstat (limited to 'net')
-rw-r--r--net/download/service-interface/src/main/java/de/danoeh/antennapod/net/download/serviceinterface/DownloadServiceInterface.java3
-rw-r--r--net/download/service-interface/src/main/java/de/danoeh/antennapod/net/download/serviceinterface/DownloadServiceInterfaceStub.java3
2 files changed, 4 insertions, 2 deletions
diff --git a/net/download/service-interface/src/main/java/de/danoeh/antennapod/net/download/serviceinterface/DownloadServiceInterface.java b/net/download/service-interface/src/main/java/de/danoeh/antennapod/net/download/serviceinterface/DownloadServiceInterface.java
index 5fac79ce8..a04c24ee4 100644
--- a/net/download/service-interface/src/main/java/de/danoeh/antennapod/net/download/serviceinterface/DownloadServiceInterface.java
+++ b/net/download/service-interface/src/main/java/de/danoeh/antennapod/net/download/serviceinterface/DownloadServiceInterface.java
@@ -3,6 +3,7 @@ package de.danoeh.antennapod.net.download.serviceinterface;
import android.content.Context;
import de.danoeh.antennapod.model.download.DownloadStatus;
import de.danoeh.antennapod.model.feed.FeedItem;
+import de.danoeh.antennapod.model.feed.FeedMedia;
import java.util.HashMap;
import java.util.Map;
@@ -38,7 +39,7 @@ public abstract class DownloadServiceInterface {
*/
public abstract void download(Context context, FeedItem item);
- public abstract void cancel(Context context, String url);
+ public abstract void cancel(Context context, FeedMedia media);
public abstract void cancelAll(Context context);
diff --git a/net/download/service-interface/src/main/java/de/danoeh/antennapod/net/download/serviceinterface/DownloadServiceInterfaceStub.java b/net/download/service-interface/src/main/java/de/danoeh/antennapod/net/download/serviceinterface/DownloadServiceInterfaceStub.java
index 716d68d14..70f551a9c 100644
--- a/net/download/service-interface/src/main/java/de/danoeh/antennapod/net/download/serviceinterface/DownloadServiceInterfaceStub.java
+++ b/net/download/service-interface/src/main/java/de/danoeh/antennapod/net/download/serviceinterface/DownloadServiceInterfaceStub.java
@@ -2,6 +2,7 @@ package de.danoeh.antennapod.net.download.serviceinterface;
import android.content.Context;
import de.danoeh.antennapod.model.feed.FeedItem;
+import de.danoeh.antennapod.model.feed.FeedMedia;
public class DownloadServiceInterfaceStub extends DownloadServiceInterface {
@@ -14,7 +15,7 @@ public class DownloadServiceInterfaceStub extends DownloadServiceInterface {
}
@Override
- public void cancel(Context context, String url) {
+ public void cancel(Context context, FeedMedia media) {
}
@Override