mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 08:44:02 +00:00
Update StoryItemTransformer
This commit is contained in:
parent
c8abffb811
commit
876323228a
1 changed files with 4 additions and 3 deletions
|
@ -12,14 +12,15 @@ class StoryItemTransformer extends Fractal\TransformerAbstract
|
||||||
public function transform(StoryItem $item)
|
public function transform(StoryItem $item)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'id' => (string) Str::uuid(),
|
'id' => (string) $item->id,
|
||||||
'type' => $item->type,
|
'type' => $item->type,
|
||||||
'length' => $item->duration,
|
'length' => $item->duration != 0 ? $item->duration : 3,
|
||||||
'src' => $item->url(),
|
'src' => $item->url(),
|
||||||
'preview' => null,
|
'preview' => null,
|
||||||
'link' => null,
|
'link' => null,
|
||||||
'linkText' => null,
|
'linkText' => null,
|
||||||
'time' => $item->updated_at->format('U'),
|
'time' => $item->created_at->format('U'),
|
||||||
|
'expires_at' => $item->created_at->addHours(24)->format('U'),
|
||||||
'seen' => $item->story->seen(),
|
'seen' => $item->story->seen(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue