|
@@ 143-145 (lines=3) @@
|
| 140 |
|
$paperHiveString = $this->fetchDiscussions($bookId); |
| 141 |
|
$paperHiveDiscussions = json_decode($paperHiveString, true); |
| 142 |
|
$disscussionCount = -1; |
| 143 |
|
if (json_last_error() === JSON_ERROR_NONE && isset($paperHiveDiscussions['discussions'])) { |
| 144 |
|
$disscussionCount = count($paperHiveDiscussions['discussions']); |
| 145 |
|
} |
| 146 |
|
return new DataResponse($disscussionCount, Http::STATUS_OK); |
| 147 |
|
} catch (\Exception $e) { |
| 148 |
|
$message = (string)$this->l->t('An internal server error occurred.'); |
|
@@ 239-241 (lines=3) @@
|
| 236 |
|
} |
| 237 |
|
$paperHiveDiscussions = json_decode($paperHiveDiscussionsString, true); |
| 238 |
|
$discussionCount = -1; |
| 239 |
|
if (json_last_error() === JSON_ERROR_NONE && isset($paperHiveDiscussions['discussions'])) { |
| 240 |
|
$discussionCount = count($paperHiveDiscussions['discussions']); |
| 241 |
|
} |
| 242 |
|
|
| 243 |
|
// Save the file |
| 244 |
|
$title = $paperHiveObject['metadata']['title']; |