mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2024-12-26 08:44:13 +01:00
Merge pull request #3085 from ByteHamster/new-items-count
Respect 'keep updated' for new items counter
This commit is contained in:
commit
f2d103736d
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user