fixed issues of download folder not being updated promptly

This commit is contained in:
huangjx
2021-09-11 15:09:23 +08:00
parent cba9d22cc8
commit cff84cf0e5
4 changed files with 59 additions and 12 deletions

View File

@@ -35,9 +35,7 @@ class Aria2Controller extends Controller
$this->downloadDir = $this->settings->get('ncd_downloader_dir') ?? "/Downloads";
OC_Util::setupFS();
//$this->config = \OC::$server->getAppConfig();
$this->aria2 = $aria2;
$this->aria2->init();
$this->dbconn = new DBConn();
}
@@ -84,8 +82,8 @@ class Aria2Controller extends Controller
}
public function Update()
{
File::syncFolder($this->downloadDir);
return new JSONResponse([]);
$resp = File::syncFolder();
//return new JSONResponse($resp);
}
private function createActionItem($name, $path)
@@ -99,6 +97,7 @@ class Aria2Controller extends Controller
{
//$path = $this->request->getRequestUri();
$counter = $this->aria2->getCounters();
$this->Update();
switch (strtolower($path)) {
case "active":
$resp = $this->aria2->tellActive();