2022-01-30 18:02:52 -05:00
|
|
|
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
|
|
|
|
use App\Helpers\ErrorHandler;
|
|
|
|
use App\Helpers\Misc;
|
2022-03-29 13:30:31 -04:00
|
|
|
use App\Helpers\Wrappers;
|
2022-05-24 08:10:41 -04:00
|
|
|
use App\Models\FullTemplate;
|
2022-01-30 18:02:52 -05:00
|
|
|
|
|
|
|
class MusicController {
|
|
|
|
static public function get(string $music_id) {
|
|
|
|
$cursor = Misc::getCursor();
|
|
|
|
|
2022-03-29 13:30:31 -04:00
|
|
|
$api = Wrappers::api();
|
2022-05-24 08:10:41 -04:00
|
|
|
$music = $api->music($music_id);
|
|
|
|
$music->feed($cursor);
|
|
|
|
if ($music->ok()) {
|
|
|
|
$data = $music->getFull();
|
2022-03-29 13:30:31 -04:00
|
|
|
$latte = Wrappers::latte();
|
2022-05-24 08:10:41 -04:00
|
|
|
$latte->render(Misc::getView('music'), new FullTemplate('Music', $data));
|
2022-01-30 18:02:52 -05:00
|
|
|
} else {
|
2022-05-24 08:10:41 -04:00
|
|
|
ErrorHandler::show($music->error());
|
2022-01-30 18:02:52 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|