aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/api_zot.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/api_zot.php b/include/api_zot.php
index dda726787..7a217854f 100644
--- a/include/api_zot.php
+++ b/include/api_zot.php
@@ -310,9 +310,14 @@
$page = ((array_key_exists('page',$_REQUEST)) ? intval($_REQUEST['page']) : 0);
$ret['success'] = false;
- $ret['total'] = attach_count_files($channel['channel_id'], get_observer_hash());
+ $ret['total'] = 0;
$ret['results'] = [];
+ $count = attach_count_files($channel['channel_id'], get_observer_hash());
+ if($count['success']) {
+ $ret['total'] = $count['results'];
+ }
+
if (!$ret['total']) {
json_return_and_die($ret);
}
@@ -324,7 +329,7 @@
}
foreach($files['results'] as $file) {
- $ret['results'] = attach_export_data($channel, $file['hash'], false, $codebase);
+ $ret['results'][] = attach_export_data($channel, $file['hash'], false, $codebase);
}
if($ret['results']) {