From 71c354e3157a60e6eb58a390524edfacc47f2764 Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Wed, 5 Aug 2015 01:01:21 +0200 Subject: [PATCH] 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 --- fever/index.php | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/fever/index.php b/fever/index.php index 6f23a4d..ae1cad6 100644 --- a/fever/index.php +++ b/fever/index.php @@ -59,23 +59,8 @@ route('groups', function() { if ($response['auth']) { - $feed_ids = Database::get('db') - ->table('feeds') - ->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['groups'] = array(); + $response['feeds_groups'] = array(); } response($response); @@ -89,8 +74,9 @@ route('feeds', function() { if ($response['auth']) { $response['feeds'] = array(); + $response['feeds_groups'] = array(); + $feeds = Feed\get_all(); - $feed_ids = array(); foreach ($feeds as $feed) { $response['feeds'][] = array( @@ -102,16 +88,7 @@ route('feeds', function() { 'is_spark' => 0, '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); @@ -297,7 +274,7 @@ route('write_feeds', function() { ->table('items') ->eq('feed_id', $_POST['id']) ->lte('updated', $_POST['before']) - ->update(array('status' => $_POST['as'] === 'read' ? 'read' : 'unread')); + ->update(array('status' => 'read')); } response($response); @@ -313,7 +290,7 @@ route('write_groups', function() { Database::get('db') ->table('items') ->lte('updated', $_POST['before']) - ->update(array('status' => $_POST['as'] === 'read' ? 'read' : 'unread')); + ->update(array('status' => 'read')); } response($response);