mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update mobile apis, add blurhash
This commit is contained in:
parent
4415af1bf0
commit
cf40526ef9
2 changed files with 5 additions and 4 deletions
|
@ -1087,8 +1087,8 @@ class ApiV1Controller extends Controller
|
|||
|
||||
$resource = new Fractal\Resource\Item($media, new MediaTransformer());
|
||||
$res = $this->fractal->createData($resource)->toArray();
|
||||
$res['preview_url'] = url('/storage/no-preview.png');
|
||||
$res['url'] = url('/storage/no-preview.png');
|
||||
$res['preview_url'] = $media->url(). '?cb=1&_v=' . time();
|
||||
$res['url'] = $media->url(). '?cb=1&_v=' . time();
|
||||
return response()->json($res);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@ class MediaTransformer extends Fractal\TransformerAbstract
|
|||
return [
|
||||
'id' => (string) $media->id,
|
||||
'type' => $media->activityVerb(),
|
||||
'url' => $media->url(),
|
||||
'url' => $media->url() . '?cb=1&_v=' . time(),
|
||||
'remote_url' => null,
|
||||
'preview_url' => $media->thumbnailUrl(),
|
||||
'preview_url' => $media->thumbnailUrl() . '?cb=1&_v=' . time(),
|
||||
'text_url' => null,
|
||||
'meta' => null,
|
||||
'description' => $media->caption,
|
||||
|
@ -24,6 +24,7 @@ class MediaTransformer extends Fractal\TransformerAbstract
|
|||
'filter_name' => $media->filter_name,
|
||||
'filter_class' => $media->version == 1 ? $media->filter_class : null,
|
||||
'mime' => $media->mime,
|
||||
'blurhash' => $media->blurhash
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue