1
0
Fork 0
forked from mirror/pixelfed

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