[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') {
|
||||
|
|
13
index.php
13
index.php
|
@ -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;
|
||||
|
@ -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