[add] video can be re-download

This commit is contained in:
Knah Tsaeb 2015-01-30 15:09:21 +01:00
parent 17659173e3
commit c83f4b2388
3 changed files with 557 additions and 9 deletions

534
images/reload.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -230,6 +230,7 @@ if (!empty($ci['ac']) && $ci['ac'] === 'view' && !empty($listCurrentFile)) {
<a href="?ac=view&amp;bc=', $ci['bc'], '&amp;file=', $ci['file'], '&amp;token=', $token, '&amp;op=cutVideo"><img src="images/cut.svg" alt="Cut this video" title="Cut this video"/></a>
<a href="?ac=view&amp;op=3&amp;bc=', $ci['bc'], '&amp;file=', $ci['file'], '&amp;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&amp;bc=', $ci['bc'], '&amp;file=', $ci['file'], '&amp;token=', $token, '&amp;op=confDelVideo"><img src="images/delete.svg" alt="Delete this video" title="Delete this video"/></a>
<a href="?ac=view&amp;bc=', $ci['bc'], '&amp;file=', $ci['file'], '&amp;token=', $token, '&amp;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') {

View File

@ -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']);