diff options
author | ByteHamster <info@bytehamster.com> | 2019-04-03 18:11:55 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-04-03 18:11:55 +0200 |
commit | 46510c808a488973f97a7eac085e4acc05ca3077 (patch) | |
tree | be003f6c62d5e13a1288189f67444288e23c1dae | |
parent | 7a98e3c2317f2c3d0853e0268c4af40bdedf1fde (diff) | |
download | AntennaPod-46510c808a488973f97a7eac085e4acc05ca3077.zip |
Respect 'keep updated' for new items counter
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java | 12 |
1 files changed, 9 insertions, 3 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 f1410b894..1daa43025 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 @@ -1253,9 +1253,15 @@ public class PodDBAdapter { } public final int getNumberOfNewItems() { - final String query = "SELECT COUNT(" + KEY_ID + ")" - + " FROM " + TABLE_NAME_FEED_ITEMS - + " WHERE " + KEY_READ + "=" + FeedItem.NEW; + Object[] args = new String[]{ + TABLE_NAME_FEED_ITEMS + "." + KEY_ID, + 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_KEEP_UPDATED + " > 0" + }; + final String query = String.format("SELECT COUNT(%s) FROM %s INNER JOIN %s ON %s WHERE %s", args); Cursor c = db.rawQuery(query, null); int result = 0; if (c.moveToFirst()) { |