File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -858,9 +858,11 @@ public function count($minPriority = null) {
858858 return $ res [0 ];
859859 }
860860 public function countNotRead ($ minPriority = null ) {
861- $ sql = 'SELECT COUNT(e.id) AS count FROM ` ' . $ this ->prefix . 'entry` e INNER JOIN ` ' . $ this -> prefix . ' feed` f ON e.id_feed=f.id WHERE is_read=0 ' ;
861+ $ sql = 'SELECT COUNT(e.id) AS count FROM ` ' . $ this ->prefix . 'entry` e ' ;
862862 if ($ minPriority !== null ) {
863- $ sql = ' AND priority > ' . intval ($ minPriority );
863+ $ sql .= 'INNER JOIN ` ' . $ this ->prefix . 'feed` f ON e.id_feed=f.id WHERE is_read=0 AND f.priority > ' . intval ($ minPriority );
864+ } else {
865+ $ sql .= 'WHERE is_read=0 ' ;
864866 }
865867 $ stm = $ this ->bd ->prepare ($ sql );
866868 $ stm ->execute ();
Original file line number Diff line number Diff line change @@ -490,7 +490,10 @@ public function getFeedTree() {
490490 }
491491
492492 public function getUnread () {
493- Minz_Log::warning ('TTRSS API: getUnread() not implemented ' );
493+ $ entryDAO = FreshRSS_Factory::createEntryDao ();
494+ $ this ->good (array (
495+ 'unread ' => $ entryDAO ->countNotRead (),
496+ ));
494497 }
495498 public function getArticle () {
496499 Minz_Log::warning ('TTRSS API: getArticle() not implemented ' );
You can’t perform that action at this time.
0 commit comments