Skip to content

Commit

Permalink
Update ComposeController, use placeholder image for video media. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup committed Jan 30, 2021
1 parent eab4370 commit 789ed4b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/Http/Controllers/ComposeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use App\Services\MediaPathService;
use App\Services\MediaBlocklistService;
use App\Services\MediaTagService;
use App\Services\ServiceService;
use Illuminate\Support\Str;
use App\Util\Lexer\Autolink;
use App\Util\Lexer\Extractor;
Expand Down Expand Up @@ -117,10 +118,9 @@ public function mediaUpload(Request $request)
$media->version = 3;
$media->save();

// $url = URL::temporarySignedRoute(
// 'temp-media', now()->addHours(1), ['profileId' => $profile->id, 'mediaId' => $media->id, 'timestamp' => time()]
// );

$preview_url = $media->url() . '?v=' . time();
$url = $media->url() . '?v=' . time();

switch ($media->mime) {
case 'image/jpeg':
case 'image/png':
Expand All @@ -139,8 +139,8 @@ public function mediaUpload(Request $request)

$resource = new Fractal\Resource\Item($media, new MediaTransformer());
$res = $this->fractal->createData($resource)->toArray();
$res['preview_url'] = $media->url() . '?v=' . time();
$res['url'] = $media->url() . '?v=' . time();
$res['preview_url'] = $preview_url;
$res['url'] = $url;
return response()->json($res);
}

Expand Down

0 comments on commit 789ed4b

Please sign in to comment.