1
0
mirror of https://github.com/Rudloff/alltube.git synced 2024-06-28 07:40:53 +02:00

Merge branch 'develop' into feature/stream

This commit is contained in:
Pierre Rudloff 2016-10-13 17:30:30 +02:00
commit b3632ccd69

View File

@ -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);
}