From 9c9562038477c60d8f9ae89b8205f77c34ac88d5 Mon Sep 17 00:00:00 2001 From: Pablo Ferreiro Date: Fri, 11 Mar 2022 23:39:56 +0100 Subject: [PATCH] Fixed /video --- app/Controllers/VideoController.php | 10 +++++----- app/Models/ItemTemplate.php | 14 -------------- 2 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 app/Models/ItemTemplate.php diff --git a/app/Controllers/VideoController.php b/app/Controllers/VideoController.php index a68a1ce..00ee453 100644 --- a/app/Controllers/VideoController.php +++ b/app/Controllers/VideoController.php @@ -3,17 +3,17 @@ namespace App\Controllers; use App\Helpers\ErrorHandler; use App\Helpers\Misc; -use App\Models\ItemTemplate; +use App\Models\FeedTemplate; class VideoController { static public function get(string $video_id) { $api = Misc::api(); - $item = $api->getVideoByID($video_id); - if ($item->meta->success) { + $feed = $api->getVideoByID($video_id); + if ($feed->meta->success) { $latte = Misc::latte(); - $latte->render(Misc::getView('video'), new ItemTemplate($item->info->detail->nickname, $item)); + $latte->render(Misc::getView('video'), new FeedTemplate('Video', $feed)); } else { - ErrorHandler::show($item->meta); + ErrorHandler::show($feed->meta); } } } diff --git a/app/Models/ItemTemplate.php b/app/Models/ItemTemplate.php deleted file mode 100644 index b4b749d..0000000 --- a/app/Models/ItemTemplate.php +++ /dev/null @@ -1,14 +0,0 @@ -item = $item; - } -}