From f3f8d73dda3c9882f383e721eb3cc47be5a6c706 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Tue, 3 Mar 2015 22:35:22 -0500 Subject: Fix API to use the search object Since the internal of the listWhere method was changed, the API wasn't working. It was still calling the method with the old parameters. I didn't test it but now, it should work. --- p/api/greader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'p/api') diff --git a/p/api/greader.php b/p/api/greader.php index ab1a02244..060aa45ee 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -371,7 +371,7 @@ function streamContents($path, $include_target, $start_time, $count, $order, $ex } $entryDAO = FreshRSS_Factory::createEntryDao(); - $entries = $entryDAO->listWhere($type, $include_target, $state, $order === 'o' ? 'ASC' : 'DESC', $count, $continuation, '', $start_time); + $entries = $entryDAO->listWhere($type, $include_target, $state, $order === 'o' ? 'ASC' : 'DESC', $count, $continuation, new FreshRSS_Search(''), $start_time); $items = array(); foreach ($entries as $entry) { -- cgit v1.2.3 From d1c9378d338027e39174fecb5f7a047218ad2113 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Wed, 4 Mar 2015 23:04:12 -0500 Subject: Fix entry DAO query usage I did not fix the call in the previous commit. I hope this one is the last change needed. We definitely need a templating engine so we could use the same controller to output different things. This will remove code duplication between the api and the web interface. It will allows us to build other type of api, and also refactor the rss feed as a different view of the same dataset. --- p/api/greader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'p/api') diff --git a/p/api/greader.php b/p/api/greader.php index 060aa45ee..4554a3f9c 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -465,7 +465,7 @@ function streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude } $entryDAO = FreshRSS_Factory::createEntryDao(); - $ids = $entryDAO->listIdsWhere($type, $id, $state, $order === 'o' ? 'ASC' : 'DESC', $count, '', '', $start_time); + $ids = $entryDAO->listIdsWhere($type, $id, $state, $order === 'o' ? 'ASC' : 'DESC', $count, '', new FreshRSS_Search(''), $start_time); $itemRefs = array(); foreach ($ids as $id) { -- cgit v1.2.3 From 10d98e0ce97d15882a06865b894136d3c0444d79 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 21 May 2015 19:46:32 +0200 Subject: Google Reader API: work-around for News+ bug https://github.com/noinnion/newsplus/issues/84#issuecomment-57834632 https://github.com/FreshRSS/FreshRSS/issues/443 --- p/api/greader.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'p/api') diff --git a/p/api/greader.php b/p/api/greader.php index 4554a3f9c..5a23af006 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -467,6 +467,9 @@ function streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude $entryDAO = FreshRSS_Factory::createEntryDao(); $ids = $entryDAO->listIdsWhere($type, $id, $state, $order === 'o' ? 'ASC' : 'DESC', $count, '', new FreshRSS_Search(''), $start_time); + if (empty($ids)) { //For News+ bug https://github.com/noinnion/newsplus/issues/84#issuecomment-57834632 + $ids[] = 0; + } $itemRefs = array(); foreach ($ids as $id) { $itemRefs[] = array( -- cgit v1.2.3