From a2af3a6bb4060af2903112101c9b6f4b2801b878 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 23 Feb 2023 17:08:25 +0300 Subject: [PATCH] API: add getFeedIcon endpoint, bump version --- classes/api.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/classes/api.php b/classes/api.php index 262d5c5bc..09f190451 100755 --- a/classes/api.php +++ b/classes/api.php @@ -1,7 +1,7 @@ $pf->_makefeedtree())); } + function getFeedIcon(): bool { + $id = (int)$_REQUEST['id']; + $cache = DiskCache::instance('feed-icons'); + + if ($cache->exists((string)$id)) { + return $cache->send((string)$id) > 0; + } else { + return $this->_wrap(self::STATUS_ERR, array("error" => self::E_NOT_FOUND)); + } + } + // only works for labels or uncategorized for the time being private function _is_cat_empty(int $id): bool { if ($id == -2) {