Cleanup fever API
- remove the pseudo group 'All', the API description doesn't say that a group is required and Reeder on iOS works fine without groups - mark feeds/groups only as read since the API doesn't allow to mark them as unread
This commit is contained in:
parent
db920a5b3c
commit
71c354e315
@ -59,23 +59,8 @@ route('groups', function() {
|
|||||||
|
|
||||||
if ($response['auth']) {
|
if ($response['auth']) {
|
||||||
|
|
||||||
$feed_ids = Database::get('db')
|
$response['groups'] = array();
|
||||||
->table('feeds')
|
$response['feeds_groups'] = array();
|
||||||
->findAllByColumn('id');
|
|
||||||
|
|
||||||
$response['groups'] = array(
|
|
||||||
array(
|
|
||||||
'id' => 1,
|
|
||||||
'title' => t('All'),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$response['feeds_groups'] = array(
|
|
||||||
array(
|
|
||||||
'group_id' => 1,
|
|
||||||
'feed_ids' => implode(',', $feed_ids),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
response($response);
|
response($response);
|
||||||
@ -89,8 +74,9 @@ route('feeds', function() {
|
|||||||
if ($response['auth']) {
|
if ($response['auth']) {
|
||||||
|
|
||||||
$response['feeds'] = array();
|
$response['feeds'] = array();
|
||||||
|
$response['feeds_groups'] = array();
|
||||||
|
|
||||||
$feeds = Feed\get_all();
|
$feeds = Feed\get_all();
|
||||||
$feed_ids = array();
|
|
||||||
|
|
||||||
foreach ($feeds as $feed) {
|
foreach ($feeds as $feed) {
|
||||||
$response['feeds'][] = array(
|
$response['feeds'][] = array(
|
||||||
@ -102,16 +88,7 @@ route('feeds', function() {
|
|||||||
'is_spark' => 0,
|
'is_spark' => 0,
|
||||||
'last_updated_on_time' => $feed['last_checked'] ?: time(),
|
'last_updated_on_time' => $feed['last_checked'] ?: time(),
|
||||||
);
|
);
|
||||||
|
|
||||||
$feed_ids[] = $feed['id'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$response['feeds_groups'] = array(
|
|
||||||
array(
|
|
||||||
'group_id' => 1,
|
|
||||||
'feed_ids' => implode(',', $feed_ids),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
response($response);
|
response($response);
|
||||||
@ -297,7 +274,7 @@ route('write_feeds', function() {
|
|||||||
->table('items')
|
->table('items')
|
||||||
->eq('feed_id', $_POST['id'])
|
->eq('feed_id', $_POST['id'])
|
||||||
->lte('updated', $_POST['before'])
|
->lte('updated', $_POST['before'])
|
||||||
->update(array('status' => $_POST['as'] === 'read' ? 'read' : 'unread'));
|
->update(array('status' => 'read'));
|
||||||
}
|
}
|
||||||
|
|
||||||
response($response);
|
response($response);
|
||||||
@ -313,7 +290,7 @@ route('write_groups', function() {
|
|||||||
Database::get('db')
|
Database::get('db')
|
||||||
->table('items')
|
->table('items')
|
||||||
->lte('updated', $_POST['before'])
|
->lte('updated', $_POST['before'])
|
||||||
->update(array('status' => $_POST['as'] === 'read' ? 'read' : 'unread'));
|
->update(array('status' => 'read'));
|
||||||
}
|
}
|
||||||
|
|
||||||
response($response);
|
response($response);
|
||||||
|
Loading…
Reference in New Issue
Block a user