summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflofriday <flohacksfriday@gmail.com>2024-05-01 11:33:48 +0200
committerGitHub <noreply@github.com>2024-05-01 11:33:48 +0200
commit3ed5b8af8c7d187b72a0b7693724dcbe97eb3d98 (patch)
treea7e26678574401b07dae1ff318abef4ecc13beaf
parentb877344a7e0256f0a6b396b5798abeb55d7caa90 (diff)
downloadAntennaPod-3ed5b8af8c7d187b72a0b7693724dcbe97eb3d98.zip
Fix deleting downloaded episode removes from queue (#7151)
-rw-r--r--model/src/main/java/de/danoeh/antennapod/model/feed/FeedItem.java3
-rw-r--r--model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java3
2 files changed, 6 insertions, 0 deletions
diff --git a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedItem.java b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedItem.java
index 2a62e3e34..42f643cdc 100644
--- a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedItem.java
+++ b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedItem.java
@@ -171,6 +171,9 @@ public class FeedItem implements Serializable {
public void setId(long id) {
this.id = id;
+ if (this.media != null) {
+ media.setItemId(id);
+ }
}
/**
diff --git a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java
index 1f0786875..1f5d87dd0 100644
--- a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java
+++ b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedMedia.java
@@ -58,6 +58,7 @@ public class FeedMedia implements Playable {
this.downloadUrl = downloadUrl;
this.downloaded = false;
this.item = i;
+ this.itemID = i != null ? i.getId() : 0;
this.size = size;
this.mimeType = mimeType;
}
@@ -71,6 +72,7 @@ public class FeedMedia implements Playable {
this.downloaded = downloaded;
this.id = id;
this.item = item;
+ this.itemID = item != null ? item.getId() : 0;
this.duration = duration;
this.position = position;
this.playedDuration = playedDuration;
@@ -251,6 +253,7 @@ public class FeedMedia implements Playable {
*/
public void setItem(FeedItem item) {
this.item = item;
+ this.itemID = item != null ? item.getId() : 0;
if (item != null && item.getMedia() != this) {
item.setMedia(this);
}