Update instance config, return proper matrix limits. Fixes #4780

pull/5925/head
Daniel Supernault 8 months ago
parent 245ab3bc4f
commit 4732019087
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1

@ -1734,11 +1734,11 @@ class ApiV1Controller extends Controller
'mobile_registration' => (bool) config_cache('pixelfed.open_registration') && config('auth.in_app_registration'),
'configuration' => [
'media_attachments' => [
'image_matrix_limit' => 16777216,
'image_matrix_limit' => 2073600,
'image_size_limit' => config_cache('pixelfed.max_photo_size') * 1024,
'supported_mime_types' => explode(',', config_cache('pixelfed.media_types')),
'video_frame_rate_limit' => 120,
'video_matrix_limit' => 2304000,
'video_matrix_limit' => 2073600,
'video_size_limit' => config_cache('pixelfed.max_photo_size') * 1024,
],
'polls' => [
@ -2441,12 +2441,13 @@ class ApiV1Controller extends Controller
return true;
})
->map(function($n) use($pid) {
if(isset($n['status'])) {
->map(function ($n) use ($pid) {
if (isset($n['status'])) {
$n['status']['favourited'] = (bool) LikeService::liked($pid, $n['status']['id']);
$n['status']['reblogged'] = (bool) ReblogService::get($pid, $n['status']['id']);
$n['status']['bookmarked'] = (bool) BookmarkService::get($pid, $n['status']['id']);
}
return $n;
})
->filter(function ($n) use ($types) {

@ -101,10 +101,10 @@ class ApiV2Controller extends Controller
'media_attachments' => [
'supported_mime_types' => explode(',', config_cache('pixelfed.media_types')),
'image_size_limit' => config_cache('pixelfed.max_photo_size') * 1024,
'image_matrix_limit' => 3686400,
'image_matrix_limit' => 2073600,
'video_size_limit' => config_cache('pixelfed.max_photo_size') * 1024,
'video_frame_rate_limit' => 240,
'video_matrix_limit' => 3686400,
'video_frame_rate_limit' => 120,
'video_matrix_limit' => 2073600,
],
'polls' => [
'max_options' => 0,
@ -292,7 +292,7 @@ class ApiV2Controller extends Controller
}
}
$media = new Media();
$media = new Media;
$media->status_id = null;
$media->profile_id = $profile->id;
$media->user_id = $user->id;
@ -326,9 +326,9 @@ class ApiV2Controller extends Controller
$user->save();
Cache::forget($limitKey);
$fractal = new Fractal\Manager();
$fractal->setSerializer(new ArraySerializer());
$resource = new Fractal\Resource\Item($media, new MediaTransformer());
$fractal = new Fractal\Manager;
$fractal->setSerializer(new ArraySerializer);
$resource = new Fractal\Resource\Item($media, new MediaTransformer);
$res = $fractal->createData($resource)->toArray();
$res['preview_url'] = $media->url().'?v='.time();
$res['url'] = null;

Loading…
Cancel
Save