added options for tracking youtube-dl downloads;bugs fixing

This commit is contained in:
huangjx
2021-09-14 22:58:36 +08:00
parent ced82caf0a
commit 2e834d4f9c
23 changed files with 649 additions and 182 deletions

View File

@@ -4,6 +4,7 @@ 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\Helper;
use OCA\NCDownloader\Tools\Settings;
@@ -60,6 +61,16 @@ class Application extends App
$container->query('Aria2')
);
});
$container->registerService('YoutubeController', function (IContainer $container) {
return new YoutubeController(
$container->query('AppName'),
$container->query('Request'),
$container->query('UserId'),
\OC::$server->getL10N('ncdownloader'),
$container->query('Aria2'),
$container->query('Youtube')
);
});
}
private function getRealDownloadDir()

View File

@@ -1,28 +1,23 @@
<?php
/**
* Create your routes in here. The name is the lowercase name of the controller
* without the controller part, the stuff after the hash is the method.
* e.g. page#index -> OCA\NCDownloader\Controller\Aria2Controller->index()
*
* The controller class has to be registered in the application.php file since
* it's instantiated in there
*/
return [
'routes' => [
['name' => 'Main#Index', 'url' => '/', 'verb' => 'GET'],
['name' => 'main#newDownload', 'url' => '/new', 'verb' => 'POST'],
['name' => 'Aria2#Action', 'url' => '/aria2/{path}', 'verb' => 'POST'],
['name' => 'Aria2#getStatus', 'url' => '/status/{path}', 'verb' => 'POST'],
['name' => 'Aria2#Update', 'url' => '/update', 'verb' => 'GET'],
//['name' => 'main#checkStatus', 'url' => '/checkstatus', 'verb' => 'POST'],
// AdminSettings
['name' => 'Settings#Admin', 'url' => '/admin/save', 'verb' => 'POST'],
// PersonalSettings
['name' => 'Settings#Personal', 'url' => '/personal/save', 'verb' => 'POST'],
['name' => 'Settings#aria2Get', 'url' => '/personal/aria2/get', 'verb' => 'POST'],
['name' => 'Settings#aria2Save', 'url' => '/personal/aria2/save', 'verb' => 'POST'],
['name' => 'Settings#aria2Delete', 'url' => '/personal/aria2/delete', 'verb' => 'POST'],
['name' => 'Main#Index', 'url' => '/', 'verb' => 'GET'],
['name' => 'main#Download', 'url' => '/new', 'verb' => 'POST'],
['name' => 'Aria2#Action', 'url' => '/aria2/{path}', 'verb' => 'POST'],
['name' => 'Aria2#getStatus', 'url' => '/status/{path}', 'verb' => 'POST'],
['name' => 'Aria2#Update', 'url' => '/update', 'verb' => 'GET'],
['name' => 'Youtube#Index', 'url' => '/youtube/get', 'verb' => 'POST'],
['name' => 'Youtube#Download', 'url' => '/youtube/new', 'verb' => 'POST'],
['name' => 'Youtube#Delete', 'url' => '/youtube/delete', 'verb' => 'POST'],
['name' => 'Search#Execute', 'url' => '/search', 'verb' => 'POST'],
// AdminSettings
['name' => 'Settings#Admin', 'url' => '/admin/save', 'verb' => 'POST'],
// PersonalSettings
['name' => 'Settings#Personal', 'url' => '/personal/save', 'verb' => 'POST'],
['name' => 'Settings#aria2Get', 'url' => '/personal/aria2/get', 'verb' => 'POST'],
['name' => 'Settings#aria2Save', 'url' => '/personal/aria2/save', 'verb' => 'POST'],
['name' => 'Settings#aria2Delete', 'url' => '/personal/aria2/delete', 'verb' => 'POST'],
]
],
];