mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update ApiV1Controller, fix hashtag timeline
This commit is contained in:
parent
43d3aa2b94
commit
fc1a385cfd
1 changed files with 13 additions and 5 deletions
|
@ -3270,6 +3270,16 @@ class ApiV1Controller extends Controller
|
|||
$max = $request->input('max_id');
|
||||
$limit = $request->input('limit', 20);
|
||||
|
||||
if($min || $max) {
|
||||
$minMax = SnowflakeService::byDate(now()->subMonths(6));
|
||||
if($min && intval($min) < $minMax) {
|
||||
return [];
|
||||
}
|
||||
if($max && intval($max) < $minMax) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
if(!$min && !$max) {
|
||||
$id = 1;
|
||||
$dir = '>';
|
||||
|
@ -3279,15 +3289,13 @@ class ApiV1Controller extends Controller
|
|||
}
|
||||
|
||||
$res = StatusHashtag::whereHashtagId($tag->id)
|
||||
->whereStatusVisibility('public')
|
||||
->where('status_id', $dir, $id)
|
||||
->latest()
|
||||
->whereStatusVisibility('public')
|
||||
->orderBy('status_id', 'desc')
|
||||
->limit($limit)
|
||||
->pluck('status_id')
|
||||
->map(function ($i) {
|
||||
if($i) {
|
||||
return StatusService::getMastodon($i);
|
||||
}
|
||||
})
|
||||
->filter(function($i) {
|
||||
return $i && isset($i['account']);
|
||||
|
|
Loading…
Reference in a new issue