From 71d67864d2119537add59a3ebd0ef365f5c78856 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Sun, 10 Jan 2016 19:46:00 +0100 Subject: [PATCH] Reset to new if media becomes available --- .../main/java/de/danoeh/antennapod/core/feed/FeedMedia.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java index a7d553120..ae22d5460 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java @@ -8,6 +8,7 @@ import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; import android.support.annotation.Nullable; +import android.text.TextUtils; import java.util.Date; import java.util.List; @@ -167,6 +168,11 @@ public class FeedMedia extends FeedFile implements Playable { } public void updateFromOther(FeedMedia other) { + // we try to cover two cases: (1) feed did include file before (2) feed contained wrong URL + // if item.getAutoDownload() is false, the file has been downloaded before + if((TextUtils.isEmpty(download_url) || item.getAutoDownload()) && !TextUtils.isEmpty(other.download_url)) { + item.setNew(); + } super.updateFromOther(other); if (other.size > 0) { size = other.size;