forked from mirror/pixelfed
Update StatusTransformers
This commit is contained in:
parent
f9f38ac4d4
commit
ef8960c091
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