Wrapper update + Search by music id
This commit is contained in:
parent
fe5c2dc459
commit
4f35d68049
9 changed files with 77 additions and 17 deletions
|
|
@ -61,6 +61,22 @@ Route::add('/video/([^/]+)', function (string $video_id) {
|
|||
}
|
||||
});
|
||||
|
||||
Route::add('/music/([^/]+)', function (string $music_id) {
|
||||
$cursor = 0;
|
||||
if (isset($_GET['cursor']) && is_numeric($_GET['cursor'])) {
|
||||
$cursor = (int) $_GET['cursor'];
|
||||
}
|
||||
|
||||
$api = Misc::api();
|
||||
$feed = $api->getMusicFeed($music_id, $cursor);
|
||||
if ($feed->meta->success) {
|
||||
$latte = Misc::latte();
|
||||
$latte->render(Misc::getView('music'), ['feed' => $feed]);
|
||||
} else {
|
||||
Error::show($feed->meta);
|
||||
}
|
||||
});
|
||||
|
||||
Route::add('/tag/(\w+)', function (string $name) {
|
||||
$cursor = 0;
|
||||
if (isset($_GET['cursor']) && is_numeric($_GET['cursor'])) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue