1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-24 06:31:28 +00:00

move more stuff to offline.js

This commit is contained in:
Andrew Dolgov
2009-02-04 10:19:36 +03:00
parent 4681834e66
commit 774b8df873
2 changed files with 25 additions and 85 deletions

View File

@@ -490,3 +490,28 @@ function update_local_feedlist_counters() {
exception_error("update_local_feedlist_counters", e);
}
}
function get_local_feed_unread(id) {
try {
var rs;
if (id == -4) {
rs = db.execute("SELECT SUM(unread) FROM articles");
} else if (id == -1) {
rs = db.execute("SELECT SUM(unread) FROM articles WHERE marked = 1");
} else {
rs = db.execute("SELECT SUM(unread) FROM articles WHERE feed_id = ?", [id]);
}
if (rs.isValidRow()) {
return rs.field(0);
} else {
return 0;
}
} catch (e) {
exception_error("get_local_feed_unread", e);
}
}