mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-17 20:41:29 +00:00
api: show virtual feeds in getFeeds (fixes)
This commit is contained in:
@@ -121,7 +121,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$cat_id || $cat_id == -1) {
|
/* Labels */
|
||||||
|
|
||||||
|
if (!$cat_id || $cat_id == -2) {
|
||||||
$counters = getLabelCounters($link, false, true);
|
$counters = getLabelCounters($link, false, true);
|
||||||
|
|
||||||
foreach (array_keys($counters) as $id) {
|
foreach (array_keys($counters) as $id) {
|
||||||
@@ -134,7 +136,7 @@
|
|||||||
"id" => $id,
|
"id" => $id,
|
||||||
"title" => $counters[$id]["description"],
|
"title" => $counters[$id]["description"],
|
||||||
"unread" => $counters[$id]["counter"],
|
"unread" => $counters[$id]["counter"],
|
||||||
"cat_id" => -1,
|
"cat_id" => -2,
|
||||||
);
|
);
|
||||||
|
|
||||||
array_push($feeds, $row);
|
array_push($feeds, $row);
|
||||||
@@ -142,6 +144,27 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Virtual feeds */
|
||||||
|
|
||||||
|
if (!$cat_id || $cat_id == -1) {
|
||||||
|
foreach (array(-1, -2, -3, -4) as $i) {
|
||||||
|
$unread = getFeedUnread($link, $i);
|
||||||
|
|
||||||
|
if ($unread || !$unread_only) {
|
||||||
|
$title = getFeedTitle($link, $i);
|
||||||
|
|
||||||
|
$row = array(
|
||||||
|
"id" => $i,
|
||||||
|
"title" => $title,
|
||||||
|
"unread" => $unread,
|
||||||
|
"cat_id" => -1,
|
||||||
|
);
|
||||||
|
array_push($feeds, $row);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print json_encode($feeds);
|
print json_encode($feeds);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -276,6 +299,7 @@
|
|||||||
$article = array(
|
$article = array(
|
||||||
"title" => $line["title"],
|
"title" => $line["title"],
|
||||||
"link" => $line["link"],
|
"link" => $line["link"],
|
||||||
|
"labels" => get_article_labels($link, $article_id),
|
||||||
"unread" => sql_bool_to_bool($line["unread"]),
|
"unread" => sql_bool_to_bool($line["unread"]),
|
||||||
"marked" => sql_bool_to_bool($line["marked"]),
|
"marked" => sql_bool_to_bool($line["marked"]),
|
||||||
"published" => sql_bool_to_bool($line["published"]),
|
"published" => sql_bool_to_bool($line["published"]),
|
||||||
|
|||||||
Reference in New Issue
Block a user