From 65fc57a0c05e71f19f8d8efa1980824c211aa199 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 27 Mar 2013 14:02:23 +0400 Subject: [PATCH] offline: fix catchup_above not respecting oldest first setting; exclude current article for consistency with tt-rss --- src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java b/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java index bfc6d64f..b73efb92 100644 --- a/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java +++ b/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java @@ -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 = ?"); }