mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 08:44:49 +00:00
Merge pull request #1329 from pixelfed/frontend-ui-refactor
Update StatusTransformers
This commit is contained in:
commit
25bf349af9
2 changed files with 2 additions and 2 deletions
|
@ -68,7 +68,7 @@ class StatusStatelessTransformer extends Fractal\TransformerAbstract
|
||||||
public function includeMediaAttachments(Status $status)
|
public function includeMediaAttachments(Status $status)
|
||||||
{
|
{
|
||||||
return Cache::remember('status:transformer:media:attachments:'.$status->id, now()->addMinutes(3), function() use($status) {
|
return Cache::remember('status:transformer:media:attachments:'.$status->id, now()->addMinutes(3), function() use($status) {
|
||||||
if(in_array($status->type, ['photo', 'video'])) {
|
if(in_array($status->type, ['photo', 'video', 'photo:album', 'loop'])) {
|
||||||
$media = $status->media()->orderBy('order')->get();
|
$media = $status->media()->orderBy('order')->get();
|
||||||
return $this->collection($media, new MediaTransformer());
|
return $this->collection($media, new MediaTransformer());
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
||||||
public function includeMediaAttachments(Status $status)
|
public function includeMediaAttachments(Status $status)
|
||||||
{
|
{
|
||||||
return Cache::remember('status:transformer:media:attachments:'.$status->id, now()->addMinutes(3), function() use($status) {
|
return Cache::remember('status:transformer:media:attachments:'.$status->id, now()->addMinutes(3), function() use($status) {
|
||||||
if(in_array($status->type, ['photo', 'video'])) {
|
if(in_array($status->type, ['photo', 'video', 'photo:album', 'loop'])) {
|
||||||
$media = $status->media()->orderBy('order')->get();
|
$media = $status->media()->orderBy('order')->get();
|
||||||
return $this->collection($media, new MediaTransformer());
|
return $this->collection($media, new MediaTransformer());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue