diff options
author | Tom Hennen <tom.hennen@gmail.com> | 2016-01-25 16:28:55 -0500 |
---|---|---|
committer | Tom Hennen <tom.hennen@gmail.com> | 2016-01-25 16:28:55 -0500 |
commit | c5d05d338aefda7a7832538bd18b4702c8dce587 (patch) | |
tree | 9f50ed048b75241bf6f3612ad83d1e59dcb13e39 /core/src | |
parent | f290048362f9b4da51b5f238d4a57751052b1cad (diff) | |
download | AntennaPod-c5d05d338aefda7a7832538bd18b4702c8dce587.zip |
If the feed doesn't have 'Global Refresh' then don't include it in the New Episodes list.
resolves AntennaPod/AntennaPod#286
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index 382fad03d..9ba8f1ffd 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -1131,13 +1131,6 @@ public class PodDBAdapter { return c; } - public final Cursor getNewItemIdsCursor() { - final String query = "SELECT " + KEY_ID - + " FROM " + TABLE_NAME_FEED_ITEMS - + " WHERE " + KEY_READ + "=" + FeedItem.NEW; - return db.rawQuery(query, null); - } - /** * Returns a cursor which contains all items of a feed that are considered new. * The returned cursor uses the FEEDITEM_SEL_FI_SMALL selection. @@ -1157,10 +1150,15 @@ public class PodDBAdapter { * The returned cursor uses the FEEDITEM_SEL_FI_SMALL selection. */ public final Cursor getNewItemsCursor() { - final String query = "SELECT " + SEL_FI_SMALL_STR - + " FROM " + TABLE_NAME_FEED_ITEMS - + " WHERE " + KEY_READ + "=" + FeedItem.NEW - + " ORDER BY " + KEY_PUBDATE + " DESC"; + String[] args = new String[] { + SEL_FI_SMALL_STR, + TABLE_NAME_FEED_ITEMS, + TABLE_NAME_FEEDS, + TABLE_NAME_FEED_ITEMS + "." + KEY_FEED + "=" + TABLE_NAME_FEEDS + "." + KEY_ID, + TABLE_NAME_FEED_ITEMS + "." + KEY_READ + "=" + FeedItem.NEW + " AND " + TABLE_NAME_FEEDS + "." + KEY_GLOBAL_REFRESH + " > 0", + KEY_PUBDATE + " DESC" + }; + final String query = String.format("SELECT %s FROM %s INNER JOIN %s ON %s WHERE %s ORDER BY %s", args); Cursor c = db.rawQuery(query, null); return c; } |