forked from mirror/pixelfed
Update ApiV1Controller, fix public timeline min/max id pagination
This commit is contained in:
parent
154f23416a
commit
a7613baee6
1 changed files with 13 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue