Add "next_start" to JSON API result on posts
This commit is contained in:
parent
5f2cc85c9a
commit
81b21d838f
|
@ -26,8 +26,13 @@ ORDER BY id ASC LIMIT '.$limit.'
|
||||||
unset($object['reblog_of_id']);
|
unset($object['reblog_of_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$delay = $pg->fetch('SELECT COUNT(1) FROM statuses WHERE id > '.$objects[count($objects)-1]['id']);
|
$delay = 0;
|
||||||
$delay = intval($delay['count']);
|
$next_start = null;
|
||||||
|
if (count($objects) > 0) {
|
||||||
|
$delay = $pg->fetch('SELECT COUNT(1) FROM statuses WHERE id > '.$objects[count($objects)-1]['id']);
|
||||||
|
$delay = intval($delay['count']);
|
||||||
|
$next_start = $objects[count($objects)-1]['id'];
|
||||||
|
}
|
||||||
if ($delay > $limit)
|
if ($delay > $limit)
|
||||||
$delay = ['total' => $delay, 'ticks' => intval($delay / $limit)];
|
$delay = ['total' => $delay, 'ticks' => intval($delay / $limit)];
|
||||||
else $delay = ['total' => $delay, 'ticks' => 1 ];
|
else $delay = ['total' => $delay, 'ticks' => 1 ];
|
||||||
|
@ -37,6 +42,7 @@ ORDER BY id ASC LIMIT '.$limit.'
|
||||||
'items' => $objects,
|
'items' => $objects,
|
||||||
'limit' => $limit,
|
'limit' => $limit,
|
||||||
'delay' => $delay,
|
'delay' => $delay,
|
||||||
|
'next_start' => $next_start,
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
$_();
|
$_();
|
||||||
|
|
Loading…
Reference in New Issue