mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-22 21:13:16 +00:00
Update ApiV1Controller, fix null caption on media bug
This commit is contained in:
parent
9b8e7ff628
commit
424f0271c3
2 changed files with 4 additions and 3 deletions
app/Http/Controllers
|
@ -1878,7 +1878,7 @@ class ApiV1Controller extends Controller
|
||||||
$media->original_sha256 = $hash;
|
$media->original_sha256 = $hash;
|
||||||
$media->size = $photo->getSize();
|
$media->size = $photo->getSize();
|
||||||
$media->mime = $mime;
|
$media->mime = $mime;
|
||||||
$media->caption = $request->input('description');
|
$media->caption = $request->input('description') ?? "";
|
||||||
$media->filter_class = $filterClass;
|
$media->filter_class = $filterClass;
|
||||||
$media->filter_name = $filterName;
|
$media->filter_name = $filterName;
|
||||||
if ($license) {
|
if ($license) {
|
||||||
|
@ -2106,7 +2106,7 @@ class ApiV1Controller extends Controller
|
||||||
$media->original_sha256 = $hash;
|
$media->original_sha256 = $hash;
|
||||||
$media->size = $photo->getSize();
|
$media->size = $photo->getSize();
|
||||||
$media->mime = $mime;
|
$media->mime = $mime;
|
||||||
$media->caption = $request->input('description');
|
$media->caption = $request->input('description') ?? "";
|
||||||
$media->filter_class = $filterClass;
|
$media->filter_class = $filterClass;
|
||||||
$media->filter_name = $filterName;
|
$media->filter_name = $filterName;
|
||||||
if ($license) {
|
if ($license) {
|
||||||
|
|
|
@ -119,10 +119,11 @@ class ComposeController extends Controller
|
||||||
$media->media_path = $path;
|
$media->media_path = $path;
|
||||||
$media->original_sha256 = $hash;
|
$media->original_sha256 = $hash;
|
||||||
$media->size = $photo->getSize();
|
$media->size = $photo->getSize();
|
||||||
|
$media->caption = "";
|
||||||
$media->mime = $mime;
|
$media->mime = $mime;
|
||||||
$media->filter_class = $filterClass;
|
$media->filter_class = $filterClass;
|
||||||
$media->filter_name = $filterName;
|
$media->filter_name = $filterName;
|
||||||
$media->version = 3;
|
$media->version = '3';
|
||||||
$media->save();
|
$media->save();
|
||||||
|
|
||||||
$preview_url = $media->url().'?v='.time();
|
$preview_url = $media->url().'?v='.time();
|
||||||
|
|
Loading…
Reference in a new issue