offline: fix catchup_above not respecting oldest first setting; exclude

current article for consistency with tt-rss
This commit is contained in:
Andrew Dolgov 2013-03-27 14:02:23 +04:00
parent ab184cb5bd
commit 65fc57a0c0

View File

@ -180,15 +180,17 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
SQLiteStatement stmt = null;
String updatedOperator = (m_prefs.getBoolean("offline_oldest_first", false)) ? "<" : ">";
if (m_feedIsCat) {
stmt = m_activity.getWritableDb().compileStatement(
"UPDATE articles SET modified = 1, unread = 0 WHERE " +
"updated >= (SELECT updated FROM articles WHERE " + BaseColumns._ID + " = ?) " +
"updated "+updatedOperator+" (SELECT updated FROM articles WHERE " + BaseColumns._ID + " = ?) " +
"AND feed_id IN (SELECT "+BaseColumns._ID+" FROM feeds WHERE cat_id = ?)");
} else {
stmt = m_activity.getWritableDb().compileStatement(
"UPDATE articles SET modified = 1, unread = 0 WHERE " +
"updated >= (SELECT updated FROM articles WHERE " + BaseColumns._ID + " = ?) " +
"updated "+updatedOperator+" (SELECT updated FROM articles WHERE " + BaseColumns._ID + " = ?) " +
"AND feed_id = ?");
}