1
0
Fork 0
forked from mirror/pixelfed

Update DiscoverController

This commit is contained in:
Daniel Supernault 2019-06-03 13:49:31 -06:00
parent b02148d110
commit f9f38ac4d4
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -143,6 +143,7 @@ class DiscoverController extends Controller
abort_if(!config('exp.loops'), 403);
// todo proper pagination, maybe LoopService
$res = Cache::remember('discover:loops:recent', now()->addHours(1), function() {
$loops = Status::whereType('video')
->whereScope('public')
->latest()
@ -151,6 +152,8 @@ class DiscoverController extends Controller
$resource = new Fractal\Resource\Collection($loops, new StatusStatelessTransformer());
return $this->fractal->createData($resource)->toArray();
});
return $res;
}