diff --git a/upload/admin_area/repair_vid_duration.php b/upload/admin_area/repair_vid_duration.php
index 3bf0d527..57a6d298 100644
--- a/upload/admin_area/repair_vid_duration.php
+++ b/upload/admin_area/repair_vid_duration.php
@@ -1,66 +1,59 @@
admin_login_check();
$userquery->login_check('web_config_access');
-$params = array('duration'=>'1','duration_op'=>'<=','status'=>'Successful');
+$params = array('duration' => '1', 'duration_op' => '<=', 'status' => 'Successful');
$videos = get_videos($params);
$fixed_array = array();
-if($_POST['fix_duration']
- || $_POST['mark_failed']
- || $_POST['mark_delete'])
-{
- foreach($videos as $video)
- {
- $log = get_file_details($video['file_name']);
-
- if($log && $_POST['fix_duration'])
- {
- //$duration = $log['output_duration'];
- //if(!$duration)
- // $duration = $log['duration'];
-
- $duration = parse_duration(LOGS_DIR.'/'.$video['file_name'].'.log');
-
- if(!$duration)
- e("Can't do anything about \"".$video['title']."\"");
- else
- {
- $db->update(tbl('video'),array('duration'),array($duration),"videoid='".$video['videoid']."'");
- $fixed_array[$video['file_name']] = 'yes';
- e("Succesfully updated duration of \"".$video['title']."\" to ".SetTime($duration),'m');
- }
- }
-
- if(!$log && $_POST['mark_failed'])
- {
- $db->update(tbl("video"),array("status","failed_reason"),
- array('Failed',"Unable to get video duration")," file_name='".$video['file_name']."'");
- e("\"".$video['title']."\" status has been changed to Failed","m");
- }
-
- if(!$log && $_POST['mark_delete'])
- {
- $db->update(tbl("video"),array("status","failed_reason"),
- array('Failed',"Unable to get video duration")," file_name='".$video['file_name']."'");
-
- $cbvideo->delete_video($video['videoid']);
- }
- }
- $videos = get_videos($params);
+
+$action = $_POST['action'];
+if ($action) {
+ foreach ($videos as $video) {
+ $log = get_file_details($video['file_name']);
+
+ if ($log && $action == 'fix') {
+ //$duration = $log['output_duration'];
+ //if(!$duration)
+ // $duration = $log['duration'];
+
+ $duration = parse_duration(LOGS_DIR . '/' . $video['file_name'] . '.log');
+
+ if (!$duration)
+ e("Can't do anything about \"" . $video['title'] . "\"");
+ else {
+ $db->update(tbl('video'), array('duration'), array($duration), "videoid='" . $video['videoid'] . "'");
+ $fixed_array[$video['file_name']] = 'yes';
+ e("Succesfully updated duration of \"" . $video['title'] . "\" to " . SetTime($duration), 'm');
+ }
+ }
+
+ if (!$log && $action == 'fail') {
+ $db->update(tbl("video"), array("status", "failed_reason"), array('Failed', "Unable to get video duration"), " file_name='" . $video['file_name'] . "'");
+ e("\"" . $video['title'] . "\" status has been changed to Failed", "m");
+ }
+
+ if (!$log && $action == 'delete') {
+ $db->update(tbl("video"), array("status", "failed_reason"), array('Failed', "Unable to get video duration"), " file_name='" . $video['file_name'] . "'");
+
+ $cbvideo->delete_video($video['videoid']);
+ }
+ }
+ $videos = get_videos($params);
}
subtitle("Repair videos duration");
-assign('videos',$videos);
-assign('fixed_array',$fixed_array);
+assign('videos', $videos);
+assign('fixed_array', $fixed_array);
template_files('repair_vid_duration.html');
display_it();
?>
\ No newline at end of file
diff --git a/upload/admin_area/styles/cbv2/layout/reindex_cb.html b/upload/admin_area/styles/cbv2/layout/reindex_cb.html
index 4c0f3eff..3be18b40 100644
--- a/upload/admin_area/styles/cbv2/layout/reindex_cb.html
+++ b/upload/admin_area/styles/cbv2/layout/reindex_cb.html
@@ -1,4 +1,5 @@
-Re-index Clipbucket
+
+