removed superfluous code

This commit is contained in:
huangjx
2021-10-24 09:53:47 +08:00
parent 3a8cf3a71f
commit 44b0976cf8

View File

@@ -70,12 +70,10 @@ class MainController extends Controller
private function _download($url)
{
$filename = Helper::getFileName($url);
if ($filename) {
if ($filename = Helper::getFileName($url)) {
$this->aria2->setFileName($filename);
}
$result = $this->aria2->download($url);
if (!$result) {
if (!($result = $this->aria2->download($url))) {
return ['error' => 'failed to download the file for some reason!'];
}
if (isset($result['error'])) {
@@ -105,14 +103,12 @@ class MainController extends Controller
move_uploaded_file($_FILES['torrentfile']['tmp_name'], $file);
$result = $this->aria2->btDownload($file);
if (!$result) {
if (!($result = $this->aria2->btDownload($file))) {
return ['error' => 'failed to download the file for some reason!'];
}
if (isset($result['error'])) {
return $result;
}
$data = [
'uid' => $this->uid,
'gid' => $result['gid'],