[add] video can be re-download
This commit is contained in:
parent
17659173e3
commit
c83f4b2388
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 38 KiB |
|
@ -230,6 +230,7 @@ if (!empty($ci['ac']) && $ci['ac'] === 'view' && !empty($listCurrentFile)) {
|
|||
<a href="?ac=view&bc=', $ci['bc'], '&file=', $ci['file'], '&token=', $token, '&op=cutVideo"><img src="images/cut.svg" alt="Cut this video" title="Cut this video"/></a>
|
||||
<a href="?ac=view&op=3&bc=', $ci['bc'], '&file=', $ci['file'], '&token=', $token, '"><img src="images/useThumbnail.svg" alt="Use this thumbnail for folder thumbnail" title="Use this thumbnail for folder thumbnail"/></a>
|
||||
<a href="?ac=view&bc=', $ci['bc'], '&file=', $ci['file'], '&token=', $token, '&op=confDelVideo"><img src="images/delete.svg" alt="Delete this video" title="Delete this video"/></a>
|
||||
<a href="?ac=view&bc=', $ci['bc'], '&file=', $ci['file'], '&token=', $token, '&op=reDownload"><img src="images/reload.svg" alt="Re-download" title="Re-download"/></a>
|
||||
</div>';
|
||||
}
|
||||
if ($GLOBALS['config']['DOWNLOAD_METHOD'] === 'xsendfile' || $GLOBALS['config']['DOWNLOAD_METHOD'] === 'php') {
|
||||
|
|
21
index.php
21
index.php
|
@ -348,7 +348,7 @@ function addVideo($ci, $fullListFile) {
|
|||
} else {
|
||||
$path = '';
|
||||
}
|
||||
if(isset($ci['ddl']) && (int)$ci['ddl'] === 1){
|
||||
if (isset($ci['ddl']) && (int)$ci['ddl'] === 1) {
|
||||
$ddl = 1;
|
||||
} else {
|
||||
$ddl = 0;
|
||||
|
@ -365,6 +365,12 @@ function addVideo($ci, $fullListFile) {
|
|||
file_put_contents($GLOBALS['config']['LISTFILE'], "<?php\n\$fullListFile=".var_export($fullListFile, true).";\n?>");
|
||||
}
|
||||
|
||||
function redownloadVideo($bc, $file){
|
||||
$path = $GLOBALS['config']['VIDEODIR'].'/'.chunk_split($bc, 8, '/');
|
||||
$pathAndFile = $path.$file;
|
||||
rename($pathAndFile.'.hash', $GLOBALS['config']['TMPDIR'].'/'.$file.'.hash');
|
||||
}
|
||||
|
||||
function deleteVideo($bc, $file) {
|
||||
$path = $GLOBALS['config']['VIDEODIR'].'/'.chunk_split($bc, 8, '/');
|
||||
$pathAndFile = $path.$file;
|
||||
|
@ -486,7 +492,7 @@ function makeRss($breadcrumb, $fullListFile) {
|
|||
<link>http://'.$_SERVER['HTTP_HOST'].'</link>';
|
||||
foreach ($allFile as $value) {
|
||||
$oriValues = $value;
|
||||
$hash = substr(str_replace('.webm','',$oriValues),-10, 10);
|
||||
$hash = substr(str_replace('.webm', '', $oriValues), -10, 10);
|
||||
$rss .= '
|
||||
<item>
|
||||
<title>'.html_entity_decode($fullListFile[$hash]['title'], ENT_QUOTES, "UTF-8").'</title>
|
||||
|
@ -522,8 +528,8 @@ function getVideoInfo($file, $dir, $fullListFile) {
|
|||
$size = $jsonSize[0].'x'.$jsonSize[1];
|
||||
$time = gmdate('H\hi\ms\s', $jsonInfo -> duration);
|
||||
$uploadDate = htmlentities($jsonInfo -> upload_date, ENT_QUOTES, "UTF-8");
|
||||
if(empty($uploadDate)){
|
||||
$uploadDate = gmdate ("Ymd", filemtime($GLOBALS['config']['VIDEODIR']."/".$path.$file.".webm"));
|
||||
if (empty($uploadDate)) {
|
||||
$uploadDate = gmdate("Ymd", filemtime($GLOBALS['config']['VIDEODIR']."/".$path.$file.".webm"));
|
||||
}
|
||||
$info = array(
|
||||
'hash' => $file,
|
||||
|
@ -788,6 +794,13 @@ if (isset($ci['ac']) && !empty($ci['ac'])) {
|
|||
die('Tinker say : Blinded you, with Science! ');
|
||||
}
|
||||
cutVideo($ci['bc'], $ci['file']);
|
||||
}
|
||||
if ($ci['ac'] === 'view' && !empty($ci['op']) && $ci['op'] === 'reDownload') {
|
||||
verifToken($ci['token']);
|
||||
if (!isLog()) {
|
||||
die('Tinker say : Blinded you, with Science! ');
|
||||
}
|
||||
reDownloadVideo($ci['bc'], $ci['file']);
|
||||
}
|
||||
if ($ci['ac'] === 'viewQueue' || $ci['ac'] === 'clearCache') {
|
||||
verifToken($ci['token']);
|
||||
|
|
Loading…
Reference in New Issue