track type management

This commit is contained in:
Codenift 2020-01-25 12:09:19 -05:00
parent 33928eaf73
commit 1d7d937a7f
29 changed files with 3082 additions and 74 deletions

View file

@ -27,6 +27,7 @@ class ApiController extends Zend_Controller_Action
"show-schedules",
"show-logo",
"track",
"track-types",
"stream-m3u"
);
@ -635,6 +636,22 @@ class ApiController extends Zend_Controller_Action
}
}
public function trackTypesAction()
{
if (Application_Model_Preference::GetAllow3rdPartyApi() || $this->checkAuth()) {
// disable the view and the layout
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$tracktypes = Application_Model_Tracktype::getTracktypes();
$this->_helper->json->sendJson($tracktypes);
} else {
header('HTTP/1.0 401 Unauthorized');
print _('You are not allowed to access this resource. ');
exit;
}
}
/**
* API endpoint to provide station metadata
*/