tidying up

This commit is contained in:
huangjx
2022-07-24 10:54:02 +08:00
parent 96c7128ef7
commit 3a00325042
32 changed files with 146 additions and 144 deletions

View File

@@ -4,12 +4,12 @@ namespace OCA\NCDownloader\AppInfo;
use OCA\NCDownloader\Controller\Aria2Controller;
use OCA\NCDownloader\Controller\MainController;
use OCA\NCDownloader\Controller\YoutubeController;
use OCA\NCDownloader\Tools\Aria2;
use OCA\NCDownloader\Tools\Client;
use OCA\NCDownloader\Controller\YtdlController;
use OCA\NCDownloader\Aria2\Aria2;
use OCA\NCDownloader\Http\Client;
use OCA\NCDownloader\Tools\Helper;
use OCA\NCDownloader\Tools\Settings;
use OCA\NCDownloader\Tools\Youtube;
use OCA\NCDownloader\Db\Settings;
use OCA\NCDownloader\Ytdl\Ytdl;
use OCP\AppFramework\App;
use OCP\IContainer;
use Symfony\Component\DomCrawler\Crawler;
@@ -32,9 +32,9 @@ class Application extends App
return new Aria2(Helper::getAria2Config($this->uid));
});
$container->registerService('Youtube', function (IContainer $container) {
$config = Helper::getYoutubeConfig($this->uid);
return new Youtube($config);
$container->registerService('Ytdl', function (IContainer $container) {
$config = Helper::getYtdlConfig($this->uid);
return new Ytdl($config);
});
$container->registerService('Settings', function (IContainer $container) {
@@ -49,7 +49,7 @@ class Application extends App
\OC::$server->getL10N('ncdownloader'),
//\OC::$server->getRootFolder(),
$container->query('Aria2'),
$container->query('Youtube')
$container->query('Ytdl')
);
});
@@ -63,14 +63,14 @@ class Application extends App
$container->query('Aria2')
);
});
$container->registerService('YoutubeController', function (IContainer $container) {
return new YoutubeController(
$container->registerService('YtdlController', function (IContainer $container) {
return new YtdlController(
$container->query('AppName'),
$container->query('Request'),
$container->query('UserId'),
\OC::$server->getL10N('ncdownloader'),
$container->query('Aria2'),
$container->query('Youtube')
$container->query('Ytdl')
);
});
$container->registerService('httpClient', function () {