Merge branch 'develop' into feature/stream
This commit is contained in:
commit
b3632ccd69
1 changed files with 48 additions and 42 deletions
|
@ -47,10 +47,8 @@ class FrontController
|
|||
{
|
||||
$this->config = Config::getInstance();
|
||||
$this->download = new VideoDownload();
|
||||
if ($container instanceof Container) {
|
||||
$this->container = $container;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display index page.
|
||||
|
@ -62,6 +60,7 @@ class FrontController
|
|||
*/
|
||||
public function index(Request $request, Response $response)
|
||||
{
|
||||
if ($this->container instanceof Container) {
|
||||
$this->container->view->render(
|
||||
$response,
|
||||
'index.tpl',
|
||||
|
@ -72,6 +71,7 @@ class FrontController
|
|||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a list of extractors.
|
||||
|
@ -83,6 +83,7 @@ class FrontController
|
|||
*/
|
||||
public function extractors(Request $request, Response $response)
|
||||
{
|
||||
if ($this->container instanceof Container) {
|
||||
$this->container->view->render(
|
||||
$response,
|
||||
'extractors.tpl',
|
||||
|
@ -95,6 +96,7 @@ class FrontController
|
|||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dislay information about the video.
|
||||
|
@ -129,6 +131,7 @@ class FrontController
|
|||
}
|
||||
} else {
|
||||
$video = $this->download->getJSON($params['url']);
|
||||
if ($this->container instanceof Container) {
|
||||
$this->container->view->render(
|
||||
$response,
|
||||
'video.tpl',
|
||||
|
@ -140,6 +143,7 @@ class FrontController
|
|||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return $response->withRedirect($this->container->get('router')->pathFor('index'));
|
||||
}
|
||||
|
@ -156,6 +160,7 @@ class FrontController
|
|||
*/
|
||||
public function error(Request $request, Response $response, \Exception $exception)
|
||||
{
|
||||
if ($this->container instanceof Container) {
|
||||
$this->container->view->render(
|
||||
$response,
|
||||
'error.tpl',
|
||||
|
@ -165,6 +170,7 @@ class FrontController
|
|||
'title' => 'Error',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
return $response->withStatus(500);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue