From 3ed5b8af8c7d187b72a0b7693724dcbe97eb3d98 Mon Sep 17 00:00:00 2001 From: flofriday Date: Wed, 1 May 2024 11:33:48 +0200 Subject: [PATCH] Fix deleting downloaded episode removes from queue (#7151) --- .../main/java/de/danoeh/antennapod/model/feed/FeedItem.java | 3 +++ .../main/java/de/danoeh/antennapod/model/feed/FeedMedia.java | 3 +++ 2 files changed, 6 insertions(+) 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); }