From 93b2daff3db922541e3cd1cb59081f15025439c8 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 15 Sep 2014 00:43:22 +0200 Subject: fixed typos and improved usability --- dl.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'dl.php') diff --git a/dl.php b/dl.php index 65178a7..3fd0753 100644 --- a/dl.php +++ b/dl.php @@ -120,7 +120,7 @@ switch($_GET["task"]){ case("stream"): ignore_user_abort(true); if(file_exists($CACHEDIR."/".$info[2].".txt")) - failure('Already doing the request.', false); + failure('

Already processing the request. Check back later.


This is very cpu intensive operation, so thanks for your understanding.


ajax-loader', false); # send 'cached' response in case we already have the video on disk if(file_exists($CACHEDIR."/".$info[2]) && !file_exists($CACHEDIR."/".$info[2].".txt")){ echo "cached"; @@ -132,7 +132,6 @@ switch($_GET["task"]){ failure("Fetching the video failed.", false); else unlink($CACHEDIR."/".$info[2].".txt"); - } break; case("player"): @@ -144,21 +143,25 @@ switch($_GET["task"]){ break; case("convert"): + ignore_user_abort(true); + /* $dir = array_diff(scandir($CACHEDIR), array('.', '..')); if(!in_array($_GET['vid'], $dir)){ - failure('Video not found.' false); + failure('Video not found.', false); } + */ if(file_exists($CACHEDIR."/".$info[2].".webm.txt")) - exit; + failure('

Already processing the request. Check back later.


( This is very cpu intensive operation, so thanks for your understanding. )


ajax-loader', false); if(file_exists($CACHEDIR."/".$info[2]."webm")){ echo "cached"; exit; - } - if(!convert_video($info[2])) - failure("Converting video failed.", false); - else - unlink($CACHEDIR."/".$info[2].".webm.txt"); + } else { + if(!convert_video($CACHEDIR, $info[2])) + failure("Converting video failed.", false); + else + unlink($CACHEDIR."/".$info[2].".webm.txt"); + } $finfo = new finfo(FILEINFO_MIME_TYPE); $mime = $finfo->file($CACHEDIR . "/" . $info[2]); -- cgit v1.2.3