summaryrefslogtreecommitdiff
path: root/offline.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-02-04 23:00:05 +0300
committerAndrew Dolgov <[email protected]>2009-02-04 23:00:05 +0300
commitf4c113477ad20133d5945929feb928f018ac71c9 (patch)
treef0037928ba20839bb6d2b77185726b7e940a298b /offline.js
parent1a00325836c25ed77793ddf2e66abbf68857b4ed (diff)
offline: fix feedlist/counters calculation
Diffstat (limited to 'offline.js')
-rw-r--r--offline.js20
1 files changed, 13 insertions, 7 deletions
diff --git a/offline.js b/offline.js
index 8290a2fc4..bb81acf76 100644
--- a/offline.js
+++ b/offline.js
@@ -401,17 +401,20 @@ function render_offline_feedlist() {
tmp += "<li><hr/></li>";
- var rs = db.execute("SELECT feeds.id,feeds.title,has_icon,COUNT(articles.id) "+
+/* var rs = db.execute("SELECT feeds.id,feeds.title,has_icon,COUNT(articles.id) "+
"FROM feeds LEFT JOIN articles ON (feed_id = feeds.id) "+
"WHERE unread = 1 OR unread IS NULL GROUP BY feeds.id "+
- "ORDER BY feeds.title");
+ "ORDER BY feeds.title"); */
+
+ var rs = db.execute("SELECT id,title,has_icon FROM feeds "+
+ "ORDER BY title");
while (rs.isValidRow()) {
var id = rs.field(0);
var title = rs.field(1);
var has_icon = rs.field(2);
- var unread = rs.field(3);
+ var unread = get_local_feed_unread(id);
var icon = "";
@@ -630,16 +633,19 @@ function set_feedlist_counter(id, ctr) {
function update_local_feedlist_counters() {
try {
- if (!db) return;
+ if (!offline_mode) return;
- var rs = db.execute("SELECT feeds.id,COUNT(articles.id) "+
+/* var rs = db.execute("SELECT feeds.id,COUNT(articles.id) "+
"FROM feeds LEFT JOIN articles ON (feed_id = feeds.id) "+
"WHERE unread = 1 OR unread IS NULL GROUP BY feeds.id "+
- "ORDER BY feeds.title");
+ "ORDER BY feeds.title"); */
+
+ var rs = db.execute("SELECT id,title,has_icon FROM feeds "+
+ "ORDER BY title");
while (rs.isValidRow()) {
var id = rs.field(0);
- var ctr = rs.field(1);
+ var ctr = get_local_feed_unread(id);
set_feedlist_counter(id, ctr);