mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-27 00:33:17 +00:00
Merge pull request #1328 from pixelfed/frontend-ui-refactor
Update DiscoverController
This commit is contained in:
commit
88225a87ca
1 changed files with 10 additions and 7 deletions
|
@ -143,6 +143,7 @@ class DiscoverController extends Controller
|
||||||
abort_if(!config('exp.loops'), 403);
|
abort_if(!config('exp.loops'), 403);
|
||||||
|
|
||||||
// todo proper pagination, maybe LoopService
|
// todo proper pagination, maybe LoopService
|
||||||
|
$res = Cache::remember('discover:loops:recent', now()->addHours(1), function() {
|
||||||
$loops = Status::whereType('video')
|
$loops = Status::whereType('video')
|
||||||
->whereScope('public')
|
->whereScope('public')
|
||||||
->latest()
|
->latest()
|
||||||
|
@ -151,6 +152,8 @@ class DiscoverController extends Controller
|
||||||
|
|
||||||
$resource = new Fractal\Resource\Collection($loops, new StatusStatelessTransformer());
|
$resource = new Fractal\Resource\Collection($loops, new StatusStatelessTransformer());
|
||||||
return $this->fractal->createData($resource)->toArray();
|
return $this->fractal->createData($resource)->toArray();
|
||||||
|
});
|
||||||
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue