$request = $app->request; $start = $request->params('s'); $end = $request->params('e'); $series = new Series($conf, $series_path, $app_base_url, $start, $end); $picture = new Picture($conf, $series->getRepresentative(), $app_base_url, $series->getFullPath()); $app->redirect($picture->getUrl($series, $format)); }); $app->get('/ajax/series/infos/:series/:image', function ($series_path, $img) use($app, $conf, $app_base_url) { $request = $app->request; $start = $request->params('s'); $end = $request->params('e'); $series = new Series($conf, $series_path, $app_base_url, $start, $end); if ($img !== null) { $series->setImage($img); } $infos = $series->getInfos(); echo json_encode($infos); }); $app->get('/ajax/image/infos/:image_params+', function ($img_params) use($app, $conf) { $img = array_pop($img_params); $path = null; if (count($img_params) > 0) { $path = implode('/', $img_params) . '/'; } $rcontents = Picture::getRemoteInfos($conf->getRemoteInfos(), $path, $img); $infos = array(); if ($rcontents !== null) { $infos['remote'] = $rcontents; } echo json_encode($infos); });