diff options
author | fox <[email protected]> | 2022-12-22 00:13:04 +0300 |
---|---|---|
committer | fox <[email protected]> | 2022-12-22 00:13:04 +0300 |
commit | fb4bc2615e3910e8a7d15c6306e10247f7f80f4b (patch) | |
tree | d43bfde8cc06097f6fab9a1af48738b0da410eee /classes/feeds.php | |
parent | 423b26afc503c07166bd66d897bfe839c2cba10b (diff) | |
parent | 46e263586978ac443967c28fc6800a44c2f1d33b (diff) |
Merge pull request 'Only count updating (i.e. enabled) feeds when determining active feeds with errors.' (#96) from wn/tt-rss:feature/only-warn-for-updating-feeds into master
Reviewed-on: https://dev.tt-rss.org/tt-rss/tt-rss/pulls/96
Diffstat (limited to 'classes/feeds.php')
-rwxr-xr-x | classes/feeds.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/classes/feeds.php b/classes/feeds.php index 382d8dbf8..3c21400f8 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -431,12 +431,11 @@ class Feeds extends Handler_Protected { $reply['content'] .= sprintf(__("Feeds last updated at %s"), $last_updated); - $sth = $this->pdo->prepare("SELECT COUNT(id) AS num_errors - FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ?"); - $sth->execute([$_SESSION['uid']]); - $row = $sth->fetch(); - - $num_errors = $row["num_errors"]; + $num_errors = ORM::for_table('ttrss_feeds') + ->where_not_equal('last_error', '') + ->where('owner_uid', $_SESSION['uid']) + ->where_gt('update_interval', 0) + ->count('id'); if ($num_errors > 0) { $reply['content'] .= "<br/>"; @@ -585,12 +584,11 @@ class Feeds extends Handler_Protected { $reply['headlines']['content'] .= sprintf(__("Feeds last updated at %s"), $last_updated); - $sth = $this->pdo->prepare("SELECT COUNT(id) AS num_errors - FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ?"); - $sth->execute([$_SESSION['uid']]); - $row = $sth->fetch(); - - $num_errors = $row["num_errors"]; + $num_errors = ORM::for_table('ttrss_feeds') + ->where_not_equal('last_error', '') + ->where('owner_uid', $_SESSION['uid']) + ->where_gt('update_interval', 0) + ->count('id'); if ($num_errors > 0) { $reply['headlines']['content'] .= "<br/>"; |