From aa5c9b48cfa5674f534acab2cdaab685e9e116ee Mon Sep 17 00:00:00 2001 From: Heshan Date: Wed, 4 May 2011 17:16:42 +0530 Subject: Run through the coder module and review the code and documentation of the module code. --- includes/conversion.inc | 9 +++++---- includes/metadata.inc | 3 ++- includes/preset.inc | 8 +++----- includes/transcoder.inc | 6 ++++-- includes/video_helper.inc | 6 ++++-- 5 files changed, 18 insertions(+), 14 deletions(-) (limited to 'includes') diff --git a/includes/conversion.inc b/includes/conversion.inc index a5a930f..76e4f34 100644 --- a/includes/conversion.inc +++ b/includes/conversion.inc @@ -50,7 +50,8 @@ class video_conversion { public function process($video) { if (is_object($video) && isset($video->fid)) { $return = $this->render($video); - } else { + } + else { $video_object = $this->load_job($video); $return = $this->render($video_object); } @@ -65,14 +66,14 @@ class video_conversion { // Make sure this video is pending or do nothing. if ($video->video_status == VIDEO_RENDERING_PENDING) { return $this->transcoder->convert_video($video); - } else { + } + else { $status = array( VIDEO_RENDERING_INQUEUE => 'in queue', VIDEO_RENDERING_COMPLETE => 'completed', VIDEO_RENDERING_FAILED => 'failed' ); - watchdog('transcoder', 'Video conversion has been !status. You should add video to the queue. Please check the re-queue to enable the video conversion.', - array('!status' => $status[$video->video_status]), WATCHDOG_WARNING); + watchdog('transcoder', 'Video conversion has been !status. You should add video to the queue. Please check the re-queue to enable the video conversion.', array('!status' => $status[$video->video_status]), WATCHDOG_WARNING); return FALSE; } } diff --git a/includes/metadata.inc b/includes/metadata.inc index b921526..ca15ac2 100644 --- a/includes/metadata.inc +++ b/includes/metadata.inc @@ -31,7 +31,8 @@ class video_metadata { } if (class_exists($metadata)) { $this->metadata = new $metadata; - } else { + } + else { drupal_set_message(t('The metadata is not configured properly.'), 'error'); } } diff --git a/includes/preset.inc b/includes/preset.inc index 7709392..40dd286 100644 --- a/includes/preset.inc +++ b/includes/preset.inc @@ -27,8 +27,7 @@ class video_preset { if (count($presets) == 0) { $form['video_preset'] = array( '#markup' => t('No Preset were found. Please use the !create_link link to create - a new Video Preset, or upload an existing Feature to your modules directory.', - array('!create_link' => l(t('Create Video Preset'), 'admin/config/media/video/presets/add'))), + a new Video Preset, or upload an existing Feature to your modules directory.', array('!create_link' => l(t('Create Video Preset'), 'admin/config/media/video/presets/add'))), '#prefix' => '
', '#suffix' => '
', ); @@ -52,9 +51,8 @@ class video_preset { '#default_value' => variable_get('video_preset', array()), '#description' => t('Please use the !manage_link link to manage Video Presets. Use the !create_link link to create - a new Video Preset, or upload an existing Feature to your modules directory.', - array('!manage_link' => l(t('Manage Video Preset'), 'admin/config/media/video/presets'), - '!create_link' => l(t('Create Video Preset'), 'admin/config/media/video/presets/add'))), + a new Video Preset, or upload an existing Feature to your modules directory.', array('!manage_link' => l(t('Manage Video Preset'), 'admin/config/media/video/presets'), + '!create_link' => l(t('Create Video Preset'), 'admin/config/media/video/presets/add'))), '#prefix' => '
', '#suffix' => '
', ); diff --git a/includes/transcoder.inc b/includes/transcoder.inc index 7c53f10..89c4d36 100644 --- a/includes/transcoder.inc +++ b/includes/transcoder.inc @@ -48,7 +48,8 @@ class video_transcoder { $transcoder_instance = new $transcoder; $this->transcoder = $transcoder_instance; return $transcoder_instance; - } else { + } + else { drupal_set_message(t('The transcoder is not configured properly.'), 'error'); } } @@ -84,7 +85,8 @@ class video_transcoder { 'thumbnails' => serialize($thumbnails), )) ->execute(); - } else { + } + else { $updatequery = db_update('video_thumbnails') ->fields(array( 'thumbnails' => serialize($thumbnails), diff --git a/includes/video_helper.inc b/includes/video_helper.inc index 41a8293..e6627ca 100644 --- a/includes/video_helper.inc +++ b/includes/video_helper.inc @@ -87,11 +87,13 @@ class video_helper { $default_thumbnail = file_load($field_settings['default_video_thumbnail']['fid']); // Check the checkbox to use default thumbnail on node $thumbnail->filepath = $default_thumbnail->uri; - } elseif (isset($variables['item']['thumbanail']) ? TRUE : FALSE) { + } + elseif (isset($variables['item']['thumbanail']) ? TRUE : FALSE) { // actual video thumbnails is present $thumbnail_load = file_load($variables['item']['thumbanail']); $thumbnail->filepath = $thumbnail_load->uri; - } else { + } + else { //need some type of default if nothing is present // drupal_set_message(t('No thumbnail has been configured for the video !title.', array('!title' => $variables['entity']->title)), 'error'); return; -- cgit v1.2.3