summaryrefslogtreecommitdiff
path: root/src/org/fox/ttrss/offline/OfflineDownloadService.java
diff options
context:
space:
mode:
authorjan_bar <jan_bar@ITBARES.prague.wood.cz>2013-04-24 15:48:44 +0200
committerjan_bar <jan_bar@ITBARES.prague.wood.cz>2013-04-24 15:48:44 +0200
commit3bdb6e86afb68ccebe9aa7fe3126a3d9152d584b (patch)
treeb0e0fa9dc492757ce3e005cdbc8abdf14225ef86 /src/org/fox/ttrss/offline/OfflineDownloadService.java
parentf9889788fced67fe3c849eda7d40f460090e2020 (diff)
Support score in online and offline mode
Bump database version Fixed bug in database drop order
Diffstat (limited to 'src/org/fox/ttrss/offline/OfflineDownloadService.java')
-rw-r--r--src/org/fox/ttrss/offline/OfflineDownloadService.java30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/org/fox/ttrss/offline/OfflineDownloadService.java b/src/org/fox/ttrss/offline/OfflineDownloadService.java
index 2fe87570..78ae6693 100644
--- a/src/org/fox/ttrss/offline/OfflineDownloadService.java
+++ b/src/org/fox/ttrss/offline/OfflineDownloadService.java
@@ -367,8 +367,10 @@ public class OfflineDownloadService extends Service {
m_articles = new Gson().fromJson(content, listType);
SQLiteStatement stmtInsert = getWritableDb().compileStatement("INSERT INTO articles " +
- "("+BaseColumns._ID+", unread, marked, published, updated, is_updated, title, link, feed_id, tags, content) " +
- "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);");
+ "(" +
+ BaseColumns._ID +
+ ", unread, marked, published, score, updated, is_updated, title, link, feed_id, tags, content) " +
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);");
for (Article article : m_articles) {
@@ -380,17 +382,19 @@ public class OfflineDownloadService extends Service {
tagsString = tagsString.replaceAll(", $", "");
- stmtInsert.bindLong(1, article.id);
- stmtInsert.bindLong(2, article.unread ? 1 : 0);
- stmtInsert.bindLong(3, article.marked ? 1 : 0);
- stmtInsert.bindLong(4, article.published ? 1 : 0);
- stmtInsert.bindLong(5, article.updated);
- stmtInsert.bindLong(6, article.is_updated ? 1 : 0);
- stmtInsert.bindString(7, article.title);
- stmtInsert.bindString(8, article.link);
- stmtInsert.bindLong(9, article.feed_id);
- stmtInsert.bindString(10, tagsString); // comma-separated tags
- stmtInsert.bindString(11, article.content);
+ int index = 1;
+ stmtInsert.bindLong(index++, article.id);
+ stmtInsert.bindLong(index++, article.unread ? 1 : 0);
+ stmtInsert.bindLong(index++, article.marked ? 1 : 0);
+ stmtInsert.bindLong(index++, article.published ? 1 : 0);
+ stmtInsert.bindLong(index++, article.score);
+ stmtInsert.bindLong(index++, article.updated);
+ stmtInsert.bindLong(index++, article.is_updated ? 1 : 0);
+ stmtInsert.bindString(index++, article.title);
+ stmtInsert.bindString(index++, article.link);
+ stmtInsert.bindLong(index++, article.feed_id);
+ stmtInsert.bindString(index++, tagsString); // comma-separated tags
+ stmtInsert.bindString(index++, article.content);
if (m_downloadImages) {
Document doc = Jsoup.parse(article.content);