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:
25
offline.js
25
offline.js
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user