This commit is contained in:
benson
2025-03-26 21:59:18 +08:00
parent 777892e257
commit efb85ff22d
2 changed files with 5 additions and 4 deletions

View File

@@ -11,9 +11,10 @@ use Symfony\Component\Console\Output\OutputInterface;
class Aria2Command extends Base class Aria2Command extends Base
{ {
public function __construct() private $dbconn;
public function __construct(\OCP\IDBConnection $connection)
{ {
$this->dbconn = new DbHelper(); $this->dbconn = new DbHelper($connection);
parent::__construct(); parent::__construct();
} }
protected function configure() protected function configure()

View File

@@ -148,7 +148,7 @@ class Helper
if (is_array($msg)) { if (is_array($msg)) {
$msg = implode(",", $msg); $msg = implode(",", $msg);
} }
$logger = \OC::$server->getLogger(); $logger = self::getLogger();
$logger->error($msg, ['app' => 'ncdownloader']); $logger->error($msg, ['app' => 'ncdownloader']);
} }
@@ -419,7 +419,7 @@ class Helper
public static function getUser(): ?IUser public static function getUser(): ?IUser
{ {
return \OC::$server->getUserSession()->getUser(); return \OC::$server->get(\OCP\IUserSession::class)->getUser();
} }
public static function getUID(): string public static function getUID(): string