From: Andrew Dolgov Date: Tue, 29 Nov 2011 05:22:38 +0000 (+0400) Subject: api/getCategories: return virtual categories and Uncategorized X-Git-Tag: 1.5.8~45 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=75b901d9293d6481886e5b4352d49ea0bcdd170d;p=tt-rss.git api/getCategories: return virtual categories and Uncategorized --- diff --git a/api/index.php b/api/index.php index 0453dcb3..1c4c52fd 100644 --- a/api/index.php +++ b/api/index.php @@ -191,6 +191,16 @@ } } + foreach (array(-2,-1,0) as $cat_id) { + $unread = getFeedUnread($link, $cat_id, true); + + if ($unread || !$unread_only) { + array_push($cats, array("id" => $cat_id, + "title" => getCategoryTitle($link, $cat_id), + "unread" => $unread)); + } + } + print api_wrap_reply(API_STATUS_OK, $seq, $cats); break;