diff options
| author | 2014-07-21 18:00:32 +0200 | |
|---|---|---|
| committer | 2014-07-21 18:00:32 +0200 | |
| commit | 8d7ac978f9af4819fc788e7e0a514dc7ca9886d9 (patch) | |
| tree | fcc7e399a5f628a904518b7b522b17cef67a76e1 /p/api/greader.php | |
| parent | a4dac0f791ae6d34b64cee5a3fae1815f6f70a2b (diff) | |
| parent | 73bbdaa015ec8596603fa88bd2cb03f85548e05e (diff) | |
Merge branch 'dev' into beta
Diffstat (limited to 'p/api/greader.php')
| -rw-r--r-- | p/api/greader.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/p/api/greader.php b/p/api/greader.php index 8a8623966..7a961225f 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -327,7 +327,7 @@ function streamContents($path, $include_target, $start_time, $count, $order, $ex logMe("streamContents($path, $include_target, $start_time, $count, $order, $exclude_target, $continuation)\n"); header('Content-Type: application/json; charset=UTF-8'); - $feedDAO = new FreshRSS_FeedDAO(); + $feedDAO = FreshRSS_Factory::createFeedDao(); $arrayFeedCategoryNames = $feedDAO->arrayFeedCategoryNames(); switch ($path) { @@ -364,7 +364,7 @@ function streamContents($path, $include_target, $start_time, $count, $order, $ex $count++; //Shift by one element } - $entryDAO = new FreshRSS_EntryDAO(); + $entryDAO = FreshRSS_Factory::createEntryDao(); $entries = $entryDAO->listWhere($type, $include_target, $state, $order === 'o' ? 'ASC' : 'DESC', $count, $continuation, '', $start_time); $items = array(); @@ -458,7 +458,7 @@ function streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude break; } - $entryDAO = new FreshRSS_EntryDAO(); + $entryDAO = FreshRSS_Factory::createEntryDao(); $ids = $entryDAO->listIdsWhere($type, $id, $state, $order === 'o' ? 'ASC' : 'DESC', $count, '', '', $start_time); $itemRefs = array(); @@ -481,7 +481,7 @@ function editTag($e_ids, $a, $r) { $e_ids[$i] = hex2dec(basename($e_id)); //Strip prefix 'tag:google.com,2005:reader/item/' } - $entryDAO = new FreshRSS_EntryDAO(); + $entryDAO = FreshRSS_Factory::createEntryDao(); switch ($a) { case 'user/-/state/com.google/read': @@ -512,13 +512,15 @@ function editTag($e_ids, $a, $r) { function markAllAsRead($streamId, $olderThanId) { logMe("markAllAsRead($streamId, $olderThanId)\n"); - $entryDAO = new FreshRSS_EntryDAO(); + $entryDAO = FreshRSS_Factory::createEntryDao(); if (strpos($streamId, 'feed/') === 0) { $f_id = basename($streamId); $entryDAO->markReadFeed($f_id, $olderThanId); } elseif (strpos($streamId, 'user/-/label/') === 0) { $c_name = basename($streamId); - $entryDAO->markReadCatName($c_name, $olderThanId); + $categoryDAO = new FreshRSS_CategoryDAO(); + $cat = $categoryDAO->searchByName($c_name); + $entryDAO->markReadCat($cat === null ? -1 : $cat->id(), $olderThanId); } elseif ($streamId === 'user/-/state/com.google/reading-list') { $entryDAO->markReadEntries($olderThanId, false, -1); } |
