Skip to content

Commit e2ac702

Browse files
Small Refactoring
1 parent 2efc332 commit e2ac702

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/Controllers/ApiController.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ public function convert(Request $request)
3333
return new JsonResponse(['error' => true, 'error_messages' => $validator->errors()], Response::HTTP_BAD_REQUEST);
3434
}
3535

36-
$url = Arr::get($validator->validated(), 'url');
37-
$format = Arr::get($validator->validated(), 'format', 'mp3');
36+
$validated = $validator->validated();
37+
38+
$url = Arr::get($validated, 'url');
39+
$format = Arr::get($validated, 'format', 'mp3');
3840

3941
parse_str(parse_url($url, PHP_URL_QUERY), $queryvars);
4042

@@ -70,7 +72,7 @@ public function convert(Request $request)
7072
'output' => '%(id)s.%(ext)s',
7173
);
7274

73-
if(config('youtube-api.ffmpeg_path', null) !== null) {
75+
if(config('youtube-api.ffmpeg_path') !== null) {
7476
$options['ffmpeg-location'] = config('youtube-api.ffmpeg_path');
7577
}
7678
}

0 commit comments

Comments
 (0)