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 + +

Re-index Clipbucket

Here you can re-index your videos, users or groups statistics. From below select which thing you want to re-index. diff --git a/upload/admin_area/styles/cbv3/layout/javascript.html b/upload/admin_area/styles/cbv3/layout/javascript.html index 0071c012..fdb2db0f 100644 --- a/upload/admin_area/styles/cbv3/layout/javascript.html +++ b/upload/admin_area/styles/cbv3/layout/javascript.html @@ -3,7 +3,7 @@ { $('.popover-class').popover(); - $('a[rel=tooltip], span[rel=tooltip]').tooltip(); + $('img[rel=tooltip], a[rel=tooltip], span[rel=tooltip]').tooltip(); //Setting Up the Left Column and Menu List diff --git a/upload/admin_area/styles/cbv3/layout/reindex_cb.html b/upload/admin_area/styles/cbv3/layout/reindex_cb.html index 4c0f3eff..1eead2e4 100644 --- a/upload/admin_area/styles/cbv3/layout/reindex_cb.html +++ b/upload/admin_area/styles/cbv3/layout/reindex_cb.html @@ -1,4 +1,4 @@ -Re-index Clipbucket +

Re-index Clipbucket

Here you can re-index your videos, users or groups statistics. From below select which thing you want to re-index. @@ -17,7 +17,7 @@ Here you can re-index your videos, users or groups statistics. From below select
-
@@ -28,7 +28,7 @@ Here you can re-index your videos, users or groups statistics. From below select
-
@@ -40,7 +40,7 @@ Here you can re-index your videos, users or groups statistics. From below select
-
@@ -52,7 +52,7 @@ Here you can re-index your videos, users or groups statistics. From below select
-
@@ -64,7 +64,7 @@ Here you can re-index your videos, users or groups statistics. From below select
-
@@ -82,7 +82,12 @@ Here you can re-index your videos, users or groups statistics. From below select var start_index = '{$next_index}'; var loop_size = '{$smarty.get.loop_size}'; var mode = '{$mode}'; -{literal}$(document).oneTime(2000,function(){$(window.location).attr('href', '?loop_size='+loop_size+'&'+mode+'=yes&start_index='+start_index)});{/literal} + +setInterval(function() { + $(window.location).attr('href', '?loop_size='+loop_size+'&'+mode+'=yes&start_index='+start_index) +}, 2000); + + redirecting....do not close this window {else} diff --git a/upload/admin_area/styles/cbv3/layout/repair_vid_duration.html b/upload/admin_area/styles/cbv3/layout/repair_vid_duration.html index 70d92d78..89ec70c2 100644 --- a/upload/admin_area/styles/cbv3/layout/repair_vid_duration.html +++ b/upload/admin_area/styles/cbv3/layout/repair_vid_duration.html @@ -1,29 +1,62 @@

ClipBucket video duration fix

-
+
+ +
+ Clipbucket repair video duration using file conversion logs of each file, if there is no log, duration fix is likely not possible.
+ * with log => those videos that have file conversion log
+ * with no log => those don't have any conversion log
+ +
-Clipbucket repair video duration using file conversion logs of each file, if there is no log, duration fix is likely not possible.
-* with log => those videos that have file conversion log
-* with no log => those don't have any conversion log
-
{if $videos} -
- - - -
-
- - {foreach from=$videos item=video} - {assign var=filename value=$video.file_name} - {assign var=log value=func->get_file_details($filename)} -
-
-
{if $fixed_array.$filename}[FIXED] {/if}{$video.title} (duration : {$vdo.duration|setTime} | Has Log :{if $log} yes{else}no{/if} )
-
-
- {/foreach} - {else} - No videos found with duration less than or equal to 1 +
+
+
+
+ + +
+ +
+ +
+
+
+ +
+ + + + + + + + + + + + + + {foreach $videos as $video} + + + + + + + + {/foreach} + +
#TitleDurationHas LogStatus
{$video.videoid}{$video.title} {if $fixed_array.$filename}Fixed{/if}{$video.duration|setTime}{if $log}Yes{else}No{/if}{$video.status}
+
+ + {if !$videos} +
No videos found with duration less than or equal to 1
{/if} -
+ +
\ No newline at end of file