Implement Favicons request
This commit is contained in:
parent
60aa689e84
commit
cc859bab2d
@ -94,7 +94,7 @@ route('feeds', function() {
|
|||||||
foreach ($feeds as $feed) {
|
foreach ($feeds as $feed) {
|
||||||
$response['feeds'][] = array(
|
$response['feeds'][] = array(
|
||||||
'id' => (int) $feed['id'],
|
'id' => (int) $feed['id'],
|
||||||
'favicon_id' => 1,
|
'favicon_id' => (int) $feed['id'],
|
||||||
'title' => $feed['title'],
|
'title' => $feed['title'],
|
||||||
'url' => $feed['feed_url'],
|
'url' => $feed['feed_url'],
|
||||||
'site_url' => $feed['site_url'],
|
'site_url' => $feed['site_url'],
|
||||||
@ -122,7 +122,22 @@ route('favicons', function() {
|
|||||||
$response = auth();
|
$response = auth();
|
||||||
|
|
||||||
if ($response['auth']) {
|
if ($response['auth']) {
|
||||||
|
|
||||||
|
$favicons = Database::get('db')
|
||||||
|
->table('favicons')
|
||||||
|
->columns(
|
||||||
|
'feed_id',
|
||||||
|
'icon'
|
||||||
|
)
|
||||||
|
->findAll();
|
||||||
|
|
||||||
$response['favicons'] = array();
|
$response['favicons'] = array();
|
||||||
|
foreach ($favicons as $favicon) {
|
||||||
|
$response['favicons'][] = array(
|
||||||
|
'id' => (int) $favicon['feed_id'],
|
||||||
|
'data' => $favicon['icon']
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
response($response);
|
response($response);
|
||||||
|
Loading…
Reference in New Issue
Block a user