mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +00:00
Update TimelineController
This commit is contained in:
parent
31f7957d30
commit
b4394605ee
1 changed files with 11 additions and 2 deletions
|
@ -17,14 +17,23 @@ class TimelineController extends Controller
|
|||
{
|
||||
// TODO: Use redis for timelines
|
||||
$following = Follower::whereProfileId(Auth::user()->profile->id)->pluck('following_id');
|
||||
$timeline = Status::whereHas('media')->whereNull('in_reply_to_id')->whereIn('profile_id', $following)->orderBy('id','desc')->simplePaginate(10);
|
||||
$timeline = Status::whereHas('media')
|
||||
->whereNull('in_reply_to_id')
|
||||
->whereIn('profile_id', $following)
|
||||
->orderBy('id','desc')
|
||||
->withCount(['comments', 'likes'])
|
||||
->simplePaginate(10);
|
||||
return view('timeline.personal', compact('timeline'));
|
||||
}
|
||||
|
||||
public function local()
|
||||
{
|
||||
// TODO: Use redis for timelines
|
||||
$timeline = Status::whereHas('media')->whereNull('in_reply_to_id')->orderBy('id','desc')->simplePaginate(10);
|
||||
$timeline = Status::whereHas('media')
|
||||
->whereNull('in_reply_to_id')
|
||||
->orderBy('id','desc')
|
||||
->withCount(['comments', 'likes'])
|
||||
->simplePaginate(10);
|
||||
return view('timeline.public', compact('timeline'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue