1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-25 09:17:03 +00:00

Update PublicApiController, remove expensive and unused relationships

This commit is contained in:
Daniel Supernault 2022-10-06 22:32:26 -06:00
parent fefcbae911
commit 2ecc314434
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -364,7 +364,6 @@ class PublicApiController extends Controller
)
->whereNull(['in_reply_to_id', 'reblog_of_id'])
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
->with('profile', 'hashtags', 'mentions')
->whereLocal(true)
->whereScope('public')
->orderBy('id', 'desc')
@ -517,7 +516,6 @@ class PublicApiController extends Controller
->when($textOnlyReplies != true, function($q, $textOnlyReplies) {
return $q->whereNull('in_reply_to_id');
})
->with('profile', 'hashtags', 'mentions')
->where('id', $dir, $id)
->whereIn('profile_id', $following)
->whereIn('visibility',['public', 'unlisted', 'private'])
@ -564,7 +562,6 @@ class PublicApiController extends Controller
->when(!$textOnlyReplies, function($q, $textOnlyReplies) {
return $q->whereNull('in_reply_to_id');
})
->with('profile', 'hashtags', 'mentions')
->whereIn('profile_id', $following)
->whereIn('visibility',['public', 'unlisted', 'private'])
->orderBy('created_at', 'desc')