Update ApiV1Controller, fix public timeline min/max id pagination

pull/3551/head
Daniel Supernault 3 years ago
parent 154f23416a
commit a7613baee6
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7

@ -2015,6 +2015,19 @@ class ApiV1Controller extends Controller
}
$res = collect($feed)
->filter(function($k) use($min, $max) {
if(!$min && !$max) {
return true;
}
if($min) {
return $min != $k;
}
if($max) {
return $max != $k;
}
})
->map(function($k) use($user) {
$status = StatusService::getMastodon($k);
if(!$status || !isset($status['account']) || !isset($status['account']['id'])) {
@ -2032,7 +2045,6 @@ class ApiV1Controller extends Controller
})
->take($limit)
->values();
// ->toArray();
$baseUrl = config('app.url') . '/api/v1/timelines/public?limit=' . $limit . '&';
if($remote) {

Loading…
Cancel
Save