From ae138e2b1cb769d352bd1bb76b5c0e6af928ecb1 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Wed, 11 Mar 2015 13:45:12 +0100 Subject: [PATCH] New feed last update is never, not now --- .../DefaultOnlineFeedViewActivity.java | 2 +- .../activity/OnlineFeedViewActivity.java | 27 ++++++++++--------- .../antennapod/asynctask/OpmlFeedQueuer.java | 11 ++++---- .../antennapod/receiver/SPAReceiver.java | 12 +++++---- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java index 8401b41a7..287ae3568 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java @@ -138,7 +138,7 @@ public class DefaultOnlineFeedViewActivity extends OnlineFeedViewActivity { @Override public void onClick(View v) { try { - Feed f = new Feed(selectedDownloadUrl, new Date(), feed.getTitle()); + Feed f = new Feed(selectedDownloadUrl, new Date(0), feed.getTitle()); f.setPreferences(feed.getPreferences()); DefaultOnlineFeedViewActivity.this.feed = f; diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java index 9f028000e..3b03ed2db 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java @@ -13,9 +13,21 @@ import android.widget.ArrayAdapter; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.RelativeLayout; + +import org.apache.commons.lang3.StringUtils; +import org.xml.sax.SAXException; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import javax.xml.parsers.ParserConfigurationException; + import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; -import de.danoeh.antennapod.dialog.AuthenticationDialog; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedPreferences; import de.danoeh.antennapod.core.preferences.UserPreferences; @@ -31,16 +43,7 @@ import de.danoeh.antennapod.core.util.FileNameGenerator; import de.danoeh.antennapod.core.util.StorageUtils; import de.danoeh.antennapod.core.util.URLChecker; import de.danoeh.antennapod.core.util.syndication.FeedDiscoverer; -import org.apache.commons.lang3.StringUtils; -import org.xml.sax.SAXException; - -import javax.xml.parsers.ParserConfigurationException; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import de.danoeh.antennapod.dialog.AuthenticationDialog; /** * Downloads a feed from a feed URL and parses it. Subclasses can display the @@ -181,7 +184,7 @@ public abstract class OnlineFeedViewActivity extends ActionBarActivity { if (BuildConfig.DEBUG) Log.d(TAG, "Starting feed download"); url = URLChecker.prepareURL(url); - feed = new Feed(url, new Date()); + feed = new Feed(url, new Date(0)); if (username != null && password != null) { feed.setPreferences(new FeedPreferences(0, false, username, password)); } diff --git a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java index cb9197b8e..00327bce0 100644 --- a/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java +++ b/app/src/main/java/de/danoeh/antennapod/asynctask/OpmlFeedQueuer.java @@ -4,16 +4,17 @@ import android.annotation.SuppressLint; import android.app.ProgressDialog; import android.content.Context; import android.os.AsyncTask; -import de.danoeh.antennapod.core.R; + +import java.util.Arrays; +import java.util.Date; + import de.danoeh.antennapod.activity.OpmlImportHolder; +import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.opml.OpmlElement; import de.danoeh.antennapod.core.storage.DownloadRequestException; import de.danoeh.antennapod.core.storage.DownloadRequester; -import java.util.Arrays; -import java.util.Date; - /** Queues items for download in the background. */ public class OpmlFeedQueuer extends AsyncTask { private Context context; @@ -46,7 +47,7 @@ public class OpmlFeedQueuer extends AsyncTask { for (int idx = 0; idx < selection.length; idx++) { OpmlElement element = OpmlImportHolder.getReadElements().get( selection[idx]); - Feed feed = new Feed(element.getXmlUrl(), new Date(), + Feed feed = new Feed(element.getXmlUrl(), new Date(0), element.getText()); try { requester.downloadFeed(context.getApplicationContext(), feed); diff --git a/app/src/main/java/de/danoeh/antennapod/receiver/SPAReceiver.java b/app/src/main/java/de/danoeh/antennapod/receiver/SPAReceiver.java index 359a546f6..d15108bfe 100644 --- a/app/src/main/java/de/danoeh/antennapod/receiver/SPAReceiver.java +++ b/app/src/main/java/de/danoeh/antennapod/receiver/SPAReceiver.java @@ -5,15 +5,17 @@ import android.content.Context; import android.content.Intent; import android.util.Log; import android.widget.Toast; + +import org.apache.commons.lang3.StringUtils; + +import java.util.Arrays; +import java.util.Date; + import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.storage.DownloadRequestException; import de.danoeh.antennapod.core.storage.DownloadRequester; -import org.apache.commons.lang3.StringUtils; - -import java.util.Arrays; -import java.util.Date; /** * Receives intents from AntennaPod Single Purpose apps @@ -34,7 +36,7 @@ public class SPAReceiver extends BroadcastReceiver{ if (feedUrls != null) { if (BuildConfig.DEBUG) Log.d(TAG, "Received feeds list: " + Arrays.toString(feedUrls)); for (String url : feedUrls) { - Feed f = new Feed(url, new Date()); + Feed f = new Feed(url, new Date(0)); try { DownloadRequester.getInstance().downloadFeed(context, f); } catch (DownloadRequestException e) {