summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-15 16:00:54 +0300
committerAndrew Dolgov <[email protected]>2021-02-15 16:00:54 +0300
commit5704deb460f740ed56be5ae4dbddbf5296a9c603 (patch)
treec181264ef1a939ea5e06f8d4f2356671400ed19b
parent257efb43c6e32226280d8198acc946a2fc4c454f (diff)
counters: unify naming
-rwxr-xr-xclasses/api.php4
-rw-r--r--classes/counters.php22
-rwxr-xr-xclasses/rpc.php4
3 files changed, 15 insertions, 15 deletions
diff --git a/classes/api.php b/classes/api.php
index 4d1c15598..62ce1764c 100755
--- a/classes/api.php
+++ b/classes/api.php
@@ -102,7 +102,7 @@ class API extends Handler {
/* Method added for ttrss-reader for Android */
function getCounters() {
- $this->wrap(self::STATUS_OK, Counters::getAllCounters());
+ $this->wrap(self::STATUS_OK, Counters::get_all());
}
function getFeeds() {
@@ -510,7 +510,7 @@ class API extends Handler {
/* API only: -4 All feeds, including virtual feeds */
if ($cat_id == -4 || $cat_id == -2) {
- $counters = Counters::getLabelCounters(true);
+ $counters = Counters::get_labels(true);
foreach (array_values($counters) as $cv) {
diff --git a/classes/counters.php b/classes/counters.php
index 29ced3d6c..e8c179a95 100644
--- a/classes/counters.php
+++ b/classes/counters.php
@@ -1,13 +1,13 @@
<?php
class Counters {
- static function getAllCounters() {
- $data = self::getGlobalCounters();
+ static function get_all() {
+ $data = self::get_global();
- $data = array_merge($data, self::getVirtCounters());
- $data = array_merge($data, self::getLabelCounters());
- $data = array_merge($data, self::getFeedCounters());
- $data = array_merge($data, self::getCategoryCounters());
+ $data = array_merge($data, self::get_virt(),
+ self::get_labels(),
+ self::get_feeds(),
+ self::get_cats());
return $data;
}
@@ -32,7 +32,7 @@ class Counters {
return [$unread, $marked];
}
- static function getCategoryCounters() {
+ private static function get_cats() {
$ret = [];
/* Labels category */
@@ -90,7 +90,7 @@ class Counters {
}
- static function getFeedCounters($active_feed = false) {
+ private static function get_feeds($active_feed = false) {
$ret = [];
@@ -145,7 +145,7 @@ class Counters {
return $ret;
}
- static function getGlobalCounters($global_unread = -1) {
+ private static function get_global($global_unread = -1) {
$ret = [];
if ($global_unread == -1) {
@@ -178,7 +178,7 @@ class Counters {
return $ret;
}
- static function getVirtCounters() {
+ private static function get_virt() {
$ret = [];
@@ -222,7 +222,7 @@ class Counters {
return $ret;
}
- static function getLabelCounters($descriptions = false) {
+ static function get_labels($descriptions = false) {
$ret = [];
diff --git a/classes/rpc.php b/classes/rpc.php
index 7edc59921..b91684bcd 100755
--- a/classes/rpc.php
+++ b/classes/rpc.php
@@ -141,7 +141,7 @@ class RPC extends Handler_Protected {
@$seq = (int) $_REQUEST['seq'];
$reply = [
- 'counters' => Counters::getAllCounters(),
+ 'counters' => Counters::get_all(),
'seq' => $seq
];
@@ -222,7 +222,7 @@ class RPC extends Handler_Protected {
Feeds::_catchup($feed_id, $is_cat, false, $mode, [$search_query, $search_lang]);
// return counters here synchronously so that frontend can figure out next unread feed properly
- print json_encode(['counters' => Counters::getAllCounters()]);
+ print json_encode(['counters' => Counters::get_all()]);
//print json_encode(array("message" => "UPDATE_COUNTERS"));
}