mirror of
https://github.com/pablouser1/ProxiTok.git
synced 2024-12-06 19:27:30 +01:00
Nicer error display
This commit is contained in:
@@ -9,12 +9,14 @@ use App\Models\VideoTemplate;
|
||||
class EmbedController {
|
||||
static public function v2(int $id) {
|
||||
$api = Wrappers::api();
|
||||
$feed = $api->getVideoByID($id);
|
||||
if ($feed->meta->success) {
|
||||
$video = $api->video($id);
|
||||
$video->feed();
|
||||
if ($video->ok()) {
|
||||
$data = $video->getFull();
|
||||
$latte = Wrappers::latte();
|
||||
$latte->render(Misc::getView('video'), new VideoTemplate($feed->items[0], $feed->info->detail, true));
|
||||
$latte->render(Misc::getView('video'), new VideoTemplate($data->feed->items[0], $data->info->detail, true));
|
||||
} else {
|
||||
ErrorHandler::show($feed->meta);
|
||||
ErrorHandler::showMeta($video->error());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user