From 44fcc3a1e929c0f56667aa9eaf0a4de91651dfe5 Mon Sep 17 00:00:00 2001 From: Shish Date: Fri, 14 Jun 2019 13:52:27 +0100 Subject: [PATCH] rm some dead code --- ext/handle_video/main.php | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/ext/handle_video/main.php b/ext/handle_video/main.php index 192547b2..316139c8 100644 --- a/ext/handle_video/main.php +++ b/ext/handle_video/main.php @@ -55,16 +55,7 @@ class VideoFileHandler extends DataHandlerExtension */ protected function create_thumb(string $hash): bool { - $ok = false; - - $ok = create_thumbnail_ffmpeg($hash); - - return $ok; - } - - protected function video_size(string $filename): array - { - return video_size($filename); + return create_thumbnail_ffmpeg($hash); } protected function supported_ext(string $ext): bool @@ -77,8 +68,7 @@ class VideoFileHandler extends DataHandlerExtension { $image = new Image(); - //NOTE: No need to set width/height as we don't use it. - $size = $this->video_size($filename); + $size = video_size($filename); $image->width = $size[0]; $image->height = $size[1]; @@ -111,19 +101,15 @@ class VideoFileHandler extends DataHandlerExtension protected function check_contents(string $tmpname): bool { - $success = false; - if (file_exists($tmpname)) { - $mimeType = getMimeType($tmpname); - - $success = in_array($mimeType, [ + return ( + file_exists($tmpname) && + in_array(getMimeType($tmpname), [ 'video/webm', 'video/mp4', 'video/ogg', 'video/flv', 'video/x-flv' - ]); - } - - return $success; + ]) + ); } }