Merge pull request #1329 from pixelfed/frontend-ui-refactor

Update StatusTransformers
This commit is contained in:
daniel 2019-06-03 14:47:47 -06:00 committed by GitHub
commit 25bf349af9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -68,7 +68,7 @@ class StatusStatelessTransformer extends Fractal\TransformerAbstract
public function includeMediaAttachments(Status $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();
return $this->collection($media, new MediaTransformer());
}

View file

@ -68,7 +68,7 @@ class StatusTransformer extends Fractal\TransformerAbstract
public function includeMediaAttachments(Status $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();
return $this->collection($media, new MediaTransformer());
}