mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-27 18:26:50 +00:00
Update ApiV1Controller, fix tag timeline limits and remove has(media) constraint
This commit is contained in:
parent
c3e56b8722
commit
8c65d60b77
1 changed files with 7 additions and 7 deletions
|
@ -2365,7 +2365,7 @@ class ApiV1Controller extends Controller
|
||||||
'page' => 'nullable|integer|max:40',
|
'page' => 'nullable|integer|max:40',
|
||||||
'min_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
|
'min_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
|
||||||
'max_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
|
'max_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
|
||||||
'limit' => 'nullable|integer|max:40'
|
'limit' => 'nullable|integer|max:100'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$tag = Hashtag::whereName($hashtag)
|
$tag = Hashtag::whereName($hashtag)
|
||||||
|
@ -2390,18 +2390,18 @@ class ApiV1Controller extends Controller
|
||||||
|
|
||||||
$res = StatusHashtag::whereHashtagId($tag->id)
|
$res = StatusHashtag::whereHashtagId($tag->id)
|
||||||
->whereStatusVisibility('public')
|
->whereStatusVisibility('public')
|
||||||
->whereHas('media')
|
|
||||||
->where('status_id', $dir, $id)
|
->where('status_id', $dir, $id)
|
||||||
->latest()
|
->latest()
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->pluck('status_id')
|
->pluck('status_id')
|
||||||
->filter(function($i) {
|
|
||||||
return StatusService::getMastodon($i);
|
|
||||||
})
|
|
||||||
->map(function ($i) {
|
->map(function ($i) {
|
||||||
return StatusService::getMastodon($i);
|
if($i) {
|
||||||
|
return StatusService::getMastodon($i);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->filter(function($i) {
|
||||||
|
return $i && isset($i['account']);
|
||||||
})
|
})
|
||||||
->filter()
|
|
||||||
->values()
|
->values()
|
||||||
->toArray();
|
->toArray();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue