proxitok/app/Controllers/MusicController.php

25 lines
632 B
PHP
Raw Normal View History

2022-01-30 18:02:52 -05:00
<?php
namespace App\Controllers;
use App\Helpers\ErrorHandler;
use App\Helpers\Misc;
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();
$api = Wrappers::api();
2022-05-24 08:10:41 -04:00
$music = $api->music($music_id);
$music->feed($cursor);
if ($music->ok()) {
2022-11-26 17:28:59 -05:00
$info = $music->getInfo();
$feed = $music->getFeed();
Wrappers::latte('music', new FullTemplate('Music', $info, $feed));
2022-01-30 18:02:52 -05:00
} else {
2022-09-03 08:01:03 -04:00
ErrorHandler::showMeta($music->error());
2022-01-30 18:02:52 -05:00
}
}
}